diff options
author | 黄卓垚10112215 <huang.zhuoyao@zte.com.cn> | 2017-09-27 21:15:46 +0800 |
---|---|---|
committer | Zhuoyao Huang <10112215@zte.com.cn> | 2017-09-27 21:52:17 +0800 |
commit | 66b06d89979610c90490d9b343bc44c227bf8395 (patch) | |
tree | b203487e8311e61157b7ea7dec99cc8356d1f6a3 /bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp | |
parent | ec9600da3a4c80de9f85ec21027aec3478cf8d92 (diff) |
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.
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp')
25 files changed, 720 insertions, 114 deletions
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/AbstractSdncOperationTask.java index f6f922f706..0f384096cb 100644 --- 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/AbstractSdncOperationTask.java @@ -37,7 +37,7 @@ import java.util.Map; /** * Created by 10112215 on 2017/9/16. */ -public abstract class AbstractSdncVlOperationTask extends BaseTask { +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; 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/SdncNetworkTopologyOperationTask.java index 4781ec1528..9e0b4f7806 100644 --- 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/SdncNetworkTopologyOperationTask.java @@ -24,8 +24,8 @@ 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.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; @@ -33,23 +33,23 @@ import java.util.Map; /** * Created by 10112215 on 2017/9/20. */ -public class SdncVlOperationTaskEntityImpl extends AbstractSdncVlOperationTask { +public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask { @Override public void sendRestrequestAndHandleResponse(DelegateExecution execution, Map<String, String> inputs, GenericResourceApi genericResourceApiClient) throws Exception { updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder(); - NetworkRpcInputEntity body = builder.build(inputs); + RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs); updateProgress(execution, null, null, "50", "RequestBody build finished!"); - NetworkRpcOutputEntity networkRpcOutputEntiy = genericResourceApiClient.postNetworkTopologyPeration(body).execute().body(); + RpcNetworkTopologyOperationOutputEntity outputEntity = genericResourceApiClient.postNetworkTopologyOperation(inputEntity).execute().body(); updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); - saveOutput(execution, networkRpcOutputEntiy); + saveOutput(execution, outputEntity); } - private void saveOutput(DelegateExecution execution, NetworkRpcOutputEntity output) throws Exception { + private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws Exception { String responseCode = output.getOutput().getResponseCode(); - if (!responseCode.equals("200")) { + if (!"200".equals(responseCode)) { String processKey = getProcessKey(execution); int errorCode = Integer.valueOf(responseCode); String errorMessage = output.getOutput().getResponseMessage(); 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/SdncOperationTaskYangToolsImpl.java index 8e7f8b5e8d..25727bdcd0 100644 --- 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/SdncOperationTaskYangToolsImpl.java @@ -24,7 +24,6 @@ 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; @@ -37,16 +36,16 @@ import java.util.Map; /** * Created by 10112215 on 2017/9/20. */ -public class SdncVlOperationTaskYangToolsImpl extends AbstractSdncVlOperationTask { +public class SdncOperationTaskYangToolsImpl extends AbstractSdncOperationTask { public void sendRestrequestAndHandleResponse(DelegateExecution execution, Map<String, String> inputs, GenericResourceApi genericResourceApiClient) throws Exception { updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); NetworkTopologyRequestBodyBuilder builder = new NetworkTopologyRequestBodyBuilder(); - RequestBody body = builder.build(inputs); + RequestBody body = builder.build(execution, inputs); updateProgress(execution, null, null, "50", "RequestBody build finished!"); - ResponseBody responseBody = genericResourceApiClient.postNetworkTopologyPeration(body).execute().body(); + ResponseBody responseBody = genericResourceApiClient.postNetworkTopologyOperation(body).execute().body(); updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); saveResponse(execution, responseBody); } @@ -56,7 +55,7 @@ public class SdncVlOperationTaskYangToolsImpl extends AbstractSdncVlOperationTas NetworkTopologyOperationOutput output = (NetworkTopologyOperationOutput) java2jsonService. transformRpcDataObjectFromString(NetworkTopologyRequestBodyBuilder.URI_PATH, responseBody.string()); String responseCode = output.getResponseCode(); - if (!responseCode.equals("200")) { + if (!"200".equals(responseCode)) { String processKey = getProcessKey(execution); int errorCode = Integer.valueOf(responseCode); String errorMessage = output.getResponseMessage(); 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<String, String> 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<String, String> 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/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<ResponseBody> postNetworkTopologyPeration(@Body RequestBody input); + Call<ResponseBody> postNetworkTopologyOperation(@Body RequestBody input); @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation") - Call<NetworkRpcOutputEntity> postNetworkTopologyPeration(@Body NetworkRpcInputEntity input); + Call<RpcNetworkTopologyOperationOutputEntity> postNetworkTopologyOperation(@Body RpcNetworkTopologyOperationInputEntity input); + + @POST("/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation") + Call<RpcServiceTopologyOperationOutputEntity> 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<IN, OUT> { - OUT build(IN input) throws Exception; +public abstract class AbstractBuilder<IN, OUT> { + 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<ParamEntity> getParamEntities(Map<String, String> inputs) { + List<ParamEntity> 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<Map<String, String>, NetworkRpcInputEntity> { +public class NetworkRpcInputEntityBuilder extends AbstractBuilder<Map<String, String>, 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<String, String> 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<String, String> inputs) { + RpcNetworkTopologyOperationInputEntity rpcNetworkTopologyOperationInputEntity = new RpcNetworkTopologyOperationInputEntity(); + NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity = getNetworkTopologyOperationInputEntity(execution, inputs); + rpcNetworkTopologyOperationInputEntity.setInput(networkTopologyOperationInputEntity); + return rpcNetworkTopologyOperationInputEntity; } - private void loadNetwrokRequestInputEntity(Map<String, String> inputs, InputEntity inputEntity) { + private void loadNetwrokRequestInputEntity(Map<String, String> inputs, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) { NetworkRequestInputEntity networkRequestInputEntity = new NetworkRequestInputEntity(); { NetworkInputPaarametersEntity networkInputPaarametersEntity = new NetworkInputPaarametersEntity(); @@ -64,52 +47,47 @@ public class NetworkRpcInputEntityBuilder implements AbstractBuilder<Map<String, List<ParamEntity> paramEntityList = getParamEntities(inputs); networkInputPaarametersEntity.setParamList(paramEntityList); } - } - inputEntity.setNetworkRequestInput(networkRequestInputEntity); + networkTopologyOperationInputEntity.setNetworkRequestInput(networkRequestInputEntity); } - private List<ParamEntity> getParamEntities(Map<String, String> inputs) { - List<ParamEntity> 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<String, String> 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<String, String> 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<String, String> 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<Map<String, String>, RequestBody> { +public class NetworkTopologyRequestBodyBuilder extends AbstractBuilder<Map<String, String>, 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<Map<St } @Override - public RequestBody build(Map<String, String> input) throws Exception { + public RequestBody build(DelegateExecution execution, Map<String, String> 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<Map<String, String>, RpcServiceTopologyOperationInputEntity> { + @Override + public RpcServiceTopologyOperationInputEntity build(DelegateExecution execution, Map<String, String> 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<String, String> inputs) { + List<ParamEntity> 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/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/InputEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java index a76fcba381..2fbc23e0cd 100644 --- 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/NetworkTopologyOperationInputEntity.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by 10112215 on 2017/9/20. */ -public class InputEntity { +public class NetworkTopologyOperationInputEntity { @JsonProperty("sdnc-request-header") private SdncRequestHeaderEntity sdncRequestHeader; 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/NetworkTopologyOperationOutputEntity.java index f4a1fa109a..4be0844fc9 100644 --- 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/NetworkTopologyOperationOutputEntity.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by 10112215 on 2017/9/22. */ -public class OutputEntity { +public class NetworkTopologyOperationOutputEntity { @JsonProperty("svc-request-id") private String svcRequestId; 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/OnapModelInformationEntity.java index df26d26baa..f061c9ab0a 100644 --- 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/OnapModelInformationEntity.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by 10112215 on 2017/9/20. */ -public class EcompModelInformationEntity { +public class OnapModelInformationEntity { @JsonProperty("model-invariant-uuid") private String modelInvariantUuid; 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/RpcNetworkTopologyOperationInputEntity.java index eb7a45a90b..ed8ae578a1 100644 --- 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/RpcNetworkTopologyOperationInputEntity.java @@ -25,15 +25,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by 10112215 on 2017/9/20. */ -public class NetworkRpcInputEntity { - public InputEntity getInput() { +public class RpcNetworkTopologyOperationInputEntity { + public NetworkTopologyOperationInputEntity getInput() { return input; } - public void setInput(InputEntity input) { + public void setInput(NetworkTopologyOperationInputEntity input) { this.input = input; } @JsonProperty("input") - private InputEntity input = null; + private NetworkTopologyOperationInputEntity 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/RpcNetworkTopologyOperationOutputEntity.java index 58e1116470..745d6c66b5 100644 --- 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/RpcNetworkTopologyOperationOutputEntity.java @@ -25,15 +25,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** * Created by 10112215 on 2017/9/20. */ -public class NetworkRpcOutputEntity { - public OutputEntity getOutput() { +public class RpcNetworkTopologyOperationOutputEntity { + public NetworkTopologyOperationOutputEntity getOutput() { return output; } - public void setOutput(OutputEntity output) { + public void setOutput(NetworkTopologyOperationOutputEntity output) { this.output = output; } @JsonProperty("output") - private OutputEntity 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<ParamEntity> getParamList() { + return paramList; + } + + public void setParamList(List<ParamEntity> paramList) { + this.paramList = paramList; + } + + @JsonProperty("param") + private List<ParamEntity> 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; + } +} |