From 66b06d89979610c90490d9b343bc44c227bf8395 Mon Sep 17 00:00:00 2001 From: 黄卓垚10112215 Date: Wed, 27 Sep 2017 21:15:46 +0800 Subject: service-topology-operation Change-Id: I26b03516eb73689f806aa9ea5f1edcb22a1c4d84 Issue-ID: SO-88 Signed-off-by: Zhuoyao Huang <10112215@zte.com.cn> Discription: Network-topology-operation should work with Service-topology-operation. This commit is for the Service-topology-operation. --- .../serviceTask/AbstractSdncOperationTask.java | 132 ++++++++++ .../serviceTask/AbstractSdncVlOperationTask.java | 132 ---------- .../SdncNetworkTopologyOperationTask.java | 63 +++++ .../SdncOperationTaskYangToolsImpl.java | 68 ++++++ .../SdncServiceTopologyOperationTask.java | 61 +++++ .../SdncUnderlayVpnOperationClient.java | 12 +- .../serviceTask/SdncUnderlayVpnPreprocessTask.java | 48 ++++ .../serviceTask/SdncVlOperationTaskEntityImpl.java | 63 ----- .../SdncVlOperationTaskYangToolsImpl.java | 69 ------ .../serviceTask/client/GenericResourceApi.java | 10 +- .../client/builder/AbstractBuilder.java | 113 ++++++++- .../builder/NetworkRpcInputEntityBuilder.java | 98 +++----- .../builder/NetworkTopologyRequestBodyBuilder.java | 5 +- .../builder/ServiceRpcInputEntityBuilder.java | 83 +++++++ .../client/entity/EcompModelInformationEntity.java | 83 ------- .../serviceTask/client/entity/InputEntity.java | 83 ------- .../client/entity/NetworkInformationEntity.java | 12 +- .../client/entity/NetworkRequestInputEntity.java | 6 +- .../client/entity/NetworkRpcInputEntity.java | 39 --- .../client/entity/NetworkRpcOutputEntity.java | 39 --- .../NetworkTopologyOperationInputEntity.java | 83 +++++++ .../NetworkTopologyOperationOutputEntity.java | 94 +++++++ .../client/entity/OnapModelInformationEntity.java | 83 +++++++ .../serviceTask/client/entity/OutputEntity.java | 94 ------- .../RpcNetworkTopologyOperationInputEntity.java | 39 +++ .../RpcNetworkTopologyOperationOutputEntity.java | 39 +++ .../RpcServiceTopologyOperationInputEntity.java | 39 +++ .../RpcServiceTopologyOperationOutputEntity.java | 39 +++ .../client/entity/ServiceInformationEntity.java | 12 +- .../entity/ServiceInputParametersEntity.java | 41 ++++ .../client/entity/ServiceRequestInputEntity.java | 51 ++++ .../ServiceTopologyOperationInputEntity.java | 72 ++++++ .../ServiceTopologyOperationOutputEntity.java | 83 +++++++ .../subprocess/DoUnderlayVpnOperation.bpmn | 270 ++++++++++++++++++--- 34 files changed, 1533 insertions(+), 725 deletions(-) create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncVlOperationTask.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskEntityImpl.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskYangToolsImpl.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/EcompModelInformationEntity.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/InputEntity.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcInputEntity.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcOutputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationOutputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OnapModelInformationEntity.java delete mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OutputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationOutputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceRequestInputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationInputEntity.java create mode 100644 bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationOutputEntity.java diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java new file mode 100644 index 0000000000..0f384096cb --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java @@ -0,0 +1,132 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; + +import org.apache.commons.lang3.StringUtils; +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.onap.msb.sdk.httpclient.RestServiceCreater; +import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; +import org.openecomp.mso.bpmn.core.BaseTask; +import org.openecomp.mso.logger.MessageEnum; +import org.openecomp.mso.logger.MsoLogger; +import org.openecomp.mso.requestsdb.RequestsDatabase; +import org.openecomp.mso.requestsdb.RequestsDbConstant; +import org.openecomp.mso.requestsdb.ResourceOperationStatus; + +import java.util.Map; + +/** + * Created by 10112215 on 2017/9/16. + */ +public abstract class AbstractSdncOperationTask extends BaseTask { + + private static final String DEFAULT_MSB_IP = "127.0.0.1"; + private static final int DEFAULT_MSB_Port = 10081; + private static final String SDCADAPTOR_INPUTS = "SDCADAPTOR_INPUTS"; + private RequestsDatabase requestsDB = RequestsDatabase.getInstance(); + + + private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); + + @Override + public void execute(DelegateExecution execution) { + GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(execution); + updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!"); + Map inputs = (Map) execution.getVariable(SDCADAPTOR_INPUTS); + updateProgress(execution, null, null, "30", "getGenericResourceApiClient finished!"); + try { + sendRestrequestAndHandleResponse(execution, inputs, genericResourceApiClient); + execution.setVariable("SDNCA_SuccessIndicator", true); + updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!"); + } catch (Exception e) { + e.printStackTrace(); + execution.setVariable("SDNCA_SuccessIndicator", false); + } + } + + public abstract void sendRestrequestAndHandleResponse(DelegateExecution execution, + Map inputs, + GenericResourceApi genericResourceApiClient) throws Exception; + + public void updateProgress(DelegateExecution execution, + String status, + String errorCode, + String progress, + String statusDescription) { + String serviceId = (String) execution.getVariable("serviceId"); + String operationId = (String) execution.getVariable("operationId"); + String resourceTemplateUUID = (String) execution.getVariable("resourceTemplateUUID"); + ResourceOperationStatus resourceOperationStatus = requestsDB.getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID); + if (!StringUtils.isBlank(status)) { + resourceOperationStatus.setStatus(status); + } + if (!StringUtils.isBlank(errorCode)) { + resourceOperationStatus.setErrorCode(errorCode); + } + if (!StringUtils.isBlank(progress)) { + resourceOperationStatus.setProgress(progress); + } + if (!StringUtils.isBlank(statusDescription)) { + resourceOperationStatus.setStatusDescription(statusDescription); + } + requestsDB.updateResOperStatus(resourceOperationStatus); + } + + private GenericResourceApi getGenericResourceApiClient(DelegateExecution execution) { + updateProgress(execution, null, null, "20", "getGenericResourceApiClient begin!"); + String msbIp = getString(execution, "MSB_IP", DEFAULT_MSB_IP); + int msbPort = getInteger(execution, "MSB_Port", DEFAULT_MSB_Port); + MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort); + RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient); + return restServiceCreater.createService(GenericResourceApi.class); + } + + private String getString(DelegateExecution execution, String name, String defaultValue) { + String vlaue = (String) execution.getVariable(name); + try { + if (!StringUtils.isBlank(vlaue)) { + return vlaue; + } + } catch (Exception e) { + System.out.println(e); + logger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString()); + } + return defaultValue; + } + + private Integer getInteger(DelegateExecution execution, String name, Integer defaultValue) { + Integer vlaue = (Integer) execution.getVariable(name); + try { + if (vlaue != null) { + return vlaue; + } + } catch (Exception e) { + System.out.println(e); + logger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString()); + } + return defaultValue; + } + + public String getProcessKey(DelegateExecution execution) { + return execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey(); + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncVlOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncVlOperationTask.java deleted file mode 100644 index f6f922f706..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncVlOperationTask.java +++ /dev/null @@ -1,132 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; - -import org.apache.commons.lang3.StringUtils; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.msb.sdk.httpclient.RestServiceCreater; -import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; -import org.openecomp.mso.bpmn.core.BaseTask; -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.requestsdb.RequestsDatabase; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.openecomp.mso.requestsdb.ResourceOperationStatus; - -import java.util.Map; - -/** - * Created by 10112215 on 2017/9/16. - */ -public abstract class AbstractSdncVlOperationTask extends BaseTask { - - private static final String DEFAULT_MSB_IP = "127.0.0.1"; - private static final int DEFAULT_MSB_Port = 10081; - private static final String SDCADAPTOR_INPUTS = "SDCADAPTOR_INPUTS"; - private RequestsDatabase requestsDB = RequestsDatabase.getInstance(); - - - private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); - - @Override - public void execute(DelegateExecution execution) { - GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(execution); - updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!"); - Map inputs = (Map) execution.getVariable(SDCADAPTOR_INPUTS); - updateProgress(execution, null, null, "30", "getGenericResourceApiClient finished!"); - try { - sendRestrequestAndHandleResponse(execution, inputs, genericResourceApiClient); - execution.setVariable("SDNCA_SuccessIndicator", true); - updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!"); - } catch (Exception e) { - e.printStackTrace(); - execution.setVariable("SDNCA_SuccessIndicator", false); - } - } - - public abstract void sendRestrequestAndHandleResponse(DelegateExecution execution, - Map inputs, - GenericResourceApi genericResourceApiClient) throws Exception; - - public void updateProgress(DelegateExecution execution, - String status, - String errorCode, - String progress, - String statusDescription) { - String serviceId = (String) execution.getVariable("serviceId"); - String operationId = (String) execution.getVariable("operationId"); - String resourceTemplateUUID = (String) execution.getVariable("resourceTemplateUUID"); - ResourceOperationStatus resourceOperationStatus = requestsDB.getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID); - if (!StringUtils.isBlank(status)) { - resourceOperationStatus.setStatus(status); - } - if (!StringUtils.isBlank(errorCode)) { - resourceOperationStatus.setErrorCode(errorCode); - } - if (!StringUtils.isBlank(progress)) { - resourceOperationStatus.setProgress(progress); - } - if (!StringUtils.isBlank(statusDescription)) { - resourceOperationStatus.setStatusDescription(statusDescription); - } - requestsDB.updateResOperStatus(resourceOperationStatus); - } - - private GenericResourceApi getGenericResourceApiClient(DelegateExecution execution) { - updateProgress(execution, null, null, "20", "getGenericResourceApiClient begin!"); - String msbIp = getString(execution, "MSB_IP", DEFAULT_MSB_IP); - int msbPort = getInteger(execution, "MSB_Port", DEFAULT_MSB_Port); - MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort); - RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient); - return restServiceCreater.createService(GenericResourceApi.class); - } - - private String getString(DelegateExecution execution, String name, String defaultValue) { - String vlaue = (String) execution.getVariable(name); - try { - if (!StringUtils.isBlank(vlaue)) { - return vlaue; - } - } catch (Exception e) { - System.out.println(e); - logger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString()); - } - return defaultValue; - } - - private Integer getInteger(DelegateExecution execution, String name, Integer defaultValue) { - Integer vlaue = (Integer) execution.getVariable(name); - try { - if (vlaue != null) { - return vlaue; - } - } catch (Exception e) { - System.out.println(e); - logger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString()); - } - return defaultValue; - } - - public String getProcessKey(DelegateExecution execution) { - return execution.getProcessEngineServices().getRepositoryService().getProcessDefinition(execution.getProcessDefinitionId()).getKey(); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java new file mode 100644 index 0000000000..9e0b4f7806 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.openecomp.mso.bpmn.core.WorkflowException; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkRpcInputEntityBuilder; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationInputEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationOutputEntity; +import org.openecomp.mso.requestsdb.RequestsDbConstant; + +import java.util.Map; + +/** + * Created by 10112215 on 2017/9/20. + */ +public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask { + @Override + public void sendRestrequestAndHandleResponse(DelegateExecution execution, + Map inputs, + GenericResourceApi genericResourceApiClient) throws Exception { + updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); + NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder(); + RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs); + updateProgress(execution, null, null, "50", "RequestBody build finished!"); + RpcNetworkTopologyOperationOutputEntity outputEntity = genericResourceApiClient.postNetworkTopologyOperation(inputEntity).execute().body(); + updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); + saveOutput(execution, outputEntity); + } + + private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws Exception { + String responseCode = output.getOutput().getResponseCode(); + if (!"200".equals(responseCode)) { + String processKey = getProcessKey(execution); + int errorCode = Integer.valueOf(responseCode); + String errorMessage = output.getOutput().getResponseMessage(); + WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage); + execution.setVariable("SDNCA_SuccessIndicator", workflowException); + updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage); + throw new Exception(""); + } + } + +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java new file mode 100644 index 0000000000..25727bdcd0 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncOperationTaskYangToolsImpl.java @@ -0,0 +1,68 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; + +import okhttp3.RequestBody; +import okhttp3.ResponseBody; +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationOutput; +import org.openecomp.mso.bpmn.core.WorkflowException; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkTopologyRequestBodyBuilder; +import org.openecomp.mso.requestsdb.RequestsDbConstant; +import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService; +import org.openecomp.mso.yangDecoder.transform.impl.TransfromJava2StringFactory; + +import java.util.Map; + +/** + * Created by 10112215 on 2017/9/20. + */ +public class SdncOperationTaskYangToolsImpl extends AbstractSdncOperationTask { + + public void sendRestrequestAndHandleResponse(DelegateExecution execution, + Map inputs, + GenericResourceApi genericResourceApiClient) throws Exception { + updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); + NetworkTopologyRequestBodyBuilder builder = new NetworkTopologyRequestBodyBuilder(); + RequestBody body = builder.build(execution, inputs); + updateProgress(execution, null, null, "50", "RequestBody build finished!"); + ResponseBody responseBody = genericResourceApiClient.postNetworkTopologyOperation(body).execute().body(); + updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); + saveResponse(execution, responseBody); + } + + private void saveResponse(DelegateExecution execution, ResponseBody responseBody) throws Exception { + ITransformJava2StringService java2jsonService = TransfromJava2StringFactory.getJava2jsonService(); + NetworkTopologyOperationOutput output = (NetworkTopologyOperationOutput) java2jsonService. + transformRpcDataObjectFromString(NetworkTopologyRequestBodyBuilder.URI_PATH, responseBody.string()); + String responseCode = output.getResponseCode(); + if (!"200".equals(responseCode)) { + String processKey = getProcessKey(execution); + int errorCode = Integer.valueOf(responseCode); + String errorMessage = output.getResponseMessage(); + WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage); + execution.setVariable("SDNCA_SuccessIndicator", workflowException); + updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage); + throw new Exception(""); + } + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java new file mode 100644 index 0000000000..b5f312d71f --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; + + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.openecomp.mso.bpmn.core.WorkflowException; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.ServiceRpcInputEntityBuilder; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcServiceTopologyOperationInputEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcServiceTopologyOperationOutputEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceTopologyOperationOutputEntity; +import org.openecomp.mso.requestsdb.RequestsDbConstant; + +import java.util.Map; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask { + @Override + public void sendRestrequestAndHandleResponse(DelegateExecution execution, + Map inputs, + GenericResourceApi genericResourceApiClient) throws Exception { + ServiceRpcInputEntityBuilder builder = new ServiceRpcInputEntityBuilder(); + RpcServiceTopologyOperationInputEntity inputEntity = builder.build(execution, inputs); + RpcServiceTopologyOperationOutputEntity outputEntity = genericResourceApiClient.postServiceTopologyOperation(inputEntity).execute().body(); + saveOutput(execution, outputEntity); + } + + private void saveOutput(DelegateExecution execution, RpcServiceTopologyOperationOutputEntity output) throws Exception { + String responseCode = output.getOutput().getResponseCode(); + if (!"200".equals(responseCode)) { + String processKey = getProcessKey(execution); + int errorCode = Integer.valueOf(responseCode); + String errorMessage = output.getOutput().getResponseMessage(); + WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage); + execution.setVariable("SDNCA_SuccessIndicator", workflowException); + updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage); + throw new Exception(""); + } + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java index ac41202b7e..8832fe1a1c 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java @@ -25,8 +25,8 @@ import org.onap.msb.sdk.httpclient.RestServiceCreater; import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkRpcInputEntityBuilder; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRpcInputEntity; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRpcOutputEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationInputEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RpcNetworkTopologyOperationOutputEntity; import org.openecomp.mso.logger.MsoLogger; import org.openecomp.mso.requestsdb.RequestsDatabase; import org.openecomp.mso.requestsdb.RequestsDbConstant; @@ -67,11 +67,11 @@ public class SdncUnderlayVpnOperationClient { public boolean sendRestrequestAndHandleResponse(Map inputs, GenericResourceApi genericResourceApiClient){ updateProgress(null, null, "40", "sendRestrequestAndHandleResponse begin!"); NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder(); - NetworkRpcInputEntity body = builder.build(inputs); + RpcNetworkTopologyOperationInputEntity body = builder.build(null, inputs); updateProgress(null, null, "50", "RequestBody build finished!"); - NetworkRpcOutputEntity networkRpcOutputEntiy = null; + RpcNetworkTopologyOperationOutputEntity networkRpcOutputEntiy = null; try { - networkRpcOutputEntiy = genericResourceApiClient.postNetworkTopologyPeration(body).execute().body(); + networkRpcOutputEntiy = genericResourceApiClient.postNetworkTopologyOperation(body).execute().body(); } catch (Exception e) { e.printStackTrace(); updateProgress(RequestsDbConstant.Status.ERROR, null, null, "sendRestrequestAndHandleResponse exception:" + e.getMessage()); @@ -115,7 +115,7 @@ public class SdncUnderlayVpnOperationClient { requestsDB.updateResOperStatus(resourceOperationStatus); } - private void saveOutput(NetworkRpcOutputEntity output) { + private void saveOutput(RpcNetworkTopologyOperationOutputEntity output) { } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java new file mode 100644 index 0000000000..49ded45b4a --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.openecomp.mso.bpmn.core.BaseTask; +import org.openecomp.mso.requestsdb.RequestsDatabase; +import org.openecomp.mso.requestsdb.ResourceOperationStatus; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class SdncUnderlayVpnPreprocessTask extends BaseTask { + public static final String RESOURCE_OPER_TYPE = "resourceOperType"; + private RequestsDatabase requestsDB = RequestsDatabase.getInstance(); + + @Override + public void execute(DelegateExecution execution) { + String operType = getOperType(execution); + execution.setVariable(RESOURCE_OPER_TYPE, operType); + } + + private String getOperType(DelegateExecution execution) { + String serviceId = (String) execution.getVariable("serviceId"); + String operationId = (String) execution.getVariable("operationId"); + String resourceTemplateUUID = (String) execution.getVariable("resourceTemplateUUID"); + ResourceOperationStatus resourceOperationStatus = requestsDB.getResourceOperationStatus(serviceId, operationId, resourceTemplateUUID); + return resourceOperationStatus.getOperType(); + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskEntityImpl.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskEntityImpl.java deleted file mode 100644 index 4781ec1528..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskEntityImpl.java +++ /dev/null @@ -1,63 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.openecomp.mso.bpmn.core.WorkflowException; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkRpcInputEntityBuilder; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRpcInputEntity; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRpcOutputEntity; -import org.openecomp.mso.requestsdb.RequestsDbConstant; - -import java.util.Map; - -/** - * Created by 10112215 on 2017/9/20. - */ -public class SdncVlOperationTaskEntityImpl extends AbstractSdncVlOperationTask { - @Override - public void sendRestrequestAndHandleResponse(DelegateExecution execution, - Map inputs, - GenericResourceApi genericResourceApiClient) throws Exception { - updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); - NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder(); - NetworkRpcInputEntity body = builder.build(inputs); - updateProgress(execution, null, null, "50", "RequestBody build finished!"); - NetworkRpcOutputEntity networkRpcOutputEntiy = genericResourceApiClient.postNetworkTopologyPeration(body).execute().body(); - updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); - saveOutput(execution, networkRpcOutputEntiy); - } - - private void saveOutput(DelegateExecution execution, NetworkRpcOutputEntity output) throws Exception { - String responseCode = output.getOutput().getResponseCode(); - if (!responseCode.equals("200")) { - String processKey = getProcessKey(execution); - int errorCode = Integer.valueOf(responseCode); - String errorMessage = output.getOutput().getResponseMessage(); - WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage); - execution.setVariable("SDNCA_SuccessIndicator", workflowException); - updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage); - throw new Exception(""); - } - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskYangToolsImpl.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskYangToolsImpl.java deleted file mode 100644 index 8e7f8b5e8d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncVlOperationTaskYangToolsImpl.java +++ /dev/null @@ -1,69 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask; - -import okhttp3.RequestBody; -import okhttp3.ResponseBody; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationOutput; -import org.opendaylight.yangtools.yang.binding.DataObject; -import org.openecomp.mso.bpmn.core.WorkflowException; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder.NetworkTopologyRequestBodyBuilder; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.openecomp.mso.yangDecoder.transform.api.ITransformJava2StringService; -import org.openecomp.mso.yangDecoder.transform.impl.TransfromJava2StringFactory; - -import java.util.Map; - -/** - * Created by 10112215 on 2017/9/20. - */ -public class SdncVlOperationTaskYangToolsImpl extends AbstractSdncVlOperationTask { - - public void sendRestrequestAndHandleResponse(DelegateExecution execution, - Map inputs, - GenericResourceApi genericResourceApiClient) throws Exception { - updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); - NetworkTopologyRequestBodyBuilder builder = new NetworkTopologyRequestBodyBuilder(); - RequestBody body = builder.build(inputs); - updateProgress(execution, null, null, "50", "RequestBody build finished!"); - ResponseBody responseBody = genericResourceApiClient.postNetworkTopologyPeration(body).execute().body(); - updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); - saveResponse(execution, responseBody); - } - - private void saveResponse(DelegateExecution execution, ResponseBody responseBody) throws Exception { - ITransformJava2StringService java2jsonService = TransfromJava2StringFactory.getJava2jsonService(); - NetworkTopologyOperationOutput output = (NetworkTopologyOperationOutput) java2jsonService. - transformRpcDataObjectFromString(NetworkTopologyRequestBodyBuilder.URI_PATH, responseBody.string()); - String responseCode = output.getResponseCode(); - if (!responseCode.equals("200")) { - String processKey = getProcessKey(execution); - int errorCode = Integer.valueOf(responseCode); - String errorMessage = output.getResponseMessage(); - WorkflowException workflowException = new WorkflowException(processKey, errorCode, errorMessage); - execution.setVariable("SDNCA_SuccessIndicator", workflowException); - updateProgress(execution, RequestsDbConstant.Status.ERROR, String.valueOf(errorCode), null, errorMessage); - throw new Exception(""); - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java index c364589da0..62375afa20 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java @@ -23,8 +23,7 @@ package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client; import okhttp3.RequestBody; import okhttp3.ResponseBody; import org.onap.msb.sdk.httpclient.annotaion.ServiceHttpEndPoint; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRpcInputEntity; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.NetworkRpcOutputEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.*; import retrofit2.Call; import retrofit2.http.Body; import retrofit2.http.POST; @@ -36,10 +35,13 @@ import retrofit2.http.POST; public interface GenericResourceApi { @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation") - Call postNetworkTopologyPeration(@Body RequestBody input); + Call postNetworkTopologyOperation(@Body RequestBody input); @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation") - Call postNetworkTopologyPeration(@Body NetworkRpcInputEntity input); + Call postNetworkTopologyOperation(@Body RpcNetworkTopologyOperationInputEntity input); + + @POST("/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation") + Call postServiceTopologyOperation(@Body RpcServiceTopologyOperationInputEntity input); } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java index d4a1a1a5c6..91b95df1b2 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java @@ -20,9 +20,118 @@ package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder; +import org.apache.commons.lang3.StringUtils; +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformation; +import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeader; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.SdncUnderlayVpnPreprocessTask; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.OnapModelInformationEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.ParamEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.RequestInformationEntity; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.ServiceInformationEntity; +import org.openecomp.mso.requestsdb.RequestsDbConstant; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.UUID; + /** * Created by 10112215 on 2017/9/20. */ -public interface AbstractBuilder { - OUT build(IN input) throws Exception; +public abstract class AbstractBuilder { + protected String requestId = null; + + abstract OUT build(DelegateExecution execution, IN input) throws Exception; + + protected String getRequestActoin(DelegateExecution execution) { + String action = RequestInformation.RequestAction.CreateNetworkInstance.name(); + String operType = getOperType(execution); + if (!StringUtils.isBlank(operType)) { + if (RequestsDbConstant.OperationType.DELETE.equals(operType)) { + action = RequestInformation.RequestAction.DeleteNetworkInstance.name(); + } else if (RequestsDbConstant.OperationType.CREATE.equals(operType)) { + action = RequestInformation.RequestAction.CreateNetworkInstance.name(); + } + } + return action; + } + + protected String getOperationType(DelegateExecution execution) { + String action = SdncRequestHeader.SvcAction.Create.name(); + String operType = getOperType(execution); + if (!StringUtils.isBlank(operType)) { + if (RequestsDbConstant.OperationType.DELETE.equals(operType)) { + action = SdncRequestHeader.SvcAction.Delete.name(); + } else if (RequestsDbConstant.OperationType.CREATE.equals(operType)) { + action = SdncRequestHeader.SvcAction.Create.name(); + } + } + return action; + } + + protected synchronized String getRequestId(DelegateExecution execution) { + if (StringUtils.isBlank(requestId)) { + requestId = (String) execution.getVariable("msoRequestId"); + if (StringUtils.isBlank(requestId)) { + requestId = UUID.randomUUID().toString(); + } + } + return requestId; + } + + protected String getOperType(DelegateExecution execution) { + return (String) execution.getVariable(SdncUnderlayVpnPreprocessTask.RESOURCE_OPER_TYPE); + } + + protected OnapModelInformationEntity getOnapModelInformationEntity(DelegateExecution execution) { + OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity(); + { + String modelInvariantUuid = (String) execution.getVariable("modelInvariantUuid"); + String modelVersion = (String) execution.getVariable("modelVersion"); + String modelUuid = (String) execution.getVariable("modelUuid"); + String modelName = (String) execution.getVariable("modelName"); + onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid); + onapModelInformationEntity.setModelVersion(modelVersion); + onapModelInformationEntity.setModelUuid(modelUuid); + onapModelInformationEntity.setModelName(modelName); + } + return onapModelInformationEntity; + } + + protected List getParamEntities(Map inputs) { + List paramEntityList = new ArrayList<>(); + if (inputs != null && !inputs.isEmpty()) { + inputs.keySet().forEach(key -> { + ParamEntity paramEntity = new ParamEntity(); + paramEntity.setName(key); + paramEntity.setValue(inputs.get(key)); + paramEntityList.add(paramEntity); + }); + } + return paramEntityList; + } + + protected RequestInformationEntity getRequestInformationEntity(DelegateExecution execution) { + RequestInformationEntity requestInformationEntity = new RequestInformationEntity(); + { + requestInformationEntity.setRequestId(getRequestId(execution)); + requestInformationEntity.setRequestAction(getRequestActoin(execution)); + } + return requestInformationEntity; + } + + protected ServiceInformationEntity getServiceInformationEntity(DelegateExecution execution) { + ServiceInformationEntity serviceInformationEntity = new ServiceInformationEntity(); + serviceInformationEntity.setServiceId((String) execution.getVariable("productFamilyId")); + serviceInformationEntity.setSubscriptionServiceType((String) execution.getVariable("subscriptionServiceType")); + serviceInformationEntity.setOnapModelInformation(getOnapModelInformationEntity(execution)); + serviceInformationEntity.setServiceInstanceId((String) execution.getVariable("serviceInstanceId")); + serviceInformationEntity.setGlobalCustomerId((String) execution.getVariable("globalSubscriberId")); + return serviceInformationEntity; + } + + protected String getServiceInstanceName(DelegateExecution execution) { + return (String) execution.getVariable("serviceInstanceName"); + } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java index ae1b92c8e9..a1e47df501 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java @@ -20,43 +20,26 @@ package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder; -import org.apache.commons.lang3.StringUtils; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.request.information.RequestInformation; -import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.sdnc.request.header.SdncRequestHeader; +import org.camunda.bpm.engine.delegate.DelegateExecution; import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.*; -import java.util.ArrayList; import java.util.List; import java.util.Map; /** * Created by 10112215 on 2017/9/20. */ -public class NetworkRpcInputEntityBuilder implements AbstractBuilder, NetworkRpcInputEntity> { +public class NetworkRpcInputEntityBuilder extends AbstractBuilder, RpcNetworkTopologyOperationInputEntity> { - public static final String SVC_REQUEST_ID = "MSO"; - public static final String SDC_ACTION = "SDC_ACTION"; - public static final RequestInformation.RequestAction REQUEST_ACTION = RequestInformation.RequestAction.CreateNetworkInstance; - - protected NetworkRpcInputEntity getSdncEntityInput(Map inputs) { - NetworkRpcInputEntity networkRpcInputEntity = new NetworkRpcInputEntity(); - InputEntity inputEntity = new InputEntity(); - { - loadSdncRequestHeaderEntity(inputs, inputEntity); - loadRequestInformationEntity(inputEntity); - - ServiceInformationEntity serviceInformationEntity = new ServiceInformationEntity(); - String serviceId = inputs.get("serviceId"); - serviceInformationEntity.setServiceId(serviceId); - - - loadNetwrokRequestInputEntity(inputs, inputEntity); - } - networkRpcInputEntity.setInput(inputEntity); - return networkRpcInputEntity; + @Override + public RpcNetworkTopologyOperationInputEntity build(DelegateExecution execution, Map inputs) { + RpcNetworkTopologyOperationInputEntity rpcNetworkTopologyOperationInputEntity = new RpcNetworkTopologyOperationInputEntity(); + NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity = getNetworkTopologyOperationInputEntity(execution, inputs); + rpcNetworkTopologyOperationInputEntity.setInput(networkTopologyOperationInputEntity); + return rpcNetworkTopologyOperationInputEntity; } - private void loadNetwrokRequestInputEntity(Map inputs, InputEntity inputEntity) { + private void loadNetwrokRequestInputEntity(Map inputs, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) { NetworkRequestInputEntity networkRequestInputEntity = new NetworkRequestInputEntity(); { NetworkInputPaarametersEntity networkInputPaarametersEntity = new NetworkInputPaarametersEntity(); @@ -64,52 +47,47 @@ public class NetworkRpcInputEntityBuilder implements AbstractBuilder paramEntityList = getParamEntities(inputs); networkInputPaarametersEntity.setParamList(paramEntityList); } - } - inputEntity.setNetworkRequestInput(networkRequestInputEntity); + networkTopologyOperationInputEntity.setNetworkRequestInput(networkRequestInputEntity); } - private List getParamEntities(Map inputs) { - List paramEntityList = new ArrayList<>(); - if (inputs != null && !inputs.isEmpty()) { - inputs.keySet().forEach(key -> { - ParamEntity paramEntity = new ParamEntity(); - paramEntity.setName(key); - paramEntity.setValue(inputs.get(key)); - paramEntityList.add(paramEntity); - }); - } - return paramEntityList; + private void loadRequestInformationEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) { + RequestInformationEntity requestInformationEntity = getRequestInformationEntity(execution); + networkTopologyOperationInputEntity.setRequestInformation(requestInformationEntity); } - private void loadRequestInformationEntity(InputEntity inputEntity) { - RequestInformationEntity requestInformationEntity = new RequestInformationEntity(); + private void loadSdncRequestHeaderEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) { + SdncRequestHeaderEntity sdncRequestHeaderEntity = new SdncRequestHeaderEntity(); { - requestInformationEntity.setRequestId(SVC_REQUEST_ID); - requestInformationEntity.setRequestAction(REQUEST_ACTION.name()); + sdncRequestHeaderEntity.setSvcRequestId(getRequestId(execution)); + sdncRequestHeaderEntity.setSvcAction(getOperationType(execution)); } - inputEntity.setRequestInformation(requestInformationEntity); + networkTopologyOperationInputEntity.setSdncRequestHeader(sdncRequestHeaderEntity); } - private void loadSdncRequestHeaderEntity(Map inputs, InputEntity inputEntity) { - SdncRequestHeaderEntity sdncRequestHeaderEntity = new SdncRequestHeaderEntity(); + private void loadServiceInformation(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) { + ServiceInformationEntity serviceInformationEntity = getServiceInformationEntity(execution); + networkTopologyOperationInputEntity.setServiceInformation(serviceInformationEntity); + } + + private NetworkTopologyOperationInputEntity getNetworkTopologyOperationInputEntity(DelegateExecution execution, Map inputs) { + NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity = new NetworkTopologyOperationInputEntity(); { - sdncRequestHeaderEntity.setSvcRequestId(SVC_REQUEST_ID); - String action = inputs.get(SDC_ACTION); - if (!StringUtils.isBlank(action)) { - if (action.toLowerCase().contains("delete")) { - action = SdncRequestHeader.SvcAction.Delete.name(); - } else if (action.toLowerCase().contains("create")) { - action = SdncRequestHeader.SvcAction.Create.name(); - } - } - sdncRequestHeaderEntity.setSvcAction(action); + loadSdncRequestHeaderEntity(networkTopologyOperationInputEntity, execution); + loadRequestInformationEntity(networkTopologyOperationInputEntity, execution); + loadServiceInformation(networkTopologyOperationInputEntity, execution); + loadNetworkInformationEntity(execution, networkTopologyOperationInputEntity); + loadNetwrokRequestInputEntity(inputs, networkTopologyOperationInputEntity); } - inputEntity.setSdncRequestHeader(sdncRequestHeaderEntity); + return networkTopologyOperationInputEntity; } - @Override - public NetworkRpcInputEntity build(Map input) { - return null; + private void loadNetworkInformationEntity(DelegateExecution execution, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) { + NetworkInformationEntity networkInformationEntity = new NetworkInformationEntity(); + { + OnapModelInformationEntity onapModelInformationEntity = getOnapModelInformationEntity(execution); + networkInformationEntity.setOnapModelInformation(onapModelInformationEntity); + } + networkTopologyOperationInputEntity.setNetworkInformation(networkInformationEntity); } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java index 4ccf659947..d5ba528911 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkTopologyRequestBodyBuilder.java @@ -22,6 +22,7 @@ package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builde import okhttp3.RequestBody; import org.apache.commons.lang3.StringUtils; +import org.camunda.bpm.engine.delegate.DelegateExecution; import org.json.JSONObject; import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationInput; import org.opendaylight.yang.gen.v1.org.onap.sdnc.northbound.generic.resource.rev170824.NetworkTopologyOperationInputBuilder; @@ -44,7 +45,7 @@ import java.util.Map; /** * Created by 10112215 on 2017/9/20. */ -public class NetworkTopologyRequestBodyBuilder implements AbstractBuilder, RequestBody> { +public class NetworkTopologyRequestBodyBuilder extends AbstractBuilder, RequestBody> { public static final String URI_PATH = "GENERIC-RESOURCE-API:network-topology-operation"; public static final SdncRequestHeader.SvcAction SVC_DEFAULT_ACTION = SdncRequestHeader.SvcAction.Create; @@ -64,7 +65,7 @@ public class NetworkTopologyRequestBodyBuilder implements AbstractBuilder input) throws Exception { + public RequestBody build(DelegateExecution execution, Map input) throws Exception { NetworkTopologyOperationInput sdncInput = getSdncInput(input); RequestBody body = getRequestBody(sdncInput); return body; diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java new file mode 100644 index 0000000000..5cb9272564 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.builder; + +import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.*; + +import java.util.List; +import java.util.Map; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class ServiceRpcInputEntityBuilder extends AbstractBuilder, RpcServiceTopologyOperationInputEntity> { + @Override + public RpcServiceTopologyOperationInputEntity build(DelegateExecution execution, Map inputs) throws Exception { + RpcServiceTopologyOperationInputEntity rpcServiceTopologyOperationInputEntity = new RpcServiceTopologyOperationInputEntity(); + ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity = new ServiceTopologyOperationInputEntity(); + { + loadSdncRequestHeaderEntity(serviceTopologyOperationInputEntity, execution); + loadRequestInformationEntity(serviceTopologyOperationInputEntity, execution); + loadServiceInformation(serviceTopologyOperationInputEntity, execution); + loadServiceRequestInputEntity(serviceTopologyOperationInputEntity, execution); + } + rpcServiceTopologyOperationInputEntity.setServiceTopologyOperationInputEntity(serviceTopologyOperationInputEntity); + return rpcServiceTopologyOperationInputEntity; + } + + private void loadServiceRequestInputEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) { + ServiceRequestInputEntity serviceRequestInputEntity = getServiceRequestInputEntity(execution); + serviceTopologyOperationInputEntity.setServiceRequestInput(serviceRequestInputEntity); + } + + private ServiceRequestInputEntity getServiceRequestInputEntity(DelegateExecution execution) { + ServiceRequestInputEntity serviceRequestInputEntity = new ServiceRequestInputEntity(); + serviceRequestInputEntity.setServiceInstanceName(getServiceInstanceName(execution)); + return serviceRequestInputEntity; + } + + private ServiceInputParametersEntity getServiceInputParametersEntity(Map inputs) { + List paramEntityList = getParamEntities(inputs); + ServiceInputParametersEntity serviceInputParametersEntity = new ServiceInputParametersEntity(); + serviceInputParametersEntity.setParamList(paramEntityList); + return serviceInputParametersEntity; + } + + private void loadServiceInformation(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) { + ServiceInformationEntity serviceInformationEntity = getServiceInformationEntity(execution); + serviceTopologyOperationInputEntity.setServiceInformation(serviceInformationEntity); + } + + private void loadRequestInformationEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) { + RequestInformationEntity requestInformationEntity = getRequestInformationEntity(execution); + serviceTopologyOperationInputEntity.setRequestInformation(requestInformationEntity); + } + + private void loadSdncRequestHeaderEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity, DelegateExecution execution) { + SdncRequestHeaderEntity sdncRequestHeaderEntity = new SdncRequestHeaderEntity(); + { + sdncRequestHeaderEntity.setSvcRequestId(getRequestId(execution)); + sdncRequestHeaderEntity.setSvcAction(getOperationType(execution)); + } + serviceTopologyOperationInputEntity.setSdncRequestHeader(sdncRequestHeaderEntity); + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/EcompModelInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/EcompModelInformationEntity.java deleted file mode 100644 index df26d26baa..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/EcompModelInformationEntity.java +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Created by 10112215 on 2017/9/20. - */ -public class EcompModelInformationEntity { - @JsonProperty("model-invariant-uuid") - private String modelInvariantUuid; - - @JsonProperty("model-customization-uuid") - private String modelCustomizationUuid; - - @JsonProperty("model-uuid") - private String modelUuid; - - @JsonProperty("model-version") - private String modelVersion; - - @JsonProperty("model-name") - private String modelName; - - public String getModelInvariantUuid() { - return modelInvariantUuid; - } - - public void setModelInvariantUuid(String modelInvariantUuid) { - this.modelInvariantUuid = modelInvariantUuid; - } - - public String getModelCustomizationUuid() { - return modelCustomizationUuid; - } - - public void setModelCustomizationUuid(String modelCustomizationUuid) { - this.modelCustomizationUuid = modelCustomizationUuid; - } - - public String getModelUuid() { - return modelUuid; - } - - public void setModelUuid(String modelUuid) { - this.modelUuid = modelUuid; - } - - public String getModelVersion() { - return modelVersion; - } - - public void setModelVersion(String modelVersion) { - this.modelVersion = modelVersion; - } - - public String getModelName() { - return modelName; - } - - public void setModelName(String modelName) { - this.modelName = modelName; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/InputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/InputEntity.java deleted file mode 100644 index a76fcba381..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/InputEntity.java +++ /dev/null @@ -1,83 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Created by 10112215 on 2017/9/20. - */ -public class InputEntity { - @JsonProperty("sdnc-request-header") - private SdncRequestHeaderEntity sdncRequestHeader; - - @JsonProperty("request-information") - private RequestInformationEntity requestInformation; - - @JsonProperty("service-information") - private ServiceInformationEntity serviceInformation; - - @JsonProperty("network-information") - private NetworkInformationEntity networkInformation; - - @JsonProperty("network-request-input") - private NetworkRequestInputEntity networkRequestInput; - - public SdncRequestHeaderEntity getSdncRequestHeader() { - return sdncRequestHeader; - } - - public void setSdncRequestHeader(SdncRequestHeaderEntity sdncRequestHeader) { - this.sdncRequestHeader = sdncRequestHeader; - } - - public RequestInformationEntity getRequestInformation() { - return requestInformation; - } - - public void setRequestInformation(RequestInformationEntity requestInformation) { - this.requestInformation = requestInformation; - } - - public ServiceInformationEntity getServiceInformation() { - return serviceInformation; - } - - public void setServiceInformation(ServiceInformationEntity serviceInformation) { - this.serviceInformation = serviceInformation; - } - - public NetworkInformationEntity getNetworkInformation() { - return networkInformation; - } - - public void setNetworkInformation(NetworkInformationEntity networkInformation) { - this.networkInformation = networkInformation; - } - - public NetworkRequestInputEntity getNetworkRequestInput() { - return networkRequestInput; - } - - public void setNetworkRequestInput(NetworkRequestInputEntity networkRequestInput) { - this.networkRequestInput = networkRequestInput; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInformationEntity.java index 83ea7f950b..02ac6824a1 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInformationEntity.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInformationEntity.java @@ -32,8 +32,8 @@ public class NetworkInformationEntity { @JsonProperty("network-type") private String networkType; - @JsonProperty("ecomp-model-information") - private EcompModelInformationEntity ecompModelInformation; + @JsonProperty("onap-model-information") + private OnapModelInformationEntity onapModelInformation; public String getNetworkId() { return networkId; @@ -51,11 +51,11 @@ public class NetworkInformationEntity { this.networkType = networkType; } - public EcompModelInformationEntity getEcompModelInformation() { - return ecompModelInformation; + public OnapModelInformationEntity getOnapModelInformation() { + return onapModelInformation; } - public void setEcompModelInformation(EcompModelInformationEntity ecompModelInformation) { - this.ecompModelInformation = ecompModelInformation; + public void setOnapModelInformation(OnapModelInformationEntity onapModelInformation) { + this.onapModelInformation = onapModelInformation; } } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRequestInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRequestInputEntity.java index f5df5cb6e1..1aff6e948a 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRequestInputEntity.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRequestInputEntity.java @@ -38,6 +38,9 @@ public class NetworkRequestInputEntity { @JsonProperty("aic-clli") private String aicClli; + @JsonProperty("network-input-parameters") + private NetworkInputPaarametersEntity networkInputPaarameters; + public String getNetworkName() { return networkName; } @@ -77,7 +80,4 @@ public class NetworkRequestInputEntity { public void setNetworkInputPaarameters(NetworkInputPaarametersEntity networkInputPaarameters) { this.networkInputPaarameters = networkInputPaarameters; } - - @JsonProperty("network-input-parameters") - private NetworkInputPaarametersEntity networkInputPaarameters; } diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcInputEntity.java deleted file mode 100644 index eb7a45a90b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcInputEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Created by 10112215 on 2017/9/20. - */ -public class NetworkRpcInputEntity { - public InputEntity getInput() { - return input; - } - - public void setInput(InputEntity input) { - this.input = input; - } - - @JsonProperty("input") - private InputEntity input = null; -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcOutputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcOutputEntity.java deleted file mode 100644 index 58e1116470..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRpcOutputEntity.java +++ /dev/null @@ -1,39 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Created by 10112215 on 2017/9/20. - */ -public class NetworkRpcOutputEntity { - public OutputEntity getOutput() { - return output; - } - - public void setOutput(OutputEntity output) { - this.output = output; - } - - @JsonProperty("output") - private OutputEntity output; -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java new file mode 100644 index 0000000000..2fbc23e0cd --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/20. + */ +public class NetworkTopologyOperationInputEntity { + @JsonProperty("sdnc-request-header") + private SdncRequestHeaderEntity sdncRequestHeader; + + @JsonProperty("request-information") + private RequestInformationEntity requestInformation; + + @JsonProperty("service-information") + private ServiceInformationEntity serviceInformation; + + @JsonProperty("network-information") + private NetworkInformationEntity networkInformation; + + @JsonProperty("network-request-input") + private NetworkRequestInputEntity networkRequestInput; + + public SdncRequestHeaderEntity getSdncRequestHeader() { + return sdncRequestHeader; + } + + public void setSdncRequestHeader(SdncRequestHeaderEntity sdncRequestHeader) { + this.sdncRequestHeader = sdncRequestHeader; + } + + public RequestInformationEntity getRequestInformation() { + return requestInformation; + } + + public void setRequestInformation(RequestInformationEntity requestInformation) { + this.requestInformation = requestInformation; + } + + public ServiceInformationEntity getServiceInformation() { + return serviceInformation; + } + + public void setServiceInformation(ServiceInformationEntity serviceInformation) { + this.serviceInformation = serviceInformation; + } + + public NetworkInformationEntity getNetworkInformation() { + return networkInformation; + } + + public void setNetworkInformation(NetworkInformationEntity networkInformation) { + this.networkInformation = networkInformation; + } + + public NetworkRequestInputEntity getNetworkRequestInput() { + return networkRequestInput; + } + + public void setNetworkRequestInput(NetworkRequestInputEntity networkRequestInput) { + this.networkRequestInput = networkRequestInput; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationOutputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationOutputEntity.java new file mode 100644 index 0000000000..4be0844fc9 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationOutputEntity.java @@ -0,0 +1,94 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/22. + */ +public class NetworkTopologyOperationOutputEntity { + @JsonProperty("svc-request-id") + private String svcRequestId; + + @JsonProperty("response-code") + private String responseCode; + + @JsonProperty("response-message") + private String responseMessage; + + @JsonProperty("ack-final-indicator") + private String ackFinalIndicator; + + @JsonProperty("network-response-information") + private NetworkResponseInformationEntity networkResponseInformation; + + @JsonProperty("service-response-information") + private ServiceResponseInformationEntity serviceResponseInformation; + + public String getSvcRequestId() { + return svcRequestId; + } + + public void setSvcRequestId(String svcRequestId) { + this.svcRequestId = svcRequestId; + } + + public String getResponseCode() { + return responseCode; + } + + public void setResponseCode(String responseCode) { + this.responseCode = responseCode; + } + + public String getResponseMessage() { + return responseMessage; + } + + public void setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + } + + public String getAckFinalIndicator() { + return ackFinalIndicator; + } + + public void setAckFinalIndicator(String ackFinalIndicator) { + this.ackFinalIndicator = ackFinalIndicator; + } + + public NetworkResponseInformationEntity getNetworkResponseInformation() { + return networkResponseInformation; + } + + public void setNetworkResponseInformation(NetworkResponseInformationEntity networkResponseInformation) { + this.networkResponseInformation = networkResponseInformation; + } + + public ServiceResponseInformationEntity getServiceResponseInformation() { + return serviceResponseInformation; + } + + public void setServiceResponseInformation(ServiceResponseInformationEntity serviceResponseInformation) { + this.serviceResponseInformation = serviceResponseInformation; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OnapModelInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OnapModelInformationEntity.java new file mode 100644 index 0000000000..f061c9ab0a --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OnapModelInformationEntity.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/20. + */ +public class OnapModelInformationEntity { + @JsonProperty("model-invariant-uuid") + private String modelInvariantUuid; + + @JsonProperty("model-customization-uuid") + private String modelCustomizationUuid; + + @JsonProperty("model-uuid") + private String modelUuid; + + @JsonProperty("model-version") + private String modelVersion; + + @JsonProperty("model-name") + private String modelName; + + public String getModelInvariantUuid() { + return modelInvariantUuid; + } + + public void setModelInvariantUuid(String modelInvariantUuid) { + this.modelInvariantUuid = modelInvariantUuid; + } + + public String getModelCustomizationUuid() { + return modelCustomizationUuid; + } + + public void setModelCustomizationUuid(String modelCustomizationUuid) { + this.modelCustomizationUuid = modelCustomizationUuid; + } + + public String getModelUuid() { + return modelUuid; + } + + public void setModelUuid(String modelUuid) { + this.modelUuid = modelUuid; + } + + public String getModelVersion() { + return modelVersion; + } + + public void setModelVersion(String modelVersion) { + this.modelVersion = modelVersion; + } + + public String getModelName() { + return modelName; + } + + public void setModelName(String modelName) { + this.modelName = modelName; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OutputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OutputEntity.java deleted file mode 100644 index f4a1fa109a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OutputEntity.java +++ /dev/null @@ -1,94 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * Created by 10112215 on 2017/9/22. - */ -public class OutputEntity { - @JsonProperty("svc-request-id") - private String svcRequestId; - - @JsonProperty("response-code") - private String responseCode; - - @JsonProperty("response-message") - private String responseMessage; - - @JsonProperty("ack-final-indicator") - private String ackFinalIndicator; - - @JsonProperty("network-response-information") - private NetworkResponseInformationEntity networkResponseInformation; - - @JsonProperty("service-response-information") - private ServiceResponseInformationEntity serviceResponseInformation; - - public String getSvcRequestId() { - return svcRequestId; - } - - public void setSvcRequestId(String svcRequestId) { - this.svcRequestId = svcRequestId; - } - - public String getResponseCode() { - return responseCode; - } - - public void setResponseCode(String responseCode) { - this.responseCode = responseCode; - } - - public String getResponseMessage() { - return responseMessage; - } - - public void setResponseMessage(String responseMessage) { - this.responseMessage = responseMessage; - } - - public String getAckFinalIndicator() { - return ackFinalIndicator; - } - - public void setAckFinalIndicator(String ackFinalIndicator) { - this.ackFinalIndicator = ackFinalIndicator; - } - - public NetworkResponseInformationEntity getNetworkResponseInformation() { - return networkResponseInformation; - } - - public void setNetworkResponseInformation(NetworkResponseInformationEntity networkResponseInformation) { - this.networkResponseInformation = networkResponseInformation; - } - - public ServiceResponseInformationEntity getServiceResponseInformation() { - return serviceResponseInformation; - } - - public void setServiceResponseInformation(ServiceResponseInformationEntity serviceResponseInformation) { - this.serviceResponseInformation = serviceResponseInformation; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java new file mode 100644 index 0000000000..ed8ae578a1 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/20. + */ +public class RpcNetworkTopologyOperationInputEntity { + public NetworkTopologyOperationInputEntity getInput() { + return input; + } + + public void setInput(NetworkTopologyOperationInputEntity input) { + this.input = input; + } + + @JsonProperty("input") + private NetworkTopologyOperationInputEntity input = null; +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java new file mode 100644 index 0000000000..745d6c66b5 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/20. + */ +public class RpcNetworkTopologyOperationOutputEntity { + public NetworkTopologyOperationOutputEntity getOutput() { + return output; + } + + public void setOutput(NetworkTopologyOperationOutputEntity output) { + this.output = output; + } + + @JsonProperty("output") + private NetworkTopologyOperationOutputEntity output; +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java new file mode 100644 index 0000000000..5b49e11efd --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class RpcServiceTopologyOperationInputEntity { + public ServiceTopologyOperationInputEntity getServiceTopologyOperationInputEntity() { + return serviceTopologyOperationInputEntity; + } + + public void setServiceTopologyOperationInputEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity) { + this.serviceTopologyOperationInputEntity = serviceTopologyOperationInputEntity; + } + + @JsonProperty("input") + private ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity; +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationOutputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationOutputEntity.java new file mode 100644 index 0000000000..c59cc4eed1 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationOutputEntity.java @@ -0,0 +1,39 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class RpcServiceTopologyOperationOutputEntity { + @JsonProperty("output") + private ServiceTopologyOperationOutputEntity output; + + public ServiceTopologyOperationOutputEntity getOutput() { + return output; + } + + public void setOutput(ServiceTopologyOperationOutputEntity output) { + this.output = output; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInformationEntity.java index 7a79c9f21d..58d50fa724 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInformationEntity.java +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInformationEntity.java @@ -32,8 +32,8 @@ public class ServiceInformationEntity { @JsonProperty("subscription-service-type") private String subscriptionServiceType; - @JsonProperty("ecomp-model-information") - private EcompModelInformationEntity ecompModelInformation; + @JsonProperty("onap-model-information") + private OnapModelInformationEntity onapModelInformation; @JsonProperty("service-instance-id") private String serviceInstanceId; @@ -60,12 +60,12 @@ public class ServiceInformationEntity { this.subscriptionServiceType = subscriptionServiceType; } - public EcompModelInformationEntity getEcompModelInformation() { - return ecompModelInformation; + public OnapModelInformationEntity getOnapModelInformation() { + return onapModelInformation; } - public void setEcompModelInformation(EcompModelInformationEntity ecompModelInformation) { - this.ecompModelInformation = ecompModelInformation; + public void setOnapModelInformation(OnapModelInformationEntity onapModelInformation) { + this.onapModelInformation = onapModelInformation; } public String getServiceInstanceId() { diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java new file mode 100644 index 0000000000..038c50c7c6 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.List; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class ServiceInputParametersEntity { + public List getParamList() { + return paramList; + } + + public void setParamList(List paramList) { + this.paramList = paramList; + } + + @JsonProperty("param") + private List paramList; +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceRequestInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceRequestInputEntity.java new file mode 100644 index 0000000000..576995df49 --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceRequestInputEntity.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class ServiceRequestInputEntity { + + @JsonProperty("service-instance-name") + private String serviceInstanceName; + + @JsonProperty("service-input-parameters") + private ServiceInputParametersEntity serviceInputParametersEntity; + + public String getServiceInstanceName() { + return serviceInstanceName; + } + + public void setServiceInstanceName(String serviceInstanceName) { + this.serviceInstanceName = serviceInstanceName; + } + + public ServiceInputParametersEntity getServiceInputParametersEntity() { + return serviceInputParametersEntity; + } + + public void setServiceInputParametersEntity(ServiceInputParametersEntity serviceInputParametersEntity) { + this.serviceInputParametersEntity = serviceInputParametersEntity; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationInputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationInputEntity.java new file mode 100644 index 0000000000..d817b0c52f --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationInputEntity.java @@ -0,0 +1,72 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class ServiceTopologyOperationInputEntity { + @JsonProperty("sdnc-request-header") + private SdncRequestHeaderEntity sdncRequestHeader; + + @JsonProperty("request-information") + private RequestInformationEntity requestInformation; + + @JsonProperty("service-information") + private ServiceInformationEntity serviceInformation; + + @JsonProperty("service-request-input") + private ServiceRequestInputEntity serviceRequestInput; + + public SdncRequestHeaderEntity getSdncRequestHeader() { + return sdncRequestHeader; + } + + public void setSdncRequestHeader(SdncRequestHeaderEntity sdncRequestHeader) { + this.sdncRequestHeader = sdncRequestHeader; + } + + public RequestInformationEntity getRequestInformation() { + return requestInformation; + } + + public void setRequestInformation(RequestInformationEntity requestInformation) { + this.requestInformation = requestInformation; + } + + public ServiceInformationEntity getServiceInformation() { + return serviceInformation; + } + + public void setServiceInformation(ServiceInformationEntity serviceInformation) { + this.serviceInformation = serviceInformation; + } + + public ServiceRequestInputEntity getServiceRequestInput() { + return serviceRequestInput; + } + + public void setServiceRequestInput(ServiceRequestInputEntity serviceRequestInput) { + this.serviceRequestInput = serviceRequestInput; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationOutputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationOutputEntity.java new file mode 100644 index 0000000000..ebc1ca807d --- /dev/null +++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationOutputEntity.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Created by 10112215 on 2017/9/26. + */ +public class ServiceTopologyOperationOutputEntity { + @JsonProperty("svc-request-id") + private String svcRequestId; + + @JsonProperty("response-code") + private String responseCode; + + @JsonProperty("response-message") + private String responseMessage; + + @JsonProperty("ack-final-indicator") + private String ackFinalIndicator; + + @JsonProperty("service-response-information") + private ServiceResponseInformationEntity serviceResponseInformation; + + public String getSvcRequestId() { + return svcRequestId; + } + + public void setSvcRequestId(String svcRequestId) { + this.svcRequestId = svcRequestId; + } + + public String getResponseCode() { + return responseCode; + } + + public void setResponseCode(String responseCode) { + this.responseCode = responseCode; + } + + public String getResponseMessage() { + return responseMessage; + } + + public void setResponseMessage(String responseMessage) { + this.responseMessage = responseMessage; + } + + public String getAckFinalIndicator() { + return ackFinalIndicator; + } + + public void setAckFinalIndicator(String ackFinalIndicator) { + this.ackFinalIndicator = ackFinalIndicator; + } + + public ServiceResponseInformationEntity getServiceResponseInformation() { + return serviceResponseInformation; + } + + public void setServiceResponseInformation(ServiceResponseInformationEntity serviceResponseInformation) { + this.serviceResponseInformation = serviceResponseInformation; + } +} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUnderlayVpnOperation.bpmn b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUnderlayVpnOperation.bpmn index b8e79a2508..f9525879b3 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUnderlayVpnOperation.bpmn +++ b/bpmn/MSOInfrastructureBPMN/src/main/resources/subprocess/DoUnderlayVpnOperation.bpmn @@ -1,90 +1,292 @@ - + SequenceFlow_0trm4dk - SequenceFlow_11dtpnr + SequenceFlow_1vncx6p SequenceFlow_1amfirn SequenceFlow_083crve - SequenceFlow_1amfirn + SequenceFlow_10j9lbs SequenceFlow_083crve + SequenceFlow_0al8gdl - - - + + - + + SequenceFlow_0h35z1p + SequenceFlow_07bp14s + + SequenceFlow_0trm4dk - SequenceFlow_11dtpnr + SequenceFlow_199ig0b + + + SequenceFlow_199ig0b + SequenceFlow_1rj6k5t + SequenceFlow_0h35z1p + + + + SequenceFlow_1rj6k5t + SequenceFlow_1vncx6p + + + + + + + SequenceFlow_1amfirn + SequenceFlow_0bsmh51 + + + + SequenceFlow_0bsmh51 + SequenceFlow_10j9lbs + SequenceFlow_0al8gdl + + + + + + SequenceFlow_07bp14s + SequenceFlow_1oz5grh + SequenceFlow_19glon5 + + + SequenceFlow_1oz5grh + SequenceFlow_06e7qr6 + + + SequenceFlow_06e7qr6 + SequenceFlow_0koi1ia + SequenceFlow_1q83qn9 + + + SequenceFlow_0koi1ia + + + SequenceFlow_19glon5 + SequenceFlow_1q83qn9 + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - - - - - - - - - + + - + - - + + - + - - - + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit 1.2.3-korg