2 * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.nemo.user.vnspacemanager.structurestyle.updateintent;
\r
10 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
\r
11 import org.opendaylight.nemo.user.tenantmanager.TenantManage;
\r
12 import org.opendaylight.nemo.user.vnspacemanager.instancecheck.ResultInstanceCheck;
\r
13 import org.opendaylight.nemo.user.vnspacemanager.syntaxcheck.ResultDefinitionCheck;
\r
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.common.rev151010.UserId;
\r
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.nemo.intent.rev151010.user.intent.Results;
\r
18 * Created by z00293636 on 2015/8/31.
\r
20 public class UpdateResult {
\r
22 private DataBroker dataBroker;
\r
23 private TenantManage tenantManage;
\r
24 private ResultDefinitionCheck resultDefinitionCheck;
\r
25 private ResultInstanceCheck resultInstanceCheck;
\r
27 public UpdateResult(DataBroker dataBroker, TenantManage tenantManage)
\r
29 this.dataBroker = dataBroker;
\r
30 this.tenantManage = tenantManage;
\r
31 resultDefinitionCheck = new ResultDefinitionCheck();
\r
32 resultInstanceCheck = new ResultInstanceCheck(tenantManage);
\r
35 public String ResultHandling(UserId userId, Results results)
\r
37 String errorDefinition = resultDefinitionCheck.CheckDefinition(results);
\r
38 String errorInstance = resultInstanceCheck.checkResultInstance(userId,results);
\r
40 if (errorDefinition!= null)
\r
42 return errorDefinition;
\r
44 else if (errorInstance != null)
\r
46 return errorInstance;
\r