diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-07-30 15:56:09 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2018-07-31 11:09:25 -0400 |
commit | 5a6a6de6f1a26a1897e4917a0df613e25a24eb70 (patch) | |
tree | 59a968f27b4b603aacc9d5e7b51fb598aeec5321 /bpmn/MSOInfrastructureBPMN/src/main/java/org | |
parent | b6dc38501f3b746426b42d9de4cc883d894149e8 (diff) |
Containerization feature of SO
Change-Id: I95381232eeefcd247a66a5cec370a8ce1c288e18
Issue-ID: SO-670
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/java/org')
66 files changed, 0 insertions, 5153 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntity.java deleted file mode 100644 index 8ba4589ebc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateOwningEntity.java +++ /dev/null @@ -1,50 +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.AAITasks;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.client.orchestration.AAIOrchestrator;
-
-public class AAICreateOwningEntity implements JavaDelegate {
- private static Logger LOGGER = Logger.getLogger("AAICreateOwningEntity");
- AAIOrchestrator aaiO = new AAIOrchestrator();
- ExceptionUtil exceptionUtil = new ExceptionUtil();
-
- public void execute(DelegateExecution execution) throws Exception {
- LOGGER.info("**** Started AAICreateOwningEntity ****");
- ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition");
- if (serviceDecomp.getServiceInstance() != null && serviceDecomp.getOwningEntity() != null) {
- try {
- aaiO.createOwningEntityandConnectServiceInstance(serviceDecomp);
- } catch (Exception ex) {
- String msg = "Exception in AAICreateOwningEntity. " + ex.getMessage();
- LOGGER.info(msg);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
- }
- LOGGER.info("**** Finished AAICreateOwningEntity ****");
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateProject.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateProject.java deleted file mode 100644 index fe7006f530..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateProject.java +++ /dev/null @@ -1,50 +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.AAITasks;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.client.orchestration.AAIOrchestrator;
-
-public class AAICreateProject implements JavaDelegate {
- private static Logger LOGGER = Logger.getLogger("AAICreateProject");
- AAIOrchestrator aaiO = new AAIOrchestrator();
- ExceptionUtil exceptionUtil = new ExceptionUtil();
-
- public void execute(DelegateExecution execution) throws Exception {
- LOGGER.info("**** Started AAICreateProject ****");
- ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition");
- if (serviceDecomp.getServiceInstance() != null && serviceDecomp.getProject() != null) {
- try {
- aaiO.createProjectandConnectServiceInstance(serviceDecomp);
- } catch (Exception ex) {
- String msg = "Exception in AAICreateProject. " + ex.getMessage();
- LOGGER.info(msg);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
- }
- LOGGER.info("**** Finished AAICreateProject ****");
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateServiceInstance.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateServiceInstance.java deleted file mode 100644 index b76675d0fc..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/AAITasks/AAICreateServiceInstance.java +++ /dev/null @@ -1,50 +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.AAITasks;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.client.orchestration.AAIOrchestrator;
-
-public class AAICreateServiceInstance implements JavaDelegate {
- private static Logger LOGGER = Logger.getLogger("AAICreateServiceInstance");
- AAIOrchestrator aaiO = new AAIOrchestrator();
- ExceptionUtil exceptionUtil = new ExceptionUtil();
-
- public void execute(DelegateExecution execution) throws Exception {
- LOGGER.info("**** Started AAICreateServiceInstance ****");
- ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition");
- execution.setVariable("aaiServiceInstanceRollback", false);
- try {
- aaiO.createServiceInstance(serviceDecomp);
- } catch (Exception ex) {
- String msg = "Exception in AAICreateServiceInstance. " + ex.getMessage();
- LOGGER.info(msg);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
- execution.setVariable("aaiServiceInstanceRollback", true);
- LOGGER.info("**** Finished AAICreateServiceInstance ****");
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackAAIServiceInstance.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackAAIServiceInstance.java deleted file mode 100644 index 496ad6a1ff..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackAAIServiceInstance.java +++ /dev/null @@ -1,56 +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.DoCreateServiceInstance;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.BpmnError;
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.client.orchestration.AAIOrchestrator;
-
-public class RollbackAAIServiceInstance implements JavaDelegate {
- private static Logger LOGGER = Logger.getLogger("RollbackAAIServiceInstance");
- ExceptionUtil exceptionUtil = new ExceptionUtil();
-
- public void execute(DelegateExecution execution) throws Exception {
- boolean aaiServiceInstanceRollback = (boolean) execution.getVariable("aaiServiceInstanceRollback");
- if (aaiServiceInstanceRollback) {
- LOGGER.info("**** Starting RollbackAAIServiceInstance ****");
- try {
- ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("ServiceDecomposition");
- AAIOrchestrator aaiO = new AAIOrchestrator();
- aaiO.deleteServiceInstance(serviceDecomp);
- } catch (Exception ex) {
- String msg = "Error Response from AAI for aaiServiceInstanceRollback";
- execution.setVariable("rollbackError", msg);
- LOGGER.info(msg);
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
- LOGGER.info("**** Finished RollbackAAIServiceInstance ****");
- } else {
- LOGGER.info("**** Skipping RollbackAAIServiceInstance ****");
- }
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackError.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackError.java deleted file mode 100644 index 68ea713963..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/RollbackError.java +++ /dev/null @@ -1,38 +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.DoCreateServiceInstance;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-
-public class RollbackError implements JavaDelegate {
-
- private static Logger LOGGER = Logger.getLogger("RollbackError");
-
- @Override
- public void execute(DelegateExecution execution) throws Exception {
- LOGGER.info("Caught an Exception in DoCreateServiceInstanceRollbackV3");
- LOGGER.info("Unable to rollback DoCreateServiceInstanceV3");
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/SetupServiceDecomp.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/SetupServiceDecomp.java deleted file mode 100644 index 4edb4058e8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/DoCreateServiceInstance/SetupServiceDecomp.java +++ /dev/null @@ -1,112 +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.DoCreateServiceInstance;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.json.JSONObject;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.core.domain.Customer;
-import org.openecomp.mso.bpmn.core.domain.ModelInfo;
-import org.openecomp.mso.bpmn.core.domain.OwningEntity;
-import org.openecomp.mso.bpmn.core.domain.Project;
-import org.openecomp.mso.bpmn.core.domain.Request;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.bpmn.core.domain.ServiceInstance;
-
-public class SetupServiceDecomp implements JavaDelegate {
-
- ExceptionUtil exceptionUtil = new ExceptionUtil();
- private static Logger LOGGER = Logger.getLogger("SetupServiceDecomp");
-
- public void execute(DelegateExecution execution) throws Exception {
- LOGGER.info("Starting SetupServiceDecomp");
- try {
- String json = (String) execution.getVariable("bpmnRequest");
- JSONObject jsonObj = new JSONObject(json);
- JSONObject jsonReq = jsonObj.getJSONObject("requestDetails");
- JSONObject jsonServ = jsonReq.getJSONObject("serviceInstance");
- String serviceInstanceId = jsonServ.getString("serviceInstanceId");
- System.out.println("servInstId: "+serviceInstanceId);
- String serviceInstanceName = jsonServ.getString("serviceInstanceName");
- String serviceType = jsonServ.getString("serviceType");
- String serviceRole = jsonServ.getString("serviceRole");
- String modelInvariantUuid = jsonServ.getString("modelInvariantUuid");
- String modelUuid = jsonServ.getString("modelUuid");
- String modelVersion = jsonServ.getString("modelVersion");
- String modelName = jsonServ.getString("modelName");
- String environmentContext = jsonServ.getString("environmentContext");
- String workloadContext = jsonServ.getString("workloadContext");
- JSONObject jsonProject = jsonReq.getJSONObject("project");
- String projectName = jsonProject.getString("projectName");
- JSONObject jsonOwningEntity = jsonReq.getJSONObject("owningEntity");
- String owningEntityId = jsonOwningEntity.getString("owningEntityId");
- String owningEntityName = jsonOwningEntity.getString("owningEntityName");
- JSONObject jsonCustomer = jsonReq.getJSONObject("customer");
- String subscriptionServiceType = jsonCustomer.getString("subscriptionServiceType");
- String globalSubscriberId = jsonCustomer.getString("globalSubscriberId");
- JSONObject jsonRequest = jsonReq.getJSONObject("request");
- String sdncRequestId = jsonRequest.getString("sdncRequestId");
- String callbackURL = jsonRequest.getString("callbackURL");
- String requestId = jsonRequest.getString("requestId");
- String productFamilyId = jsonRequest.getString("productFamilyId");
- ServiceDecomposition serviceDecomp = new ServiceDecomposition("{}");
- serviceDecomp.setCallbackURN(callbackURL);
- serviceDecomp.setServiceRole(serviceRole);
- ModelInfo modelInfo = new ModelInfo();
- modelInfo.setModelInvariantUuid(modelInvariantUuid);
- modelInfo.setModelName(modelName);
- modelInfo.setModelVersion(modelVersion);
- modelInfo.setModelUuid(modelUuid);
- ServiceInstance serviceInstance = new ServiceInstance();
- serviceInstance.setInstanceId(serviceInstanceId);
- serviceInstance.setInstanceName(serviceInstanceName);
- serviceInstance.setServiceType(serviceType);
- serviceInstance.setModelInfo(modelInfo);
- serviceInstance.setEnvironmentContext(environmentContext);
- serviceInstance.setWorkloadContext(workloadContext);
- Project project = new Project();
- project.setProjectName(projectName);
- OwningEntity owningEntity = new OwningEntity();
- owningEntity.setOwningEntityId(owningEntityId);
- owningEntity.setOwningEntityName(owningEntityName);
- Customer customer = new Customer();
- customer.setGlobalSubscriberId(globalSubscriberId);
- customer.setSubscriptionServiceType(subscriptionServiceType);
- Request request = new Request();
- request.setRequestId(requestId);
- request.setSdncRequestId(sdncRequestId);
- request.setProductFamilyId(productFamilyId);
- serviceDecomp.setCustomer(customer);
- serviceDecomp.setServiceInstance(serviceInstance);
- serviceDecomp.setRequest(request);
- serviceDecomp.setProject(project);
- serviceDecomp.setOwningEntity(owningEntity);
- execution.setVariable("ServiceDecomposition", serviceDecomp);
- } catch (Exception ex) {
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "ERROR IN SET UP SERVICE DECOMP");
- }
- LOGGER.info("Finished SetupServiceDecomp");
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/MSOInfrastructureApplication.java deleted file mode 100644 index c7420c3a03..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/MSOInfrastructureApplication.java +++ /dev/null @@ -1,58 +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;
-
-import java.util.List;
-
-import org.camunda.bpm.application.PostDeploy;
-import org.camunda.bpm.application.PreUndeploy;
-import org.camunda.bpm.application.ProcessApplication;
-import org.camunda.bpm.application.ProcessApplicationInfo;
-import org.camunda.bpm.application.impl.ServletProcessApplication;
-import org.camunda.bpm.engine.ProcessEngine;
-
-import org.openecomp.mso.logger.MsoLogger;
-
-/**
- * @since Version 1.0
- *
- */
-@ProcessApplication("MSO Infrastructure Application")
-public class MSOInfrastructureApplication extends ServletProcessApplication {
-
- private MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL);
-
- @PostDeploy
- public void postDeploy(ProcessEngine processEngineInstance) {
- long startTime = System.currentTimeMillis();
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Post deployment complete...");
- }
-
- @PreUndeploy
- public void cleanup(ProcessEngine processEngine, ProcessApplicationInfo processApplicationInfo, List<ProcessEngine> processEngines) {
- long startTime = System.currentTimeMillis();
-
- msoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.COMPLETE, MsoLogger.ResponseCode.Suc, "Pre Undeploy complete...");
-
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/SDNCTasks/SDNCCreateServiceInstance.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/SDNCTasks/SDNCCreateServiceInstance.java deleted file mode 100644 index 549ae36612..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/SDNCTasks/SDNCCreateServiceInstance.java +++ /dev/null @@ -1,49 +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.SDNCTasks;
-
-import java.util.logging.Logger;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition;
-import org.openecomp.mso.client.orchestration.SDNCOrchestrator;
-
-public class SDNCCreateServiceInstance implements JavaDelegate {
- private static Logger LOGGER = Logger.getLogger("SDNCCreateServiceInstance");
- SDNCOrchestrator sdncO = new SDNCOrchestrator();
- ExceptionUtil exceptionUtil = new ExceptionUtil();
-
- public void execute(DelegateExecution execution) throws Exception {
- LOGGER.info("**** Started SDNCCreateServiceInstance ****");
- ServiceDecomposition serviceDecomp = (ServiceDecomposition) execution.getVariable("serviceDecomposition");
- if (serviceDecomp != null) {
- try {
- sdncO.createServiceInstance(serviceDecomp);
- } catch (Exception ex) {
- String msg = "Exception in sdncCreateServiceInstance. " + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
- }
- LOGGER.info("**** Finished SDNCCreateServiceInstance ****");
- }
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java deleted file mode 100644 index 3d05f76b03..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAICreateResources.java +++ /dev/null @@ -1,98 +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.aai; - -import java.util.HashMap; -import java.util.Map; -import java.util.Optional; - -import org.onap.aai.domain.yang.v12.GenericVnf; -import org.openecomp.mso.client.aai.AAIObjectType; -import org.openecomp.mso.client.aai.AAIResourcesClient; -import org.openecomp.mso.client.aai.entities.AAIResultWrapper; -import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri; -import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory; - -public class AAICreateResources { - - - public void createAAIProject (String projectName, String serviceInstance){ - AAIResourceUri projectURI = AAIUriFactory.createResourceUri(AAIObjectType.PROJECT, projectName); - AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - aaiRC.createIfNotExists(projectURI, Optional.empty()).connect(projectURI, serviceInstanceURI); - - } - - public void createAAIOwningEntity(String owningEntityId, String owningEntityName,String serviceInstance){ - AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId); - AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance); - Map<String, String> hashMap= new HashMap<>(); - hashMap.put("owning-entity-name", owningEntityName); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - aaiRC.createIfNotExists(owningEntityURI, Optional.of(hashMap)).connect(owningEntityURI, serviceInstanceURI); - } - - public boolean existsOwningEntity(String owningEntityId){ - AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - return aaiRC.exists(owningEntityURI); - } - - public void connectOwningEntityandServiceInstance (String owningEntityId, String serviceInstance){ - AAIResourceUri owningEntityURI = AAIUriFactory.createResourceUri(AAIObjectType.OWNING_ENTITY, owningEntityId); - AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstance); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - aaiRC.connect(owningEntityURI, serviceInstanceURI); - } - - public void createAAIPlatform(String platformName,String vnfId){ - AAIResourceUri platformURI = AAIUriFactory.createResourceUri(AAIObjectType.PLATFORM, platformName); - AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - aaiRC.createIfNotExists(platformURI, Optional.empty()).connect(platformURI, genericVnfURI); - } - - public void createAAILineOfBusiness(String lineOfBusiness,String vnfId){ - AAIResourceUri lineOfBusinessURI = AAIUriFactory.createResourceUri(AAIObjectType.LINE_OF_BUSINESS, lineOfBusiness); - AAIResourceUri genericVnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF,vnfId); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - aaiRC.createIfNotExists(lineOfBusinessURI, Optional.empty()).connect(lineOfBusinessURI, genericVnfURI); - } - public void createAAIServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId){ - AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalCustomerId,serviceType,serviceInstanceId); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - aaiRC.createIfNotExists(serviceInstanceURI, Optional.empty()); - } - - public Optional<GenericVnf> getVnfInstance(String vnfId){ - try{ - AAIResourceUri vnfURI = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, vnfId); - AAIResourcesClient aaiRC = new AAIResourcesClient(); - AAIResultWrapper aaiResponse = aaiRC.get(vnfURI); - Optional<GenericVnf> vnf = aaiResponse.asBean(GenericVnf.class); - return vnf; - } catch (Exception ex){ - return Optional.empty(); - } - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java deleted file mode 100644 index 483c057f3e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIDeleteServiceInstance.java +++ /dev/null @@ -1,49 +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.aai;
-
-import org.camunda.bpm.engine.delegate.DelegateExecution;
-import org.camunda.bpm.engine.delegate.JavaDelegate;
-import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil;
-import org.openecomp.mso.client.aai.AAIObjectType;
-import org.openecomp.mso.client.aai.AAIResourcesClient;
-import org.openecomp.mso.client.aai.entities.uri.AAIResourceUri;
-import org.openecomp.mso.client.aai.entities.uri.AAIUriFactory;
-
-public class AAIDeleteServiceInstance implements JavaDelegate{
-
- ExceptionUtil exceptionUtil = new ExceptionUtil();
- public void execute(DelegateExecution execution) throws Exception {
- try{
- String serviceInstanceId = (String) execution.getVariable("serviceInstanceId");
- AAIResourceUri serviceInstanceURI = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE,
- serviceInstanceId);
- AAIResourcesClient aaiRC = new AAIResourcesClient();
- aaiRC.delete(serviceInstanceURI);
- execution.setVariable("GENDS_SuccessIndicator",true);
- } catch(Exception ex){
- String msg = "Exception in Delete Serivce Instance. Service Instance could not be deleted in AAI." + ex.getMessage();
- exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg);
- }
-
- }
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstance.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstance.java deleted file mode 100644 index 7370208f5e..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/aai/AAIServiceInstance.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.aai;
-
-public class AAIServiceInstance {
- String serviceInstanceName;
- String serviceType;
- String serviceRole;
- String orchestrationStatus;
- String modelInvariantUuid;
- String modelVersionId;
- String environmentContext;
- String workloadContext;
- public AAIServiceInstance(String serviceInstanceName, String serviceType, String serviceRole,
- String orchestrationStatus, String modelInvariantUuid, String modelVersionId, String environmentContext,
- String workloadContext) {
- this.serviceInstanceName = serviceInstanceName;
- this.serviceType = serviceType;
- this.serviceRole = serviceRole;
- this.orchestrationStatus = orchestrationStatus;
- this.modelInvariantUuid = modelInvariantUuid;
- this.modelVersionId = modelVersionId;
- this.environmentContext = environmentContext;
- this.workloadContext = workloadContext;
- }
- public String getServiceInstanceName() {
- return serviceInstanceName;
- }
- public void setServiceInstanceName(String serviceInstanceName) {
- this.serviceInstanceName = serviceInstanceName;
- }
- public String getServiceType() {
- return serviceType;
- }
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
- public String getServiceRole() {
- return serviceRole;
- }
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
- public String getOrchestrationStatus() {
- return orchestrationStatus;
- }
- public void setOrchestrationStatus(String orchestrationStatus) {
- this.orchestrationStatus = orchestrationStatus;
- }
- public String getModelInvariantUuid() {
- return modelInvariantUuid;
- }
- public void setModelInvariantUuid(String modelInvariantUuid) {
- this.modelInvariantUuid = modelInvariantUuid;
- }
- public String getModelVersionId() {
- return modelVersionId;
- }
- public void setModelVersionId(String modelVersionId) {
- this.modelVersionId = modelVersionId;
- }
- public String getEnvironmentContext() {
- return environmentContext;
- }
- public void setEnvironmentContext(String environmentContext) {
- this.environmentContext = environmentContext;
- }
- public String getWorkloadContext() {
- return workloadContext;
- }
- public void setWorkloadContext(String workloadContext) {
- this.workloadContext = workloadContext;
- }
-
-
-}
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java deleted file mode 100644 index 2be5ebdc5d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/aai/AaiConnectionImpl.java +++ /dev/null @@ -1,45 +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.pnf.aai; - -import java.io.IOException; -import java.util.Optional; -import java.util.UUID; -import org.apache.commons.lang.NotImplementedException; -import org.onap.aai.domain.yang.Pnf; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection; -import org.openecomp.mso.client.aai.AAIRestClientImpl; -import org.springframework.stereotype.Component; - -public class AaiConnectionImpl implements AaiConnection { - - @Override - public Optional<Pnf> getEntryFor(String correlationId) throws IOException { - AAIRestClientImpl restClient = new AAIRestClientImpl(); - return restClient.getPnfByName(correlationId, UUID.randomUUID().toString()); - } - - @Override - public void createEntry(String correlationId, Pnf entry) throws IOException { - AAIRestClientImpl restClient = new AAIRestClientImpl(); - restClient.createPnf(correlationId, UUID.randomUUID().toString(), entry); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java deleted file mode 100644 index 92169b202b..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CancelDmaapSubscription.java +++ /dev/null @@ -1,42 +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.pnf.delegate; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.DmaapClient; -import org.springframework.beans.factory.annotation.Autowired; - -public class CancelDmaapSubscription implements JavaDelegate { - - private DmaapClient dmaapClient; - - @Override - public void execute(DelegateExecution execution) throws Exception { - String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID); - dmaapClient.unregister(correlationId); - } - - @Autowired - public void setDmaapClient(DmaapClient dmaapClient) { - this.dmaapClient = dmaapClient; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java deleted file mode 100644 index 0e65dd7441..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CheckAaiForCorrelationIdDelegate.java +++ /dev/null @@ -1,76 +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.pnf.delegate; - -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_IP; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.AAI_CONTAINS_INFO_ABOUT_PNF; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; - -import java.io.IOException; -import org.camunda.bpm.engine.delegate.BpmnError; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiResponse; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.CheckAaiForCorrelationIdImplementation; -import org.openecomp.mso.logger.MsoLogger; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * Implementation of "Check AAI for correlation_id" task in CreateAndActivatePnfResource.bpmn - * - * Inputs: - * - correlationId - String - * - * Outputs: - * - AAI_CONTAINS_INFO_ABOUT_PNF - local Boolean - * - aaiContainsInfoAboutIp - local Boolean - */ - -public class CheckAaiForCorrelationIdDelegate implements JavaDelegate { - private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); - private CheckAaiForCorrelationIdImplementation implementation = new CheckAaiForCorrelationIdImplementation(); - private AaiConnection aaiConnection; - - @Autowired - public void setAaiConnection(AaiConnection aaiConnection) { - this.aaiConnection = aaiConnection; - } - - @Override - public void execute(DelegateExecution execution) throws Exception { - String correlationId = (String) execution.getVariable(CORRELATION_ID); - if (correlationId == null) { - new ExceptionUtil().buildAndThrowWorkflowException(execution, 500, CORRELATION_ID + " is not set"); - } - - try { - AaiResponse aaiResponse = implementation.check(correlationId, aaiConnection); - - execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_PNF, aaiResponse.getContainsInfoAboutPnf()); - execution.setVariableLocal(AAI_CONTAINS_INFO_ABOUT_IP, aaiResponse.getContainsInfoAboutIp()); - } catch (IOException e) { - LOGGER.error("IOException",e); - new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, e.getMessage()); - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java deleted file mode 100644 index 62b806eae8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/CreateAaiEntryWithPnfIdDelegate.java +++ /dev/null @@ -1,55 +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.pnf.delegate; - -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.onap.aai.domain.yang.Pnf; -import org.openecomp.mso.bpmn.infrastructure.pnf.implementation.AaiConnection; -import org.springframework.beans.factory.annotation.Autowired; - -/** - * Implementation of "Create AAI entry with pnf-id = correlation_id" task in CreateAndActivatePnfResource.bpmn - * - * Inputs: - * - correlationId - String - */ -public class CreateAaiEntryWithPnfIdDelegate implements JavaDelegate { - - private AaiConnection aaiConnection; - - @Autowired - public void setAaiConnection(AaiConnection aaiConnection) { - this.aaiConnection = aaiConnection; - } - - @Override - public void execute(DelegateExecution execution) throws Exception { - String correlationId = (String) execution.getVariable(CORRELATION_ID); - Pnf pnf = new Pnf(); - pnf.setInMaint(true); - pnf.setPnfId(correlationId); - pnf.setPnfName(correlationId); - aaiConnection.createEntry(correlationId, pnf); - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java deleted file mode 100644 index 361313e932..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/ExecutionVariableNames.java +++ /dev/null @@ -1,33 +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.pnf.delegate; - -@SuppressWarnings("ALL") -public class ExecutionVariableNames { - - private ExecutionVariableNames() {} - - public final static String CORRELATION_ID = "correlationId"; - public final static String AAI_CONTAINS_INFO_ABOUT_PNF = "aaiContainsInfoAboutPnf"; - public final static String AAI_CONTAINS_INFO_ABOUT_IP = "aaiContainsInfoAboutIp"; - public final static String DMAAP_MESSAGE = "dmaapMessage"; - public final static String TIMEOUT_FOR_NOTIFICATION = "timeoutForPnfEntryNotification"; -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java deleted file mode 100644 index edff36fe68..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/InformDmaapClient.java +++ /dev/null @@ -1,45 +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.pnf.delegate; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.openecomp.mso.bpmn.infrastructure.pnf.dmaap.DmaapClient; -import org.springframework.beans.factory.annotation.Autowired; - -public class InformDmaapClient implements JavaDelegate { - - private DmaapClient dmaapClient; - - @Override - public void execute(DelegateExecution execution) throws Exception { - String correlationId = (String) execution.getVariable(ExecutionVariableNames.CORRELATION_ID); - dmaapClient.registerForUpdate(correlationId, () -> execution.getProcessEngineServices().getRuntimeService() - .createMessageCorrelation("WorkflowMessage") - .processInstanceBusinessKey(execution.getProcessBusinessKey()) - .correlateWithResult()); - } - - @Autowired - public void setDmaapClient(DmaapClient dmaapClient) { - this.dmaapClient = dmaapClient; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java deleted file mode 100644 index 268113d28f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/delegate/PnfCheckInputs.java +++ /dev/null @@ -1,57 +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.pnf.delegate; - -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.CORRELATION_ID; -import static org.openecomp.mso.bpmn.infrastructure.pnf.delegate.ExecutionVariableNames.TIMEOUT_FOR_NOTIFICATION; - -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.camunda.bpm.engine.delegate.JavaDelegate; -import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil; -import org.openecomp.mso.logger.MsoLogger; - -public class PnfCheckInputs implements JavaDelegate { - - private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); - - private String defaultTimeout; - - @Override - public void execute(DelegateExecution execution) throws Exception { - String correlationId = (String) execution.getVariable(CORRELATION_ID); - if (correlationId == null) { - new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, "correlationId variable not defined"); - } - String timeout = (String) execution.getVariable(TIMEOUT_FOR_NOTIFICATION); - if (timeout == null) { - LOGGER.debug("timeoutForPnfEntryNotification variable not found, setting default"); - if (defaultTimeout == null) { - new ExceptionUtil().buildAndThrowWorkflowException(execution, 9999, - "default timeoutForPnfEntryNotification value not defined"); - } - execution.setVariable(TIMEOUT_FOR_NOTIFICATION, defaultTimeout); - } - } - - public void setDefaultTimeout(String defaultTimeout) { - this.defaultTimeout = defaultTimeout; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/DmaapClient.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/DmaapClient.java deleted file mode 100644 index 12a6c7c51f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/DmaapClient.java +++ /dev/null @@ -1,28 +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.pnf.dmaap; - -public interface DmaapClient { - - void registerForUpdate(String correlationId, Runnable informConsumer); - - Runnable unregister(String correlationId); -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java deleted file mode 100644 index 2853899ae2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/JsonUtilForCorrelationId.java +++ /dev/null @@ -1,71 +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.pnf.dmaap; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import java.util.ArrayList; -import java.util.List; -import java.util.Optional; -import java.util.Spliterator; - -final class JsonUtilForCorrelationId { - - private static final String JSON_HEADER = "pnfRegistrationFields"; - private static final String JSON_CORRELATION_ID_FIELD_NAME = "correlationId"; - - static List<String> parseJsonToGelAllCorrelationId(String json) { - List<String> list = new ArrayList<>(); - JsonElement je = new JsonParser().parse(json); - if (je.isJsonObject()) { - getCorrelationIdFromJsonObject(je.getAsJsonObject()).ifPresent(corr -> list.add(corr)); - } else { - JsonArray array = je.getAsJsonArray(); - Spliterator<JsonElement> spliterator = array.spliterator(); - spliterator.forEachRemaining(jsonElement -> { - parseJsonElementToJsonObject(jsonElement) - .ifPresent(jsonObject -> getCorrelationIdFromJsonObject(jsonObject) - .ifPresent(correlationId -> list.add(correlationId))); - }); - } - return list; - } - - private static Optional<JsonObject> parseJsonElementToJsonObject(JsonElement jsonElement) { - if (jsonElement.isJsonObject()) { - return Optional.ofNullable(jsonElement.getAsJsonObject()); - } - return Optional.ofNullable(new JsonParser().parse(jsonElement.getAsString()).getAsJsonObject()); - } - - private static Optional<String> getCorrelationIdFromJsonObject(JsonObject jsonObject) { - if (jsonObject.has(JSON_HEADER)) { - JsonObject jo = jsonObject.getAsJsonObject(JSON_HEADER); - if (jo.has(JSON_CORRELATION_ID_FIELD_NAME)) { - return Optional.ofNullable(jo.get(JSON_CORRELATION_ID_FIELD_NAME).getAsString()); - } - } - return Optional.empty(); - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java deleted file mode 100644 index 2b3a60fa20..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/dmaap/PnfEventReadyDmaapClient.java +++ /dev/null @@ -1,170 +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.pnf.dmaap; - -import java.io.IOException; -import java.net.URI; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Executors; -import java.util.concurrent.ScheduledExecutorService; -import java.util.concurrent.TimeUnit; -import javax.ws.rs.core.UriBuilder; -import org.apache.http.HttpResponse; -import org.apache.http.client.HttpClient; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.util.EntityUtils; -import org.openecomp.mso.bpmn.core.PropertyConfiguration; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.logger.MsoLogger.Catalog; - -public class PnfEventReadyDmaapClient implements DmaapClient { - - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger(Catalog.GENERAL); - - private HttpClient httpClient; - private String dmaapHost; - private int dmaapPort; - private String dmaapProtocol; - private String dmaapUriPathPrefix; - private String dmaapTopicName; - private String consumerId; - private String consumerGroup; - private Map<String, Runnable> pnfCorrelationIdToThreadMap; - private HttpGet getRequest; - private ScheduledExecutorService executor; - private int dmaapClientDelayInSeconds; - private volatile boolean dmaapThreadListenerIsRunning; - - public void init() { - httpClient = HttpClientBuilder.create().build(); - pnfCorrelationIdToThreadMap = new ConcurrentHashMap<>(); - dmaapHost = PropertyConfiguration.getInstance().getProperties(PropertyConfiguration.MSO_BPMN_URN_PROPERTIES) - .get("mso.dmaap.host"); - dmaapPort = Integer.parseInt(PropertyConfiguration.getInstance() - .getProperties(PropertyConfiguration.MSO_BPMN_URN_PROPERTIES).get("mso.dmaap.port")); - executor = null; - getRequest = new HttpGet(buildURI()); - } - - @Override - public synchronized void registerForUpdate(String correlationId, Runnable informConsumer) { - LOGGER.debug("registering for pnf ready dmaap event for correlation id: " + correlationId); - pnfCorrelationIdToThreadMap.put(correlationId, informConsumer); - if (!dmaapThreadListenerIsRunning) { - startDmaapThreadListener(); - } - } - - @Override - public synchronized Runnable unregister(String correlationId) { - LOGGER.debug("unregistering from pnf ready dmaap event for correlation id: " + correlationId); - Runnable runnable = pnfCorrelationIdToThreadMap.remove(correlationId); - if (pnfCorrelationIdToThreadMap.isEmpty()) { - stopDmaapThreadListener(); - } - return runnable; - } - - private synchronized void startDmaapThreadListener() { - if (!dmaapThreadListenerIsRunning) { - executor = Executors.newScheduledThreadPool(1); - executor.scheduleWithFixedDelay(new DmaapTopicListenerThread(), 0, - dmaapClientDelayInSeconds, TimeUnit.SECONDS); - dmaapThreadListenerIsRunning = true; - } - } - - private synchronized void stopDmaapThreadListener() { - if (dmaapThreadListenerIsRunning) { - executor.shutdownNow(); - dmaapThreadListenerIsRunning = false; - executor = null; - } - } - - private URI buildURI() { - return UriBuilder.fromUri(dmaapUriPathPrefix) - .scheme(dmaapProtocol) - .host(dmaapHost) - .port(dmaapPort).path(dmaapTopicName) - .path(consumerGroup).path(consumerId).build(); - } - - public void setDmaapProtocol(String dmaapProtocol) { - this.dmaapProtocol = dmaapProtocol; - } - - public void setDmaapUriPathPrefix(String dmaapUriPathPrefix) { - this.dmaapUriPathPrefix = dmaapUriPathPrefix; - } - - public void setDmaapTopicName(String dmaapTopicName) { - this.dmaapTopicName = dmaapTopicName; - } - - public void setConsumerId(String consumerId) { - this.consumerId = consumerId; - } - - public void setConsumerGroup(String consumerGroup) { - this.consumerGroup = consumerGroup; - } - - public void setDmaapClientDelayInSeconds(int dmaapClientDelayInSeconds) { - this.dmaapClientDelayInSeconds = dmaapClientDelayInSeconds; - } - - class DmaapTopicListenerThread implements Runnable { - - @Override - public void run() { - try { - HttpResponse response = httpClient.execute(getRequest); - getCorrelationIdListFromResponse(response).forEach(this::informAboutPnfReadyIfCorrelationIdFound); - } catch (IOException e) { - LOGGER.error("Exception caught during sending rest request to dmaap for listening event topic", e); - } - } - - private List<String> getCorrelationIdListFromResponse(HttpResponse response) throws IOException { - if (response.getStatusLine().getStatusCode() == 200) { - String responseString = EntityUtils.toString(response.getEntity(), "UTF-8"); - if (responseString != null) { - return JsonUtilForCorrelationId.parseJsonToGelAllCorrelationId(responseString); - } - } - return Collections.emptyList(); - } - - private synchronized void informAboutPnfReadyIfCorrelationIdFound(String correlationId) { - Runnable runnable = unregister(correlationId); - if (runnable != null) { - LOGGER.debug("pnf ready event got from dmaap for correlationId: " + correlationId); - runnable.run(); - } - } - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiConnection.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiConnection.java deleted file mode 100644 index 0bb63d5e68..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiConnection.java +++ /dev/null @@ -1,32 +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.pnf.implementation; - -import java.io.IOException; -import java.util.Optional; -import org.onap.aai.domain.yang.Pnf; - -public interface AaiConnection { - - Optional<Pnf> getEntryFor(String correlationId) throws IOException; - - void createEntry(String correlationId, Pnf entry) throws IOException; -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java deleted file mode 100644 index 5fb7a43e00..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/AaiResponse.java +++ /dev/null @@ -1,48 +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.pnf.implementation; - -import java.util.Optional; -import javax.annotation.Nullable; -import javax.validation.constraints.NotNull; - -public enum AaiResponse { - NO_ENTRY(false, false), - ENTRY_NO_IP(true, false), - ENTRY_WITH_IP(true, true); - - private boolean containsInfoAboutPnf; - private boolean containsInfoAboutIp; - - AaiResponse(boolean containsInfoAboutPnf, boolean containsInfoAboutIp) { - this.containsInfoAboutPnf = containsInfoAboutPnf; - this.containsInfoAboutIp = containsInfoAboutIp; - } - - public boolean getContainsInfoAboutPnf() { - return containsInfoAboutPnf; - } - - public boolean getContainsInfoAboutIp() { - return containsInfoAboutIp; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java deleted file mode 100644 index b982a693da..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/pnf/implementation/CheckAaiForCorrelationIdImplementation.java +++ /dev/null @@ -1,50 +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.pnf.implementation; - -import java.io.IOException; -import java.util.Optional; -import org.onap.aai.domain.yang.Pnf; - -public class CheckAaiForCorrelationIdImplementation { - - public AaiResponse check(String correlationId, AaiConnection aaiConnection) throws IOException { - Optional<Pnf> pnf = aaiConnection.getEntryFor(correlationId); - if (!pnf.isPresent()) { - return AaiResponse.NO_ENTRY; - } - - if(extractIp(pnf.get()).isPresent()) { - return AaiResponse.ENTRY_WITH_IP; - } else { - return AaiResponse.ENTRY_NO_IP; - } - } - - private Optional<String> extractIp(Pnf pnf) { - if (pnf.getIpaddressV4Oam() != null) { - return Optional.of(pnf.getIpaddressV4Oam()); - } else { - return Optional.ofNullable(pnf.getIpaddressV6Oam()); - } - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java deleted file mode 100644 index 64d8530df1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/properties/BPMNProperties.java +++ /dev/null @@ -1,57 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei 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.properties; - -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.properties.MsoPropertiesException; -import org.openecomp.mso.properties.MsoPropertiesFactory; - -import java.util.Arrays; -import java.util.List; - -public class BPMNProperties { - - public static String MSO_PROP_APIHANDLER_INFRA = "MSO_PROP_APIHANDLER_INFRA"; - - private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); - - public static String getProperty(String key, String defaultValue) { - String value; - try { - value = new MsoPropertiesFactory().getMsoJavaProperties(MSO_PROP_APIHANDLER_INFRA).getProperty(key, defaultValue); - } catch (MsoPropertiesException e) { - msoLogger.error (MessageEnum.NO_PROPERTIES, "Unknown. Mso Properties ID not found in cache: " - + MSO_PROP_APIHANDLER_INFRA, "BPMN", "", MsoLogger.ErrorCode.DataError, - "Exception - Mso Properties ID not found in cache", e); - return null; - } - msoLogger.debug("Config read for " + MSO_PROP_APIHANDLER_INFRA + " - key:" + key + " value:" + value); - return value; - } - - public static List<String> getResourceSequenceProp(String input) { - String resourceSequence = getProperty("mso.workflow.custom." + input + ".resource.sequence", null); - if (resourceSequence != null) { - return Arrays.asList(resourceSequence.split(",")); - } - return null; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/LocationConstraint.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/LocationConstraint.java deleted file mode 100644 index 4185808b91..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/LocationConstraint.java +++ /dev/null @@ -1,73 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC 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.vfcmodel; - - -/** - * <br> - * <p> - * </p> - * - * @author - * @version ONAP Amsterdam Release 2017-9-6 - */ -public class LocationConstraint { - - /** - * vnf profile id - */ - private String vnfProfileId; - - /** - * location constraints: vimId - */ - private VimLocation locationConstraints; - - /** - * @return Returns the vnfProfileId. - */ - public String getVnfProfileId() { - return vnfProfileId; - } - - /** - * @param vnfProfileId The vnfProfileId to set. - */ - public void setVnfProfileId(String vnfProfileId) { - this.vnfProfileId = vnfProfileId; - } - - - /** - * @return Returns the locationConstraints. - */ - public VimLocation getLocationConstraints() { - return locationConstraints; - } - - - /** - * @param locationConstraints The locationConstraints to set. - */ - public void setLocationConstraints(VimLocation locationConstraints) { - this.locationConstraints = locationConstraints; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java deleted file mode 100644 index 272f3fb71a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NSResourceInputParameter.java +++ /dev/null @@ -1,118 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC 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.vfcmodel; - - -import org.openecomp.mso.logger.MsoLogger; - - -/** - * NS Create Input Parameter For VFC Adapter<br> - * <p> - * </p> - * - * @version ONAP Beijing Release 2018/2/5 - */ -public class NSResourceInputParameter { - - private static final MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA); - - private NsOperationKey nsOperationKey; - - private String nsServiceName; - - private String nsServiceDescription; - - private NsParameters nsParameters; - - private NsScaleParameters nsScaleParameters; - - - - - /** - * @return Returns the nsServiceName. - */ - public String getNsServiceName() { - return nsServiceName; - } - - - /** - * @param nsServiceName The nsServiceName to set. - */ - public void setNsServiceName(String nsServiceName) { - this.nsServiceName = nsServiceName; - } - - - /** - * @return Returns the nsServiceDescription. - */ - public String getNsServiceDescription() { - return nsServiceDescription; - } - - - /** - * @param nsServiceDescription The nsServiceDescription to set. - */ - public void setNsServiceDescription(String nsServiceDescription) { - this.nsServiceDescription = nsServiceDescription; - } - - /** - * @return Returns the nsParameters. - */ - public NsParameters getNsParameters() { - return nsParameters; - } - - /** - * @param nsParameters The nsParameters to set. - */ - public void setNsParameters(NsParameters nsParameters) { - this.nsParameters = nsParameters; - } - - public NsOperationKey getNsOperationKey() { - return nsOperationKey; - } - - public void setNsOperationKey(NsOperationKey nsOperationKey) { - this.nsOperationKey = nsOperationKey; - } - - /** - * @return Returns the nsScaleParameters. - */ - public NsScaleParameters getNsScaleParameters() { - return nsScaleParameters; - } - - /** - * @param nsScaleParameters The nsScaleParameters to set. - */ - public void setNsScaleParameters(NsScaleParameters nsScaleParameters) { - this.nsScaleParameters = nsScaleParameters; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsOperationKey.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsOperationKey.java deleted file mode 100644 index 7783d7ab92..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsOperationKey.java +++ /dev/null @@ -1,141 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC 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.vfcmodel; - - -/** - * The operation key object for NS - * <br> - * <p> - * </p> - * - * @author - * @version ONAP Amsterdam Release 2017-09-15 - */ -public class NsOperationKey { - - /** - * The subscriber id - */ - private String globalSubscriberId; - - /** - * The serviceType - */ - private String serviceType; - - /** - * The service ID - */ - private String serviceId; - - /** - * The Operation ID - */ - private String operationId; - - /** - * the NS template uuid - */ - private String nodeTemplateUUID; - - /** - * @return Returns the globalSubscriberId. - */ - public String getGlobalSubscriberId() { - return globalSubscriberId; - } - - /** - * @param globalSubscriberId The globalSubscriberId to set. - */ - public void setGlobalSubscriberId(String globalSubscriberId) { - this.globalSubscriberId = globalSubscriberId; - } - - /** - * @return Returns the serviceType. - */ - public String getServiceType() { - return serviceType; - } - - /** - * @param serviceType The serviceType to set. - */ - public void setServiceType(String serviceType) { - this.serviceType = serviceType; - } - - /** - * <br> - * - * @return - * @since ONAP Amsterdam Release - */ - public String getServiceId() { - return serviceId; - } - - /** - * <br> - * - * @param serviceId - * @since ONAP Amsterdam Release - */ - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - /** - * <br> - * - * @return - * @since ONAP Amsterdam Release - */ - public String getOperationId() { - return operationId; - } - - /** - * <br> - * - * @param operationId - * @since ONAP Amsterdam Release - */ - public void setOperationId(String operationId) { - this.operationId = operationId; - } - - /** - * @return Returns the nodeTemplateUUID. - */ - public String getNodeTemplateUUID() { - return nodeTemplateUUID; - } - - /** - * @param nodeTemplateUUID The nodeTemplateUUID to set. - */ - public void setNodeTemplateUUID(String nodeTemplateUUID) { - this.nodeTemplateUUID = nodeTemplateUUID; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsParameters.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsParameters.java deleted file mode 100644 index 9d38feeef9..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsParameters.java +++ /dev/null @@ -1,70 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC 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.vfcmodel; - - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * <br> - * <p> - * </p> - * - * @author - * @version ONAP Amsterdam Release 2017-9-6 - */ -public class NsParameters { - - private List<LocationConstraint> locationConstraints; - - private Map<String, Object> additionalParamForNs = new HashMap<String,Object>(); - /** - * @return Returns the locationConstraints. - */ - public List<LocationConstraint> getLocationConstraints() { - return locationConstraints; - } - - /** - * @param locationConstraints The locationConstraints to set. - */ - public void setLocationConstraints(List<LocationConstraint> locationConstraints) { - this.locationConstraints = locationConstraints; - } - - - /** - * @return Returns the additionalParamForNs. - */ - public Map<String, Object> getAdditionalParamForNs() { - return additionalParamForNs; - } - - - /** - * @param additionalParamForNs The additionalParamForNs to set. - */ - public void setAdditionalParamForNs(Map<String, Object> additionalParamForNs) { - this.additionalParamForNs = additionalParamForNs; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsScaleParameters.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsScaleParameters.java deleted file mode 100644 index bdc16195b5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/NsScaleParameters.java +++ /dev/null @@ -1,78 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC 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.vfcmodel; - -import java.util.List; - -/** - * <br> - * <p> - * </p> - * - * @author - * @version ONAP Amsterdam Release 2017-9-26 - */ -public class NsScaleParameters { - - private List<ScaleNsByStepsData> scaleNsByStepsData; - - private String scaleType; - - - private String nsInstanceId; - - /** - * @return Returns the scaleNsByStepsData. - */ - public List<ScaleNsByStepsData> getScaleNsByStepsData() { - return scaleNsByStepsData; - } - - /** - * @param scaleNsByStepsData The scaleNsByStepsData to set. - */ - public void setScaleNsByStepsData(List<ScaleNsByStepsData> scaleNsByStepsData) { - this.scaleNsByStepsData = scaleNsByStepsData; - } - - /** - * @return Returns the scale Type. - */ - public String getScaleType() { - return scaleType; - } - - /** - * @param scaleType The scaleType to set. - */ - public void setScaleType(String scaleType) { - this.scaleType = scaleType; - } - - public String getNsInstanceId() { - return nsInstanceId; - } - - public void setNsInstanceId(String nsInstanceId) { - this.nsInstanceId = nsInstanceId; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java deleted file mode 100644 index a0798c8e4f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleNsByStepsData.java +++ /dev/null @@ -1,91 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC 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.vfcmodel; - - - -/** - * <br> - * <p> - * </p> - * - * @author - * @version ONAP Amsterdam Release 2017-9-26 - */ -public class ScaleNsByStepsData { - - /** - * scaling Direction - */ - private String scalingDirection; - - /** - * aspect ID - */ - private String aspectId; - - /** - * number of Steps - */ - private int numberOfSteps; - - /** - * @return Returns the scalingDirection. - */ - public String getScalingDirection() { - return scalingDirection; - } - - /** - * @param scalingDirection The scalingDirection to set. - */ - public void setScalingDirection(String scalingDirection) { - this.scalingDirection = scalingDirection; - } - - /** - * @return Returns the aspectId. - */ - public String getAspectId() { - return aspectId; - } - - /** - * @param aspectId The aspectId to set. - */ - public void setAspectId(String aspectId) { - this.aspectId = aspectId; - } - - /** - * @return Returns the numberofSteps. - */ - public int getNumberOfSteps() { - return numberOfSteps; - } - - /** - * @param numberOfSteps The numberofSteps to set. - */ - public void setNumberOfSteps(int numberOfSteps) { - this.numberOfSteps = numberOfSteps; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleNsData.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleNsData.java deleted file mode 100644 index 02e42ea994..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleNsData.java +++ /dev/null @@ -1,34 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC. 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.vfcmodel; - - -public class ScaleNsData { - - private ScaleNsByStepsData scaleNsByStepsData; - - public ScaleNsByStepsData getScaleNsByStepsData() { - return scaleNsByStepsData; - } - - public void setScaleNsByStepsData(ScaleNsByStepsData scaleNsByStepsData) { - this.scaleNsByStepsData = scaleNsByStepsData; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleResource.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleResource.java deleted file mode 100644 index 1f49b02569..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/ScaleResource.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC. 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.vfcmodel; - - -public class ScaleResource { - - private String resourceInstanceId; - - private String scaleType; - - private ScaleNsData scaleNsData; - - public String getResourceInstanceId() { - return resourceInstanceId; - } - - public void setResourceInstanceId(String resourceInstanceId) { - this.resourceInstanceId = resourceInstanceId; - } - - public String getScaleType() { - return scaleType; - } - - public void setScaleType(String scaleType) { - this.scaleType = scaleType; - } - - public ScaleNsData getScaleNsData() { - return scaleNsData; - } - - public void setScaleNsData(ScaleNsData scaleNsData) { - this.scaleNsData = scaleNsData; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/VimLocation.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/VimLocation.java deleted file mode 100644 index 67252b4b96..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/vfcmodel/VimLocation.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 CMCC. 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.vfcmodel; - - -/** - * - * <br> - * <p> - * </p> - * - * @author - * @version ONAP Amsterdam Release 2017-10-18 - */ -public class VimLocation { - private String vimId; - - - /** - * @return Returns the vimId. - */ - public String getVimId() { - return vimId; - } - - - /** - * @param vimId The vimId to set. - */ - public void setVimId(String vimId) { - this.vimId = vimId; - } - -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/ServicePluginFactory.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/ServicePluginFactory.java deleted file mode 100644 index 96768bace8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/ServicePluginFactory.java +++ /dev/null @@ -1,443 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2018 Huawei 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.service; - -import java.io.IOException; -import java.net.SocketTimeoutException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -import org.apache.http.HttpResponse; -import org.apache.http.ParseException; -import org.apache.http.client.HttpClient; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import org.apache.http.client.methods.HttpRequestBase; -import org.apache.http.conn.ConnectTimeoutException; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.HttpClientBuilder; -import org.apache.http.util.EntityUtils; -import org.camunda.bpm.engine.runtime.Execution; -import org.openecomp.mso.bpmn.core.PropertyConfiguration; -import org.openecomp.mso.bpmn.core.domain.ServiceDecomposition; -import org.openecomp.mso.bpmn.core.json.JsonUtils; -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -public class ServicePluginFactory { - - // SOTN calculate route - public static final String OOF_Default_EndPoint = "http://192.168.1.223:8443/oof/sotncalc"; - - public static final String Third_SP_Default_EndPoint = "http://192.168.1.223:8443/sp/resourcemgr/querytps"; - - private static final int DEFAULT_TIME_OUT = 60000; - - static JsonUtils jsonUtil = new JsonUtils(); - - private static MsoLogger LOGGER = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); - - private static ServicePluginFactory instance; - - - public static synchronized ServicePluginFactory getInstance() { - if (null == instance) { - instance = new ServicePluginFactory(); - } - return instance; - } - - private ServicePluginFactory() { - - } - - public String test() - { - return ""; - } - - private String getThirdSPEndPoint(){ - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); - if (properties != null) { - String thirdSPEndPoint = properties.get("third-sp-endpoint"); - if(null != thirdSPEndPoint && !thirdSPEndPoint.isEmpty()){ - return thirdSPEndPoint; - } - } - return Third_SP_Default_EndPoint; - } - - private String getOOFCalcEndPoint(){ - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); - if (properties != null) { - String oofCalcEndPoint = properties.get("oof-calc-endpoint"); - if(null != oofCalcEndPoint && !oofCalcEndPoint.isEmpty()){ - return oofCalcEndPoint; - } - } - return OOF_Default_EndPoint; - } - - - public String preProcessService(ServiceDecomposition serviceDecomposition, String uuiRequest) { - - // now only for sotn - if (isSOTN(serviceDecomposition, uuiRequest)) { - // We Need to query the terminalpoint of the VPN by site location - // info - return preProcessSOTNService(serviceDecomposition, uuiRequest); - } - return uuiRequest; - } - - public String doServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) { - // now only for sotn - if (isSOTN(serviceDecomposition, uuiRequest)) { - return doSOTNServiceHoming(serviceDecomposition, uuiRequest); - } - return uuiRequest; - } - - private boolean isSOTN(ServiceDecomposition serviceDecomposition, String uuiRequest) { - // there should be a register platform , we check it very simple here. - return uuiRequest.contains("clientSignal") && uuiRequest.contains("vpnType"); - } - - private String preProcessSOTNService(ServiceDecomposition serviceDecomposition, String uuiRequest) { - Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class); - Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service"); - Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters"); - Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs"); - List<Object> resources = (List<Object>) serviceParametersObject.get("resources"); - // This is a logic for demo , it could not be finalized to community. - String srcLocation = ""; - String dstLocation = ""; - String srcClientSignal = ""; - String dstClientSignal = ""; - // support R2 uuiReq and R1 uuiReq - // logic for R2 uuiRequest params in service level - for (Entry<String, Object> entry : serviceRequestInputs.entrySet()) { - if (entry.getKey().toLowerCase().contains("location")) { - if ("".equals(srcLocation)) { - srcLocation = (String) entry.getValue(); - } else if ("".equals(dstLocation)) { - dstLocation = (String) entry.getValue(); - } - } - if (entry.getKey().toLowerCase().contains("clientsignal")) { - if ("".equals(srcClientSignal)) { - srcClientSignal = (String) entry.getValue(); - } else if ("".equals(dstClientSignal)) { - dstClientSignal = (String) entry.getValue(); - } - } - } - - // logic for R1 uuiRequest, params in resource level - for (Object resource : resources) { - Map<String, Object> resourceObject = (Map<String, Object>) resource; - Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters"); - Map<String, Object> resourceRequestInputs = (Map<String, Object>) resourceParametersObject - .get("requestInputs"); - for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) { - if (entry.getKey().toLowerCase().contains("location")) { - if ("".equals(srcLocation)) { - srcLocation = (String) entry.getValue(); - } else if ("".equals(dstLocation)) { - dstLocation = (String) entry.getValue(); - } - } - if (entry.getKey().toLowerCase().contains("clientsignal")) { - if ("".equals(srcClientSignal)) { - srcClientSignal = (String) entry.getValue(); - } else if ("".equals(dstClientSignal)) { - dstClientSignal = (String) entry.getValue(); - } - } - } - } - - Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources); - // here we put client signal to vpn resource inputs - vpnRequestInputs.put("src-client-signal", srcClientSignal); - vpnRequestInputs.put("dst-client-signal", dstClientSignal); - - // Now we need to query terminal points from SP resourcemgr system. - List<Object> locationTerminalPointList = queryTerminalPointsFromServiceProviderSystem(srcLocation, dstLocation); - Map<String, Object> tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(0); - - serviceRequestInputs.put("inner-src-access-provider-id", tpInfoMap.get("access-provider-id")); - serviceRequestInputs.put("inner-src-access-client-id", tpInfoMap.get("access-client-id")); - serviceRequestInputs.put("inner-src-access-topology-id", tpInfoMap.get("access-topology-id")); - serviceRequestInputs.put("inner-src-access-node-id", tpInfoMap.get("access-node-id")); - serviceRequestInputs.put("inner-src-access-ltp-id", tpInfoMap.get("access-ltp-id")); - tpInfoMap = (Map<String, Object>) locationTerminalPointList.get(1); - - serviceRequestInputs.put("inner-dst-access-provider-id", tpInfoMap.get("access-provider-id")); - serviceRequestInputs.put("inner-dst-access-client-id", tpInfoMap.get("access-client-id")); - serviceRequestInputs.put("inner-dst-access-topology-id", tpInfoMap.get("access-topology-id")); - serviceRequestInputs.put("inner-dst-access-node-id", tpInfoMap.get("access-node-id")); - serviceRequestInputs.put("inner-dst-access-ltp-id", tpInfoMap.get("access-ltp-id")); - - String newRequest = getJsonString(uuiObject); - return newRequest; - } - - private List<Object> queryTerminalPointsFromServiceProviderSystem(String srcLocation, String dstLocation) { - Map<String, String> locationSrc = new HashMap<>(); - locationSrc.put("location", srcLocation); - Map<String, String> locationDst = new HashMap<>(); - locationDst.put("location", dstLocation); - List<Map<String, String>> locations = new ArrayList<>(); - locations.add(locationSrc); - locations.add(locationDst); - List<Object> returnList = new ArrayList<>(); - String reqContent = getJsonString(locations); - String url = getThirdSPEndPoint(); - String responseContent = sendRequest(url, "POST", reqContent); - if (null != responseContent) { - returnList = getJsonObject(responseContent, List.class); - } - return returnList; - } - - private Map<String, Object> getVPNResourceRequestInputs(List<Object> resources) { - for (Object resource : resources) { - Map<String, Object> resourceObject = (Map<String, Object>) resource; - Map<String, Object> resourceParametersObject = (Map<String, Object>) resourceObject.get("parameters"); - Map<String, Object> resourceRequestInputs = (Map<String, Object>) resourceParametersObject - .get("requestInputs"); - for (Entry<String, Object> entry : resourceRequestInputs.entrySet()) { - if (entry.getKey().toLowerCase().contains("vpntype")) { - return resourceRequestInputs; - } - } - } - return null; - } - - public static void main(String args[]){ - String str = "restconf/config/GENERIC-RESOURCE-API:services/service/eca7e542-12ba-48de-8544-fac59303b14e/service-data/networks/network/aec07806-1671-4af2-b722-53c8e320a633/network-data/"; - - int index1 = str.indexOf("/network/"); - int index2 = str.indexOf("/network-data"); - - String str1 = str.substring(index1 + "/network/".length(), index2); - System.out.println(str1); - - } - - private String doSOTNServiceHoming(ServiceDecomposition serviceDecomposition, String uuiRequest) { - // query the route for the service. - Map<String, Object> uuiObject = getJsonObject(uuiRequest, Map.class); - Map<String, Object> serviceObject = (Map<String, Object>) uuiObject.get("service"); - Map<String, Object> serviceParametersObject = (Map<String, Object>) serviceObject.get("parameters"); - Map<String, Object> serviceRequestInputs = (Map<String, Object>) serviceParametersObject.get("requestInputs"); - Map<String, Object> oofQueryObject = new HashMap<>(); - List<Object> resources = (List<Object>) serviceParametersObject.get("resources"); - oofQueryObject.put("src-access-provider-id", serviceRequestInputs.get("inner-src-access-provider-id")); - oofQueryObject.put("src-access-client-id", serviceRequestInputs.get("inner-src-access-client-id")); - oofQueryObject.put("src-access-topology-id", serviceRequestInputs.get("inner-src-access-topology-id")); - oofQueryObject.put("src-access-node-id", serviceRequestInputs.get("inner-src-access-node-id")); - oofQueryObject.put("src-access-ltp-id", serviceRequestInputs.get("inner-src-access-ltp-id")); - oofQueryObject.put("dst-access-provider-id", serviceRequestInputs.get("inner-dst-access-provider-id")); - oofQueryObject.put("dst-access-client-id", serviceRequestInputs.get("inner-dst-access-client-id")); - oofQueryObject.put("dst-access-topology-id", serviceRequestInputs.get("inner-dst-access-topology-id")); - oofQueryObject.put("dst-access-node-id", serviceRequestInputs.get("inner-dst-access-node-id")); - oofQueryObject.put("dst-access-ltp-id", serviceRequestInputs.get("inner-dst-access-ltp-id")); - String oofRequestReq = getJsonString(oofQueryObject); - String url = getOOFCalcEndPoint(); - String responseContent = sendRequest(url, "POST", oofRequestReq); - - List<Object> returnList = new ArrayList<>(); - if (null != responseContent) { - returnList = getJsonObject(responseContent, List.class); - } - // in demo we have only one VPN. no cross VPNs, so get first item. - Map<String, Object> returnRoute = getReturnRoute(returnList); - Map<String, Object> vpnRequestInputs = getVPNResourceRequestInputs(resources); - vpnRequestInputs.putAll(returnRoute); - String newRequest = getJsonString(uuiObject); - return newRequest; - } - - private Map<String, Object> getReturnRoute(List<Object> returnList){ - Map<String, Object> returnRoute = new HashMap<>(); - for(Object returnVpn :returnList){ - Map<String, Object> returnVpnInfo = (Map<String, Object>) returnVpn; - String accessTopoId = (String)returnVpnInfo.get("access-topology-id"); - if("100".equals(accessTopoId)){ - returnRoute.putAll(returnVpnInfo); - } - else if("101".equals(accessTopoId)){ - for(String key : returnVpnInfo.keySet()){ - returnRoute.put("domain1-" + key, returnVpnInfo.get(key)); - } - } - else if("102".equals(accessTopoId)){ - for(String key : returnVpnInfo.keySet()){ - returnRoute.put("domain2-" + key, returnVpnInfo.get(key)); - } - } - else{ - for(String key : returnVpnInfo.keySet()){ - returnRoute.put("domain" + accessTopoId +"-" + key, returnVpnInfo.get(key)); - } - } - } - return returnRoute; - } - - private Map<String, Object> getResourceParams(Execution execution, String resourceCustomizationUuid, - String serviceParameters) { - List<String> resourceList = jsonUtil.StringArrayToList(execution, - (String) JsonUtils.getJsonValue(serviceParameters, "resources")); - // Get the right location str for resource. default is an empty array. - String resourceInputsFromUui = ""; - for (String resource : resourceList) { - String resCusUuid = (String) JsonUtils.getJsonValue(resource, "resourceCustomizationUuid"); - if (resourceCustomizationUuid.equals(resCusUuid)) { - String resourceParameters = JsonUtils.getJsonValue(resource, "parameters"); - resourceInputsFromUui = JsonUtils.getJsonValue(resourceParameters, "requestInputs"); - } - } - Map<String, Object> resourceInputsFromUuiMap = getJsonObject(resourceInputsFromUui, Map.class); - return resourceInputsFromUuiMap; - } - - public static <T> T getJsonObject(String jsonstr, Class<T> type) { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true); - try { - return mapper.readValue(jsonstr, type); - } catch (IOException e) { - LOGGER.error(MessageEnum.RA_NS_EXC, "", "", MsoLogger.ErrorCode.BusinessProcesssError, - "fail to unMarshal json", e); - } - return null; - } - - public static String getJsonString(Object srcObj) { - ObjectMapper mapper = new ObjectMapper(); - mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false); - String jsonStr = null; - try { - jsonStr = mapper.writeValueAsString(srcObj); - } catch (JsonProcessingException e) { - LOGGER.debug("SdcToscaParserException", e); - e.printStackTrace(); - } - return jsonStr; - } - - private static String sendRequest(String url, String methodType, String content) { - - String msbUrl = url; - HttpRequestBase method = null; - HttpResponse httpResponse = null; - - try { - int timeout = DEFAULT_TIME_OUT; - - RequestConfig requestConfig = RequestConfig.custom().setSocketTimeout(timeout).setConnectTimeout(timeout) - .setConnectionRequestTimeout(timeout).build(); - - HttpClient client = HttpClientBuilder.create().build(); - - if ("POST".equals(methodType.toUpperCase())) { - HttpPost httpPost = new HttpPost(msbUrl); - httpPost.setConfig(requestConfig); - httpPost.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON)); - method = httpPost; - } else if ("PUT".equals(methodType.toUpperCase())) { - HttpPut httpPut = new HttpPut(msbUrl); - httpPut.setConfig(requestConfig); - httpPut.setEntity(new StringEntity(content, ContentType.APPLICATION_JSON)); - method = httpPut; - } else if ("GET".equals(methodType.toUpperCase())) { - HttpGet httpGet = new HttpGet(msbUrl); - httpGet.setConfig(requestConfig); - method = httpGet; - } else if ("DELETE".equals(methodType.toUpperCase())) { - HttpDelete httpDelete = new HttpDelete(msbUrl); - httpDelete.setConfig(requestConfig); - method = httpDelete; - } - - // now have no auth - // String userCredentials = - // SDNCAdapterProperties.getEncryptedProperty(Constants.SDNC_AUTH_PROP, - // Constants.DEFAULT_SDNC_AUTH, Constants.ENCRYPTION_KEY); - // String authorization = "Basic " + - // DatatypeConverter.printBase64Binary(userCredentials.getBytes()); - // method.setHeader("Authorization", authorization); - - httpResponse = client.execute(method); - String responseContent = null; - if (null != httpResponse && httpResponse.getEntity() != null) { - try { - responseContent = EntityUtils.toString(httpResponse.getEntity(), "UTF-8"); - } catch (ParseException e) { - e.printStackTrace(); - } catch (IOException e) { - e.printStackTrace(); - } - } - if (null != method) { - method.reset(); - } - method = null; - return responseContent; - - } catch (SocketTimeoutException | ConnectTimeoutException e) { - return null; - - } catch (Exception e) { - return null; - - } finally { - if (httpResponse != null) { - try { - EntityUtils.consume(httpResponse.getEntity()); - } catch (Exception e) { - } - } - if (method != null) { - try { - method.reset(); - } catch (Exception e) { - - } - } - } - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java deleted file mode 100644 index dbf5a57f33..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/service/WorkflowResourceApplication.java +++ /dev/null @@ -1,53 +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.service;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.ws.rs.ApplicationPath;
-import javax.ws.rs.core.Application;
-
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowAsyncResource;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowMessageResource;
-import org.openecomp.mso.bpmn.common.workflow.service.WorkflowResource;
-
-@ApplicationPath("/")
-public class WorkflowResourceApplication extends Application {
- private Set<Object> singletons = new HashSet<>();
- private Set<Class<?>> classes = new HashSet<>();
-
- public WorkflowResourceApplication() {
- singletons.add(new WorkflowResource());
- singletons.add(new WorkflowAsyncResource());
- singletons.add(new WorkflowMessageResource());
- }
-
- @Override
- public Set<Class<?>> getClasses() {
- return classes;
- }
-
- @Override
- public Set<Object> getSingletons() {
- return singletons;
- }
-}
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 deleted file mode 100644 index ee047c9dd5..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java +++ /dev/null @@ -1,370 +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 com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.commons.lang3.StringUtils; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.util.EntityUtils; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.json.JSONObject; -import org.onap.msb.sdk.discovery.common.RouteException; -import org.onap.msb.sdk.httpclient.RestServiceCreater; -import org.onap.msb.sdk.httpclient.msb.MSBServiceClient; -import org.openecomp.mso.bpmn.core.BaseTask; -import org.openecomp.mso.bpmn.core.PropertyConfiguration; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.GenericResourceApi; -import org.openecomp.mso.logger.MessageEnum; -import org.openecomp.mso.logger.MsoLogger; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.openecomp.mso.requestsdb.ResourceOperationStatus; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -public abstract class AbstractSdncOperationTask extends BaseTask { - - private static final Logger logger = LoggerFactory.getLogger(AbstractSdncOperationTask.class); - - private static final String DEFAULT_MSB_IP = "127.0.0.1"; - private static final int DEFAULT_MSB_PORT = 80; - private static final String SDCADAPTOR_INPUTS = "resourceParameters"; - private static final String TOPOLOGY_PROPERTIES = "topology.properties"; - public static final String ONAP_IP = "ONAP_IP"; - - private static final String POST_BODY_TEMPLATE = "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.openecomp.mso/requestsdb\"><soapenv:Header/><soapenv:Body>\n"+ - " <ns:updateResourceOperationStatus>\n"+ - " <errorCode>$errorCode</errorCode>\n"+ - " <jobId>$jobId</jobId>\n"+ - " <operType>$operType</operType>\n"+ - " <operationId>$operationId</operationId>\n"+ - " <progress>$progress</progress>\n"+ - " <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n"+ - " <serviceId>$serviceId</serviceId>\n"+ - " <status>$status</status>\n"+ - " <statusDescription>$statusDescription</statusDescription>\n"+ - " </ns:updateResourceOperationStatus></soapenv:Body></soapenv:Envelope>"; - - private static final String GET_BODY_TEMPLATE = " <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:ns=\"http://org.openecomp.mso/requestsdb\"><soapenv:Header/><soapenv:Body>\n" + - " <ns:getResourceOperationStatus>\n" + - " <operationId>$operationId</operationId>\n" + - " <resourceTemplateUUID>$resourceTemplateUUID</resourceTemplateUUID>\n" + - " <serviceId>$serviceId</serviceId>\n" + - " </ns:getResourceOperationStatus></soapenv:Body></soapenv:Envelope>"; - - - private void updateResOperStatus(ResourceOperationStatus resourceOperationStatus) throws RouteException { - logger.info("AbstractSdncOperationTask.updateResOperStatus begin!"); - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); - String requestsdbEndPoint = properties.get("mso.adapters.openecomp.db.endpoint"); - HttpPost httpPost = new HttpPost(requestsdbEndPoint); - httpPost.addHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk"); - httpPost.addHeader("Content-type", "application/soap+xml"); - String postBody = getPostStringBody(resourceOperationStatus); - httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML)); - httpPost(requestsdbEndPoint, httpPost); - logger.info("AbstractSdncOperationTask.updateResOperStatus end!"); - } - - protected String getPostbody(Object inputEntity) { - ObjectMapper objectMapper = new ObjectMapper(); - String postBody = null; - try { - objectMapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); - postBody = objectMapper.writeValueAsString(inputEntity); - } catch (JsonProcessingException e) { - logger.error(e.getStackTrace().toString()); - } - return postBody; - } - - protected String httpPost(String url, HttpPost httpPost) throws RouteException { - logger.info("AbstractSdncOperationTask.httpPost begin!"); - String result = null; - - String errorMsg; - try(CloseableHttpClient httpClient = HttpClients.createDefault()) { - CloseableHttpResponse closeableHttpResponse = httpClient.execute(httpPost); - result = EntityUtils.toString(closeableHttpResponse.getEntity()); - logger.info("result = {}", result); - if(closeableHttpResponse.getStatusLine().getStatusCode() != 200) { - logger.info("exception: fail for status code = {}", closeableHttpResponse.getStatusLine().getStatusCode()); - throw new RouteException(result, "SERVICE_GET_ERR"); - } - - closeableHttpResponse.close(); - } catch (IOException e) { - errorMsg = url + ":httpPostWithJSON connect faild"; - logger.info("exception: POST_CONNECT_FAILD : {}", errorMsg); - throwsRouteException(errorMsg, e, "POST_CONNECT_FAILD"); - } - - logger.info("AbstractSdncOperationTask.httpPost end!"); - return result; - } - - private static void throwsRouteException(String errorMsg, Exception e, String errorCode) throws RouteException { - String msg = errorMsg + ".errorMsg:" + e.getMessage(); - logger.info("exception: {}", msg); - throw new RouteException(errorMsg, errorCode); - } - - private String getPostStringBody(ResourceOperationStatus resourceOperationStatus) { - logger.info("AbstractSdncOperationTask.getPostStringBody begin!"); - String postBody = POST_BODY_TEMPLATE; - postBody = postBody.replace("$errorCode", resourceOperationStatus.getErrorCode()); - postBody = postBody.replace("$jobId", resourceOperationStatus.getJobId()); - postBody = postBody.replace("$operType", resourceOperationStatus.getOperType()); - postBody = postBody.replace("$operationId", resourceOperationStatus.getOperationId()); - postBody = postBody.replace("$progress", resourceOperationStatus.getProgress()); - postBody = postBody.replace("$resourceTemplateUUID", resourceOperationStatus.getResourceTemplateUUID()); - postBody = postBody.replace("$serviceId", resourceOperationStatus.getServiceId()); - postBody = postBody.replace("$status", resourceOperationStatus.getStatus()); - postBody = postBody.replace("$statusDescription", resourceOperationStatus.getStatusDescription()); - logger.info("AbstractSdncOperationTask.getPostStringBody end!"); - return postBody; - } - - private String getGetStringBody(String serviceId, String operationId, String resourceTemplateUUID) { - logger.info("AbstractSdncOperationTask.getGetStringBody begin!"); - String getBody = GET_BODY_TEMPLATE; - getBody = getBody.replace("$operationId", operationId); - getBody = getBody.replace("$resourceTemplateUUID", resourceTemplateUUID); - getBody = getBody.replace("$serviceId", serviceId); - logger.info("AbstractSdncOperationTask.getGetStringBody end!"); - return getBody; - } - - private ResourceOperationStatus getResourceOperationStatus(String serviceId, String operationId, String resourceTemplateUUID) throws RouteException { - logger.info("AbstractSdncOperationTask.getResourceOperationStatus begin!"); - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties"); - String requestsdbEndPoint = properties.get("mso.adapters.openecomp.db.endpoint"); - HttpPost httpPost = new HttpPost(requestsdbEndPoint); - httpPost.addHeader("Authorization", "Basic QlBFTENsaWVudDpwYXNzd29yZDEk"); - httpPost.addHeader("Content-type", "application/soap+xml"); - String getBody = getGetStringBody(serviceId, operationId, resourceTemplateUUID); - httpPost.setEntity(new StringEntity(getBody, ContentType.APPLICATION_XML)); - String result = httpPost(requestsdbEndPoint, httpPost); - ResourceOperationStatus resourceOperationStatus = getResourceOperationStatusFromXmlString(result); - logger.info("AbstractSdncOperationTask.getResourceOperationStatus end!"); - return resourceOperationStatus; - } - - private ResourceOperationStatus getResourceOperationStatusFromXmlString(String result) { - logger.info("AbstractSdncOperationTask.getResourceOperationStatusFromXmlString begin!"); - ResourceOperationStatus resourceOperationStatus = new ResourceOperationStatus(); - resourceOperationStatus.setErrorCode(getValueByName("errorCode", result)); - resourceOperationStatus.setJobId(getValueByName("jobId", result)); - resourceOperationStatus.setOperType(getValueByName("operType", result)); - resourceOperationStatus.setOperationId(getValueByName("operationId", result)); - resourceOperationStatus.setProgress(getValueByName("progress", result)); - resourceOperationStatus.setResourceTemplateUUID(getValueByName("resourceTemplateUUID", result)); - resourceOperationStatus.setServiceId(getValueByName("serviceId", result)); - resourceOperationStatus.setStatus(getValueByName("status", result)); - resourceOperationStatus.setStatusDescription(getValueByName("statusDescription", result)); - logger.info("AbstractSdncOperationTask.getResourceOperationStatusFromXmlString end!"); - return resourceOperationStatus; - } - - private String getValueByName(String name, String xml) { - if (!StringUtils.isBlank(xml) && xml.contains(name)) { - String start = "<" + name + ">"; - String end = "</" + name + ">"; - return xml.substring(xml.indexOf(start), xml.indexOf(end)).replace(start, ""); - } - return ""; - } - - protected static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); - - @Override - public void execute(DelegateExecution execution) { - logger.info("AbstractSdncOperationTask.execute begin!"); - GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(); - try { - Map<String, String> inputs = getInputs(execution); - - sendRestrequestAndHandleResponse(execution, inputs, genericResourceApiClient); - execution.setVariable("SDNCA_SuccessIndicator", true); - } catch (Exception e) { - logger.info("exception: AbstractSdncOperationTask.fail!"); - logger.error("exception: AbstractSdncOperationTask.fail!:", e); - logger.error(e.getStackTrace().toString()); - execution.setVariable("SDNCA_SuccessIndicator", false); - updateProgress(execution, RequestsDbConstant.Status.ERROR, null, "100", "sendRestrequestAndHandleResponse finished!"); - - } - logger.info("AbstractSdncOperationTask.execute end!"); - } - - protected Map<String, String> getInputs(DelegateExecution execution) { - logger.info("AbstractSdncOperationTask.getInputs begin!"); - Map<String, String> inputs = new HashMap<>(); - String json = (String) execution.getVariable(SDCADAPTOR_INPUTS); - if (!StringUtils.isBlank(json)) { - JSONObject jsonObject = new JSONObject(json); - JSONObject paras = jsonObject.getJSONObject("additionalParamForNs"); - Iterator<String> iterator = paras.keys(); - while (iterator.hasNext()) { - String key = iterator.next(); - inputs.put(key, paras.getString(key)); - } - } - logger.info("AbstractSdncOperationTask.getInputs end!"); - return inputs; - } - - public abstract void sendRestrequestAndHandleResponse(DelegateExecution execution, - Map<String, String> inputs, - GenericResourceApi genericResourceApiClient) throws Exception; - - public void updateProgress(DelegateExecution execution, - String status, - String errorCode, - String progress, - String statusDescription) { - logger.info("AbstractSdncOperationTask.updateProgress begin!"); - String serviceId = (String) execution.getVariable("serviceId"); - serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId; - String operationId = (String) execution.getVariable("operationId"); - String resourceTemplateUUID = (String) execution.getVariable("resourceUUID"); - String resourceTemplateId = (String) execution.getVariable("resourceTemplateId"); - resourceTemplateId = StringUtils.isBlank(resourceTemplateId) ? "" : resourceTemplateUUID; - resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? resourceTemplateId : resourceTemplateUUID; - try { - ResourceOperationStatus resourceOperationStatus = 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); - } - updateResOperStatus(resourceOperationStatus); - logger.info("AbstractSdncOperationTask.updateProgress end!"); - } catch (Exception exception) { - logger.info("exception: AbstractSdncOperationTask.updateProgress fail!"); - logger.error("exception: AbstractSdncOperationTask.updateProgress fail:", exception); - msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " updateProgress catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, exception.getClass().toString()); - } - } - - - protected boolean isSend2SdncDirectly() { - logger.info("AbstractSdncOperationTask.isSend2SdncDirectly begin!"); - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties(TOPOLOGY_PROPERTIES); - if (properties != null) { - String sdncIp = properties.get("sdnc-ip"); - String sdncPort = properties.get("sdnc-port"); - if (!StringUtils.isBlank(sdncIp) && isIp(sdncIp) && !StringUtils.isBlank(sdncPort)) { - logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = true."); - return true; - } - } - logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = false."); - return false; - } - - protected String getSdncIp() { - logger.info("AbstractSdncOperationTask.getSdncIp begin."); - String sdncIp = null; - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); - if (properties != null) { - sdncIp = properties.get("sdnc-ip"); - } - String returnIp = StringUtils.isBlank(sdncIp) || !isIp(sdncIp) ? null : sdncIp; - logger.info("AbstractSdncOperationTask.getSdncIp: sdncIp = {}", returnIp); - return returnIp; - } - - protected String getSdncPort() { - logger.info("AbstractSdncOperationTask.getSdncPort begin."); - String sdncPort = null; - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); - if (properties != null) { - sdncPort = properties.get("sdnc-port"); - } - String returnPort = StringUtils.isBlank(sdncPort) ? null : sdncPort; - logger.info("AbstractSdncOperationTask.getSdncPort: returnPort = {}", sdncPort); - return returnPort; - } - - private GenericResourceApi getGenericResourceApiClient() { - logger.info("AbstractSdncOperationTask.getGenericResourceApiClient begin!"); - String msbIp = System.getenv().get(ONAP_IP); - int msbPort = DEFAULT_MSB_PORT; - Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("topology.properties"); - if (properties != null) { - if (StringUtils.isBlank(msbIp) || !isIp(msbIp)) { - msbIp = properties.get("msb-ip"); - if (StringUtils.isBlank(msbIp)) { - msbIp = getString(properties, "msb.address", DEFAULT_MSB_IP); - } - } - String strMsbPort = properties.get("msb-port"); - if (StringUtils.isBlank(strMsbPort)) { - strMsbPort = getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_PORT)); - } - msbPort = Integer.valueOf(strMsbPort); - } - logger.info("AbstractSdncOperationTask.getGenericResourceApiClient msbIp = " + msbIp + " msbPort = " + msbPort); - MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort); - RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient); - logger.info("AbstractSdncOperationTask.getGenericResourceApiClient end!"); - return restServiceCreater.createService(GenericResourceApi.class); - } - - protected boolean isIp(String msbIp) { - return !StringUtils.isBlank(msbIp) && msbIp.split("\\.").length == 4; - } - - private String getString(Map<String, String> properties, String name, String defaultValue) { - String vlaue = properties.get(name); - try { - if (!StringUtils.isBlank(vlaue)) { - return vlaue; - } - } catch (Exception e) { - msoLogger.error(MessageEnum.GENERAL_EXCEPTION, " getMsbIp catch exception: ", "", this.getTaskName(), MsoLogger.ErrorCode.UnknownError, e.getClass().toString(),e); - } - 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 deleted file mode 100644 index 46a45883ef..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java +++ /dev/null @@ -1,100 +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.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.msb.sdk.discovery.common.RouteException; -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.HeaderUtil; -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.logger.MessageEnum; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Map; - -public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask { - private static final Logger sdncLogger = LoggerFactory.getLogger(SdncNetworkTopologyOperationTask.class); - - - private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation"; - - @Override - public void sendRestrequestAndHandleResponse(DelegateExecution execution, - Map<String, String> inputs, - GenericResourceApi genericResourceApiClient) throws Exception { - sdncLogger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse begin!"); - updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "40", "sendRestrequestAndHandleResponse begin!"); - NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder(); - RpcNetworkTopologyOperationInputEntity inputEntity = builder.build(execution, inputs); - updateProgress(execution, RequestsDbConstant.Status.PROCESSING, null, "50", "RequestBody build finished!"); - RpcNetworkTopologyOperationOutputEntity outputEntity; - if (!isSend2SdncDirectly()) { - outputEntity = genericResourceApiClient.postNetworkTopologyOperation - (HeaderUtil.DefaulAuth, inputEntity).execute().body(); - updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); - saveOutput(execution, outputEntity); - } else { - send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity); - } - updateProgress(execution, RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!"); - sdncLogger.info("SdncNetworkTopologyOperationTask.sendRestrequestAndHandleResponse end!"); - } - - private void send2SdncDirectly(String defaulAuth, - RpcNetworkTopologyOperationInputEntity inputEntity) throws RouteException { - sdncLogger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly begin!"); - String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL; - HttpPost httpPost = new HttpPost(url); - httpPost.addHeader("Authorization", defaulAuth); - httpPost.addHeader("Content-type", "application/json"); - String postBody = getPostbody(inputEntity); - msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", ""); - httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML)); - httpPost(url, httpPost); - sdncLogger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly end!"); - } - - private void saveOutput(DelegateExecution execution, RpcNetworkTopologyOperationOutputEntity output) throws RouteException { - sdncLogger.info("SdncNetworkTopologyOperationTask.saveOutput begin!"); - String responseCode = output.getOutput().getResponseCode(); - if (!"200".equals(responseCode)) { - String processKey = getProcessKey(execution); - int errorCode = Integer.parseInt(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), "100", errorMessage); - sdncLogger.info("exception: SdncNetworkTopologyOperationTask.saveOutput fail!"); - throw new RouteException(); - } - - sdncLogger.info("SdncNetworkTopologyOperationTask.saveOutput end!"); - } - -} 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 deleted file mode 100644 index 28fe802012..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java +++ /dev/null @@ -1,99 +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.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.camunda.bpm.engine.delegate.DelegateExecution; -import org.onap.msb.sdk.discovery.common.RouteException; -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.HeaderUtil; -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.logger.MessageEnum; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.util.Map; - -public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask { - private static final Logger sdncLogger = LoggerFactory.getLogger(SdncServiceTopologyOperationTask.class); - - - private static final String URL = "/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation"; - - @Override - public void sendRestrequestAndHandleResponse(DelegateExecution execution, - Map<String, String> inputs, - GenericResourceApi genericResourceApiClient) throws Exception { - sdncLogger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse begin!"); - updateProgress(execution, null, null, "40", "sendRestrequestAndHandleResponse begin!"); - ServiceRpcInputEntityBuilder builder = new ServiceRpcInputEntityBuilder(); - RpcServiceTopologyOperationInputEntity inputEntity = builder.build(execution, inputs); - updateProgress(execution, null, null, "50", "RequestBody build finished!"); - RpcServiceTopologyOperationOutputEntity outputEntity; - if (!isSend2SdncDirectly()) { - outputEntity = genericResourceApiClient.postServiceTopologyOperation - (HeaderUtil.DefaulAuth, inputEntity).execute().body(); - updateProgress(execution, null, null, "90", "sendRestrequestAndHandleResponse finished!"); - saveOutput(execution, outputEntity); - } else { - send2SdncDirectly(HeaderUtil.DefaulAuth, inputEntity); - } - sdncLogger.info("SdncServiceTopologyOperationTask.sendRestrequestAndHandleResponse end!"); - - } - - private void send2SdncDirectly(String defaulAuth, - RpcServiceTopologyOperationInputEntity inputEntity) throws RouteException { - sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly begin!"); - String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL; - HttpPost httpPost = new HttpPost(url); - httpPost.addHeader("Authorization", defaulAuth); - httpPost.addHeader("Content-type", "application/json"); - String postBody = getPostbody(inputEntity); - msoLogger.info(MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC", ""); - httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML)); - httpPost(url, httpPost); - sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly end!"); - } - - private void saveOutput(DelegateExecution execution, RpcServiceTopologyOperationOutputEntity output) throws Exception { - sdncLogger.info("SdncServiceTopologyOperationTask.saveOutput begin!"); - String responseCode = output.getOutput().getResponseCode(); - if (!"200".equals(responseCode)) { - String processKey = getProcessKey(execution); - int errorCode = Integer.parseInt(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); - sdncLogger.info("exception: SdncServiceTopologyOperationTask.saveOutput fail!"); - throw new RouteException(); - } - sdncLogger.info("SdncServiceTopologyOperationTask.saveOutput end!"); - } -} 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 deleted file mode 100644 index 0e7904c87c..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnOperationClient.java +++ /dev/null @@ -1,118 +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.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.HeaderUtil; -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.logger.MsoLogger; -import org.openecomp.mso.requestsdb.RequestsDatabase; -import org.openecomp.mso.requestsdb.RequestsDbConstant; -import org.openecomp.mso.requestsdb.ResourceOperationStatus; - -import java.util.Map; - -public class SdncUnderlayVpnOperationClient { - - private static final String DEFAULT_MSB_IP = "127.0.0.1"; - private static final int DEFAULT_MSB_PORT = 10081; - private RequestsDatabase requestsDB = RequestsDatabase.getInstance(); - - private String serviceId; - private String operationId; - private String resourceTemplateUUID; - - - private static MsoLogger logger = MsoLogger.getMsoLogger(MsoLogger.Catalog.GENERAL); - - public boolean excute(String msbIp, - int msbPort, - Map<String, String> inputs, - String iServiceID, - String iOperationID, - String resourceTemplateUUID_i){ - serviceId = iServiceID; - operationId = iOperationID; - resourceTemplateUUID = resourceTemplateUUID_i; - GenericResourceApi genericResourceApiClient = getGenericResourceApiClient(msbIp, msbPort); - updateProgress(RequestsDbConstant.Status.PROCESSING, null, "10", "execute begin!"); - return sendRestrequestAndHandleResponse(inputs, genericResourceApiClient); - } - - public boolean sendRestrequestAndHandleResponse(Map<String, String> inputs, GenericResourceApi genericResourceApiClient){ - updateProgress(null, null, "40", "sendRestrequestAndHandleResponse begin!"); - NetworkRpcInputEntityBuilder builder = new NetworkRpcInputEntityBuilder(); - RpcNetworkTopologyOperationInputEntity body = builder.build(null, inputs); - updateProgress(null, null, "50", "RequestBody build finished!"); - //RpcNetworkTopologyOperationOutputEntity networkRpcOutputEntiy = null; - try { - genericResourceApiClient.postNetworkTopologyOperation(HeaderUtil.DefaulAuth ,body).execute().body(); - } catch (Exception e) { - logger.debug("Exception: ", e); - updateProgress(RequestsDbConstant.Status.ERROR, null, null, "sendRestrequestAndHandleResponse exception:" + e.getMessage()); - return false; - } - updateProgress(null, null, "90", "sendRestrequestAndHandleResponse finished!"); - updateProgress(RequestsDbConstant.Status.FINISHED, null, RequestsDbConstant.Progress.ONE_HUNDRED, "execute finished!"); - return true; - } - - private GenericResourceApi getGenericResourceApiClient(String msbIp, int msbPort) { - if (StringUtils.isBlank(msbIp)) { - msbIp = DEFAULT_MSB_IP; - } - if (msbPort <= 0) { - msbPort = DEFAULT_MSB_PORT; - } - MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort); - RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient); - return restServiceCreater.createService(GenericResourceApi.class); - } - - public void updateProgress(String status, - String errorCode, - String progress, - String statusDescription) { - 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 void saveOutput() { - // Not implemented. - } -} 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 deleted file mode 100644 index 3989bad482..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/SdncUnderlayVpnPreprocessTask.java +++ /dev/null @@ -1,48 +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.openecomp.mso.bpmn.core.BaseTask; -import org.openecomp.mso.requestsdb.RequestsDatabase; -import org.openecomp.mso.requestsdb.ResourceOperationStatus; - -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"); - serviceId = StringUtils.isBlank(serviceId) ? (String) execution.getVariable("serviceInstanceId") : serviceId; - String operationId = (String) execution.getVariable("operationId"); - String resourceTemplateUUID = (String) execution.getVariable("resourceTemplateUUID"); - resourceTemplateUUID = StringUtils.isBlank(resourceTemplateUUID) ? (String) execution.getVariable("resourceTemplateId") : 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 deleted file mode 100644 index 8544051bcb..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/GenericResourceApi.java +++ /dev/null @@ -1,48 +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; - -import okhttp3.RequestBody; -import okhttp3.ResponseBody; -import org.onap.msb.sdk.httpclient.annotaion.ServiceHttpEndPoint; -import org.openecomp.mso.bpmn.infrastructure.workflow.serviceTask.client.entity.*; -import retrofit2.Call; -import retrofit2.http.Body; -import retrofit2.http.Header; -import retrofit2.http.POST; - -@ServiceHttpEndPoint(serviceName = "sdnc", serviceVersion = "v1") -public interface GenericResourceApi { - - @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation") - Call<ResponseBody> postNetworkTopologyOperation(@Header("Authorization") String authorization, - @Body RequestBody input); - - @POST("/restconf/operations/GENERIC-RESOURCE-API:network-topology-operation") - Call<RpcNetworkTopologyOperationOutputEntity> postNetworkTopologyOperation(@Header("Authorization") String authorization, - @Body RpcNetworkTopologyOperationInputEntity input); - - @POST("/restconf/operations/GENERIC-RESOURCE-API:service-topology-operation") - Call<RpcServiceTopologyOperationOutputEntity> postServiceTopologyOperation(@Header("Authorization") String authorization, - @Body RpcServiceTopologyOperationInputEntity input); - -} - diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java deleted file mode 100644 index a43eb526a6..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/HeaderUtil.java +++ /dev/null @@ -1,45 +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; - -import java.util.Base64; - -public class HeaderUtil { - - public static final String USER = "admin"; - public static final String PASS = "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"; - public static final String DefaulAuth = getAuthorization(USER, PASS); - - public static String getAuthorization(String usr, String pwd) { - - return "Basic " + base64Encode(usr + ":" + pwd); - } - - private static String base64Encode(String str) { - String base64 = str; - try { - base64 = Base64.getEncoder() - .encodeToString(str.getBytes("utf-8")); - } catch (Exception ex) { - } - return base64; - } -} 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 deleted file mode 100644 index 2f5bda6f46..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/AbstractBuilder.java +++ /dev/null @@ -1,245 +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.builder; - -import org.apache.commons.lang3.StringUtils; -import org.camunda.bpm.engine.delegate.DelegateExecution; -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; - -public abstract class AbstractBuilder<IN, OUT> { - - public static final String OPERATION_TYPE = "operationType"; - public static final String RESOURCE_TYPE = "resourceType"; - - public static enum RequestAction { - CreateNetworkInstance(0, "CreateNetworkInstance"), - ActivateNetworkInstance(1, "ActivateNetworkInstance"), - CreateServiceInstance(2, "CreateServiceInstance"), - DeleteServiceInstance(3, "DeleteServiceInstance"), - DeleteNetworkInstance(4, "DeleteNetworkInstance"), - CreateVnfInstance(5, "CreateVnfInstance"), - ActivateVnfInstance(6, "ActivateVnfInstance"), - DeleteVnfInstance(7, "DeleteVnfInstance"), - CreateVfModuleInstance(8, "CreateVfModuleInstance"), - ActivateVfModuleInstance(9, "ActivateVfModuleInstance"), - DeleteVfModuleInstance(10, "DeleteVfModuleInstance"), - CreateContrailRouteInstance(11, "CreateContrailRouteInstance"), - DeleteContrailRouteInstance(12, "DeleteContrailRouteInstance"), - CreateSecurityZoneInstance(13, "CreateSecurityZoneInstance"), - DeleteSecurityZoneInstance(14, "DeleteSecurityZoneInstance"), - ActivateDCINetworkInstance(15, "ActivateDCINetworkInstance"), - DeActivateDCINetworkInstance(16, "DeActivateDCINetworkInstance"); - - String name; - int value; - - private RequestAction(int value, String name) { - this.value = value; - this.name = name; - } - - public String getName() { - return this.name; - } - - public int getIntValue() { - return this.value; - } - } - - public enum SvcAction { - Reserve(0, "reserve"), - Assign(1, "assign"), - Activate(2, "activate"), - Delete(3, "delete"), - Changeassign(4, "changeassign"), - Changedelete(5, "changedelete"), - Rollback(6, "rollback"), - Deactivate(7, "deactivate"), - Unassign(8, "unassign"), - Create(9, "create"); - - String name; - int value; - - private SvcAction(int value, String name) { - this.value = value; - this.name = name; - } - - public String getName() { - return this.name; - } - - public int getIntValue() { - return this.value; - } - } - - protected String requestId = null; - - abstract OUT build(DelegateExecution execution, IN input) throws Exception; - - protected String getRequestActoin(DelegateExecution execution) { - String action = /*RequestInformation.*/RequestAction.CreateNetworkInstance.getName(); - String operType = (String) execution.getVariable(OPERATION_TYPE); - String resourceType = (String)execution.getVariable(RESOURCE_TYPE); - if (!StringUtils.isBlank(operType)) { - if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) { - if (isOverlay(resourceType)) { - action = /*RequestInformation.*/RequestAction.DeActivateDCINetworkInstance.getName(); - } else if (isUnderlay(resourceType)) { - action = /*RequestInformation.*/RequestAction.DeleteNetworkInstance.getName(); - } else { - action = /*RequestInformation.*/RequestAction.DeleteServiceInstance.getName(); - } - } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) { - if (isOverlay(resourceType)) { - action = /*RequestInformation.*/RequestAction.ActivateDCINetworkInstance.getName(); - } else if (isUnderlay(resourceType)) { - action = /*RequestInformation.*/RequestAction.CreateNetworkInstance.getName(); - } else { - action = /*RequestInformation.*/RequestAction.CreateServiceInstance.getName(); - } - } - } - return action; - } - - private boolean isOverlay(String resourceType) { - return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("overlay"); - } - - private boolean isUnderlay(String resourceType) { - return !StringUtils.isBlank(resourceType) && resourceType.toLowerCase().contains("underlay"); - } - - protected String getSvcAction(DelegateExecution execution) { - String action = /*SdncRequestHeader.*/SvcAction.Create.getName(); - String operType = (String) execution.getVariable(OPERATION_TYPE); - String resourceType = (String)execution.getVariable(RESOURCE_TYPE); - if (!StringUtils.isBlank(operType)) { - if (RequestsDbConstant.OperationType.DELETE.equalsIgnoreCase(operType)) { - if (isOverlay(resourceType)) { - action = /*SdncRequestHeader.*/SvcAction.Deactivate.getName(); - } else if (isUnderlay(resourceType)) { - action = /*SdncRequestHeader.*/SvcAction.Delete.getName(); - } else { - action = /*SdncRequestHeader.*/SvcAction.Unassign.getName(); - } - } else if (RequestsDbConstant.OperationType.CREATE.equalsIgnoreCase(operType)) { - if (isOverlay(resourceType)) { - action = /*SdncRequestHeader.*/SvcAction.Activate.getName(); - } else if (isUnderlay(resourceType)) { - action = /*SdncRequestHeader.*/SvcAction.Create.getName(); - } else { - action = /*SdncRequestHeader.*/SvcAction.Assign.getName(); - } - } - } - 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 OnapModelInformationEntity getOnapServiceModelInformationEntity(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("serviceModelName"); - onapModelInformationEntity.setModelInvariantUuid(modelInvariantUuid); - onapModelInformationEntity.setModelVersion(modelVersion); - onapModelInformationEntity.setModelUuid(modelUuid); - onapModelInformationEntity.setModelName(modelName); - } - return onapModelInformationEntity; - } - - protected OnapModelInformationEntity getOnapNetworkModelInformationEntity(DelegateExecution execution) { - OnapModelInformationEntity onapModelInformationEntity = new OnapModelInformationEntity(); - { - String modelInvariantUuid = (String) execution.getVariable("resourceInvariantUUID"); - String modelVersion = (String) execution.getVariable("modelVersion"); - String modelUuid = (String) execution.getVariable("resourceUUID"); - String modelName = (String) execution.getVariable("resourceType"); - 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("serviceInstanceId")); - serviceInformationEntity.setSubscriptionServiceType((String) execution.getVariable("serviceType")); - serviceInformationEntity.setOnapModelInformation(getOnapServiceModelInformationEntity(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 deleted file mode 100644 index c558247dea..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/NetworkRpcInputEntityBuilder.java +++ /dev/null @@ -1,91 +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.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; - -public class NetworkRpcInputEntityBuilder extends AbstractBuilder<Map<String, String>, RpcNetworkTopologyOperationInputEntity> { - - @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, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) { - NetworkRequestInputEntity networkRequestInputEntity = new NetworkRequestInputEntity(); - { - NetworkInputPaarametersEntity networkInputPaarametersEntity = new NetworkInputPaarametersEntity(); - { - List<ParamEntity> paramEntityList = getParamEntities(inputs); - networkInputPaarametersEntity.setParamList(paramEntityList); - } - networkRequestInputEntity.setNetworkInputPaarameters(networkInputPaarametersEntity); - } - networkTopologyOperationInputEntity.setNetworkRequestInput(networkRequestInputEntity); - } - - private void loadRequestInformationEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) { - RequestInformationEntity requestInformationEntity = getRequestInformationEntity(execution); - networkTopologyOperationInputEntity.setRequestInformation(requestInformationEntity); - } - - private void loadSdncRequestHeaderEntity(NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity, DelegateExecution execution) { - SdncRequestHeaderEntity sdncRequestHeaderEntity = new SdncRequestHeaderEntity(); - { - sdncRequestHeaderEntity.setSvcRequestId(getRequestId(execution)); - sdncRequestHeaderEntity.setSvcAction(getSvcAction(execution)); - } - networkTopologyOperationInputEntity.setSdncRequestHeader(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(); - { - loadSdncRequestHeaderEntity(networkTopologyOperationInputEntity, execution); - loadRequestInformationEntity(networkTopologyOperationInputEntity, execution); - loadServiceInformation(networkTopologyOperationInputEntity, execution); - loadNetworkInformationEntity(execution, networkTopologyOperationInputEntity); - loadNetwrokRequestInputEntity(inputs, networkTopologyOperationInputEntity); - } - return networkTopologyOperationInputEntity; - } - - private void loadNetworkInformationEntity(DelegateExecution execution, NetworkTopologyOperationInputEntity networkTopologyOperationInputEntity) { - NetworkInformationEntity networkInformationEntity = new NetworkInformationEntity(); - { - OnapModelInformationEntity onapModelInformationEntity = getOnapNetworkModelInformationEntity(execution); - networkInformationEntity.setOnapModelInformation(onapModelInformationEntity); - } - networkTopologyOperationInputEntity.setNetworkInformation(networkInformationEntity); - } -} 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 deleted file mode 100644 index d451c3ef02..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/builder/ServiceRpcInputEntityBuilder.java +++ /dev/null @@ -1,80 +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.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; - -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(getSvcAction(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 deleted file mode 100644 index ce92e31003..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInformationEntity.java +++ /dev/null @@ -1,58 +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; - -public class NetworkInformationEntity { - @JsonProperty("GENERIC-RESOURCE-API:network-id") - private String networkId; - - @JsonProperty("GENERIC-RESOURCE-API:network-type") - private String networkType; - - @JsonProperty("GENERIC-RESOURCE-API:onap-model-information") - private OnapModelInformationEntity onapModelInformation; - - public String getNetworkId() { - return networkId; - } - - public void setNetworkId(String networkId) { - this.networkId = networkId; - } - - public String getNetworkType() { - return networkType; - } - - public void setNetworkType(String networkType) { - this.networkType = networkType; - } - - public OnapModelInformationEntity getOnapModelInformation() { - return onapModelInformation; - } - - 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/NetworkInputPaarametersEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputPaarametersEntity.java deleted file mode 100644 index e455bdb4c8..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkInputPaarametersEntity.java +++ /dev/null @@ -1,38 +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; - -import java.util.List; - -public class NetworkInputPaarametersEntity { - public List<ParamEntity> getParamList() { - return paramList; - } - - public void setParamList(List<ParamEntity> paramList) { - this.paramList = paramList; - } - - @JsonProperty("GENERIC-RESOURCE-API:param") - private List<ParamEntity> paramList; -} 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 deleted file mode 100644 index b0733f70c4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkRequestInputEntity.java +++ /dev/null @@ -1,80 +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; - -public class NetworkRequestInputEntity { - @JsonProperty("GENERIC-RESOURCE-API:network-name") - private String networkName; - - @JsonProperty("GENERIC-RESOURCE-API:tenant") - private String tenant; - - @JsonProperty("GENERIC-RESOURCE-API:aic-cloud-region") - private String aicCloudRegion; - - @JsonProperty("GENERIC-RESOURCE-API:aic-clli") - private String aicClli; - - @JsonProperty("GENERIC-RESOURCE-API:network-input-parameters") - private NetworkInputPaarametersEntity networkInputPaarameters; - - public String getNetworkName() { - return networkName; - } - - public void setNetworkName(String networkName) { - this.networkName = networkName; - } - - public String getTenant() { - return tenant; - } - - public void setTenant(String tenant) { - this.tenant = tenant; - } - - public String getAicCloudRegion() { - return aicCloudRegion; - } - - public void setAicCloudRegion(String aicCloudRegion) { - this.aicCloudRegion = aicCloudRegion; - } - - public String getAicClli() { - return aicClli; - } - - public void setAicClli(String aicClli) { - this.aicClli = aicClli; - } - - public NetworkInputPaarametersEntity getNetworkInputPaarameters() { - return networkInputPaarameters; - } - - public void setNetworkInputPaarameters(NetworkInputPaarametersEntity networkInputPaarameters) { - this.networkInputPaarameters = networkInputPaarameters; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkResponseInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkResponseInformationEntity.java deleted file mode 100644 index c8b2a2d182..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkResponseInformationEntity.java +++ /dev/null @@ -1,47 +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; - -public class NetworkResponseInformationEntity { - @JsonProperty("GENERIC-RESOURCE-API:instance-id") - private String instanceId; - - @JsonProperty("GENERIC-RESOURCE-API:object-path") - private String objectPath; - - public String getInstanceId() { - return instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public String getObjectPath() { - return objectPath; - } - - public void setObjectPath(String objectPath) { - this.objectPath = objectPath; - } -} 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 deleted file mode 100644 index 3c776ebec3..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationInputEntity.java +++ /dev/null @@ -1,80 +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; - -public class NetworkTopologyOperationInputEntity { - @JsonProperty("GENERIC-RESOURCE-API:sdnc-request-header") - private SdncRequestHeaderEntity sdncRequestHeader; - - @JsonProperty("GENERIC-RESOURCE-API:request-information") - private RequestInformationEntity requestInformation; - - @JsonProperty("GENERIC-RESOURCE-API:service-information") - private ServiceInformationEntity serviceInformation; - - @JsonProperty("GENERIC-RESOURCE-API:network-information") - private NetworkInformationEntity networkInformation; - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index b13df33291..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/NetworkTopologyOperationOutputEntity.java +++ /dev/null @@ -1,91 +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; - -public class NetworkTopologyOperationOutputEntity { - @JsonProperty("GENERIC-RESOURCE-API:svc-request-id") - private String svcRequestId; - - @JsonProperty("GENERIC-RESOURCE-API:response-code") - private String responseCode; - - @JsonProperty("GENERIC-RESOURCE-API:response-message") - private String responseMessage; - - @JsonProperty("GENERIC-RESOURCE-API:ack-final-indicator") - private String ackFinalIndicator; - - @JsonProperty("GENERIC-RESOURCE-API:network-response-information") - private NetworkResponseInformationEntity networkResponseInformation; - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index 6580efea4d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/OnapModelInformationEntity.java +++ /dev/null @@ -1,80 +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; - -public class OnapModelInformationEntity { - @JsonProperty("GENERIC-RESOURCE-API:model-invariant-uuid") - private String modelInvariantUuid; - - @JsonProperty("GENERIC-RESOURCE-API:model-customization-uuid") - private String modelCustomizationUuid; - - @JsonProperty("GENERIC-RESOURCE-API:model-uuid") - private String modelUuid; - - @JsonProperty("GENERIC-RESOURCE-API:model-version") - private String modelVersion; - - @JsonProperty("GENERIC-RESOURCE-API: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/ParamEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ParamEntity.java deleted file mode 100644 index 3b9241b93d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ParamEntity.java +++ /dev/null @@ -1,47 +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; - -public class ParamEntity { - @JsonProperty("GENERIC-RESOURCE-API:name") - private String name; - - @JsonProperty("GENERIC-RESOURCE-API:value") - private String value; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java deleted file mode 100644 index 934a1978b4..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RequestInformationEntity.java +++ /dev/null @@ -1,91 +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; - -public class RequestInformationEntity { - public String getRequestId() { - return requestId; - } - - public void setRequestId(String requestId) { - this.requestId = requestId; - } - - public String getRequestAction() { - return requestAction; - } - - public void setRequestAction(String requestAction) { - this.requestAction = requestAction; - } - - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public String getNotificationUrl() { - return notificationUrl; - } - - public void setNotificationUrl(String notificationUrl) { - this.notificationUrl = notificationUrl; - } - - public String getOrderUnmber() { - return orderUnmber; - } - - public void setOrderUnmber(String orderUnmber) { - this.orderUnmber = orderUnmber; - } - - public String getOrerVersion() { - return orerVersion; - } - - public void setOrerVersion(String orerVersion) { - this.orerVersion = orerVersion; - } - - @JsonProperty("GENERIC-RESOURCE-API:request-id") - private String requestId; - - @JsonProperty("GENERIC-RESOURCE-API:request-action") - private String requestAction; - - @JsonProperty("GENERIC-RESOURCE-API:source") - private String source; - - @JsonProperty("GENERIC-RESOURCE-API:notification-url") - private String notificationUrl; - - @JsonProperty("GENERIC-RESOURCE-API:order-number") - private String orderUnmber; - - @JsonProperty("GENERIC-RESOURCE-API:order-version") - private String orerVersion; -} 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 deleted file mode 100644 index 914bbf5dbe..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationInputEntity.java +++ /dev/null @@ -1,36 +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; - -public class RpcNetworkTopologyOperationInputEntity { - public NetworkTopologyOperationInputEntity getInput() { - return input; - } - - public void setInput(NetworkTopologyOperationInputEntity input) { - this.input = input; - } - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index 92312db24a..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcNetworkTopologyOperationOutputEntity.java +++ /dev/null @@ -1,36 +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; - -public class RpcNetworkTopologyOperationOutputEntity { - public NetworkTopologyOperationOutputEntity getOutput() { - return output; - } - - public void setOutput(NetworkTopologyOperationOutputEntity output) { - this.output = output; - } - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index 05eedc79b1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationInputEntity.java +++ /dev/null @@ -1,36 +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; - -public class RpcServiceTopologyOperationInputEntity { - public ServiceTopologyOperationInputEntity getServiceTopologyOperationInputEntity() { - return serviceTopologyOperationInputEntity; - } - - public void setServiceTopologyOperationInputEntity(ServiceTopologyOperationInputEntity serviceTopologyOperationInputEntity) { - this.serviceTopologyOperationInputEntity = serviceTopologyOperationInputEntity; - } - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index 2e0362bdd2..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/RpcServiceTopologyOperationOutputEntity.java +++ /dev/null @@ -1,36 +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; - -public class RpcServiceTopologyOperationOutputEntity { - @JsonProperty("GENERIC-RESOURCE-API: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/SdncRequestHeaderEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/SdncRequestHeaderEntity.java deleted file mode 100644 index 49d3d52911..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/SdncRequestHeaderEntity.java +++ /dev/null @@ -1,59 +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; - -public class SdncRequestHeaderEntity { - @JsonProperty("GENERIC-RESOURCE-API:svc-request-id") - private String svcRequestId; - - @JsonProperty("GENERIC-RESOURCE-API:svc-action") - private String svcAction; - - @JsonProperty("GENERIC-RESOURCE-API:svc-notification-url") - private String svcNotificationUrl; - - public String getSvcRequestId() { - return svcRequestId; - } - - public void setSvcRequestId(String svcRequestId) { - this.svcRequestId = svcRequestId; - } - - public String getSvcAction() { - return svcAction; - } - - public void setSvcAction(String svcAction) { - this.svcAction = svcAction; - } - - public String getSvcNotificationUrl() { - return svcNotificationUrl; - } - - public void setSvcNotificationUrl(String svcNotificationUrl) { - this.svcNotificationUrl = svcNotificationUrl; - } - -} 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 deleted file mode 100644 index f1b1561a4f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInformationEntity.java +++ /dev/null @@ -1,91 +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; - -public class ServiceInformationEntity { - @JsonProperty("GENERIC-RESOURCE-API:service-id") - private String serviceId; - - @JsonProperty("GENERIC-RESOURCE-API:subscription-service-type") - private String subscriptionServiceType; - - @JsonProperty("GENERIC-RESOURCE-API:onap-model-information") - private OnapModelInformationEntity onapModelInformation; - - @JsonProperty("GENERIC-RESOURCE-API:service-instance-id") - private String serviceInstanceId; - - @JsonProperty("GENERIC-RESOURCE-API:global-customer-id") - private String globalCustomerId; - - @JsonProperty("GENERIC-RESOURCE-API:subscriber-name") - private String subscriberName; - - public String getServiceId() { - return serviceId; - } - - public void setServiceId(String serviceId) { - this.serviceId = serviceId; - } - - public String getSubscriptionServiceType() { - return subscriptionServiceType; - } - - public void setSubscriptionServiceType(String subscriptionServiceType) { - this.subscriptionServiceType = subscriptionServiceType; - } - - public OnapModelInformationEntity getOnapModelInformation() { - return onapModelInformation; - } - - public void setOnapModelInformation(OnapModelInformationEntity onapModelInformation) { - this.onapModelInformation = onapModelInformation; - } - - public String getServiceInstanceId() { - return serviceInstanceId; - } - - public void setServiceInstanceId(String serviceInstanceId) { - this.serviceInstanceId = serviceInstanceId; - } - - public String getGlobalCustomerId() { - return globalCustomerId; - } - - public void setGlobalCustomerId(String globalCustomerId) { - this.globalCustomerId = globalCustomerId; - } - - public String getSubscriberName() { - return subscriberName; - } - - public void setSubscriberName(String subscriberName) { - this.subscriberName = subscriberName; - } -} 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 deleted file mode 100644 index f708aa6b18..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceInputParametersEntity.java +++ /dev/null @@ -1,38 +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; - -import java.util.List; - -public class ServiceInputParametersEntity { - public List<ParamEntity> getParamList() { - return paramList; - } - - public void setParamList(List<ParamEntity> paramList) { - this.paramList = paramList; - } - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index bf88fb9f20..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceRequestInputEntity.java +++ /dev/null @@ -1,48 +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; - -public class ServiceRequestInputEntity { - - @JsonProperty("GENERIC-RESOURCE-API:service-instance-name") - private String serviceInstanceName; - - @JsonProperty("GENERIC-RESOURCE-API: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/ServiceResponseInformationEntity.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceResponseInformationEntity.java deleted file mode 100644 index 090aaf6ed1..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceResponseInformationEntity.java +++ /dev/null @@ -1,47 +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; - -public class ServiceResponseInformationEntity { - @JsonProperty("GENERIC-RESOURCE-API:instance-id") - private String instanceId; - - @JsonProperty("GENERIC-RESOURCE-API:object-path") - private String objectPath; - - public String getInstanceId() { - return instanceId; - } - - public void setInstanceId(String instanceId) { - this.instanceId = instanceId; - } - - public String getObjectPath() { - return objectPath; - } - - public void setObjectPath(String objectPath) { - this.objectPath = objectPath; - } -} 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 deleted file mode 100644 index 6e399dc43d..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationInputEntity.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.client.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class ServiceTopologyOperationInputEntity { - @JsonProperty("GENERIC-RESOURCE-API:sdnc-request-header") - private SdncRequestHeaderEntity sdncRequestHeader; - - @JsonProperty("GENERIC-RESOURCE-API:request-information") - private RequestInformationEntity requestInformation; - - @JsonProperty("GENERIC-RESOURCE-API:service-information") - private ServiceInformationEntity serviceInformation; - - @JsonProperty("GENERIC-RESOURCE-API: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 deleted file mode 100644 index 8ad6a5347f..0000000000 --- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/client/entity/ServiceTopologyOperationOutputEntity.java +++ /dev/null @@ -1,80 +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; - -public class ServiceTopologyOperationOutputEntity { - @JsonProperty("GENERIC-RESOURCE-API:svc-request-id") - private String svcRequestId; - - @JsonProperty("GENERIC-RESOURCE-API:response-code") - private String responseCode; - - @JsonProperty("GENERIC-RESOURCE-API:response-message") - private String responseMessage; - - @JsonProperty("GENERIC-RESOURCE-API:ack-final-indicator") - private String ackFinalIndicator; - - @JsonProperty("GENERIC-RESOURCE-API: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; - } -} |