company: 'Ericsson'
id: 'byungwoojun'
timezone: ''
- - name: 'Hui Deng'
- email: 'denghui12@huawei.com'
- company: 'Huawei'
- id: 'denghui02'
- timezone: 'China/Beijing'
- name: 'DeWayne Filppi'
email: 'dewayne@cloudify.co'
company: 'Cloudify'
company: 'VMware'
id: 'ethanlynnl'
timezone: 'France/Lannion'
- - name: 'Jie Feng'
- email: 'feng.jie2@zte.com.cn'
- company: 'ZTE'
- id: 'fengjie'
- timezone: ''
- - name: 'Fu Jinhua'
- email: 'fu.jinhua@zte.com.cn'
- company: 'ZTE'
- id: 'fujinhua'
- timezone: ''
- - name: 'maopeng zhang'
- email: 'zhang.maopeng1@zte.com.cn'
- company: 'ZTE'
- id: 'maopengzhang'
- timezone: 'China/Nanjing'
- - name: 'Bin Hou'
- email: 'bin.hou@huawei.com'
- company: 'Huawei'
- id: 'piggie-hou'
- timezone: 'China/Beijing'
- name: 'Rob Daugherty'
email: 'rd472p@att.com'
company: 'ATT'
id: 'rd472p'
timezone: ''
- - name: 'jackie tian'
- email: 'tian.yi@zte.com.cn'
- company: 'ZTE'
- id: 'tianyi'
- timezone: 'China/Beijing'
- name: 'Chengli Wang'
email: 'wangchengli@chinamobile.com'
company: 'China Mobile'
name: 'Yuanwei Yang'
name: 'Christophe Closset'
name: 'Claude Noshpitz'
+ name: 'maopeng zhang'
+ name: 'Bin Hou'
+ name: 'Fu Jinhua'
+ name: 'Jie Feng'
+ name: 'jackie tian'
+ name: 'Deng Hui'
link: 'https://lists.onap.org/pipermail/onap-tsc/2018-May/004802.html'
- type: 'addition'
name: 'Marcus Williams'
templateId = stemplate.getId();
}
}
- List<Input> sinputs = new ArrayList<Input>();
+ List<Input> sinputs = new ArrayList<>();
for (Map.Entry<String, ? extends Object> entry : inputs.entrySet()) {
Input inp = new InputImpl(entry.getKey(), entry.getValue().toString(), "");
sinputs.add(inp);
try {\r
jsonStr = mapper.writeValueAsString(valueMap);\r
} catch(JsonProcessingException e) {\r
-\r
- e.printStackTrace();\r
+ LOGGER.error("JsonProcessingException", e);\r
}\r
return jsonStr;\r
}\r
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceFeature;
-//import org.openecomp.mso.adapters.sdnc.impl.MsoLogger;
import org.openecomp.mso.logger.MsoLogger;
import org.openecomp.mso.logger.MessageEnum;
URL wsdlUrl = null;
try {
wsdlUrl = Thread.currentThread().getContextClassLoader().getResource("main/resources/SDNCAdapter.wsdl");
- //wsdlUrl = SDNCAdapterService.class.getClassLoader().getResource("SDNCAdapter.wsdl");
+
} catch (Exception e) {
logger.error(MessageEnum.RA_WSDL_NOT_FOUND, "SDNCAdapter.wsdl", "", "", MsoLogger.ErrorCode.DataError, "Exception - WSDL not found", e);
}
}
String bpelUrl;
- /*
- * TODO Hibernate
- * try {
- * bpelUrl = RequestsDatabase.getBpelUrl(reqId);
- * }
- * catch (Exception e)
- * {
- * logger.error("Unable to get SDNC_CALLBACK_URL from ActiveRequests, using default for reqid:" + reqId, e);
- * }
- */
bpelUrl = SDNCAdapterPortTypeImpl.getProperty (Constants.BPEL_URL_PROP, Constants.DEFAULT_BPEL_URL,msoPropertiesFactory);
if (bpelUrl == null) {
}
} catch(MsoPropertiesException e) {
LOGGER.error("Get msb properties failed",e);
- e.printStackTrace();
}
return "http://" + msbIp + ":" + msbPort;
}
if (inputs == null) {
// Create an empty set of inputs
- inputs = new HashMap<String,String>();
+ inputs = new HashMap<>();
LOGGER.debug("inputs == null - setting to empty");
} else {
this.sendMapToDebug(inputs);
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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====================================================
-*/
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
-
- <groupId>org.onap.so</groupId>
- <artifactId>aria-client</artifactId>
- <parent>
- <groupId>org.onap.so</groupId>
- <artifactId>aria</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>org.glassfish.jersey.core</groupId>
- <artifactId>jersey-client</artifactId>
- <version>2.26-b03</version>
- </dependency>
- <dependency>
- <groupId>org.glassfish.jersey.media</groupId>
- <artifactId>jersey-media-json-jackson1</artifactId>
- <version>2.26-b03</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-core</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-annotations</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.core</groupId>
- <artifactId>jackson-databind</artifactId>
- <version>2.8.7</version>
- </dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-base</artifactId>
- <version>2.9.2</version>
- </dependency>
-<dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-json-provider</artifactId>
- <version>2.9.2</version>
-</dependency>
- <dependency>
- <groupId>com.fasterxml.jackson.jaxrs</groupId>
- <artifactId>jackson-jaxrs-providers</artifactId>
- <version>2.9.2</version>
- <type>pom</type>
- </dependency>
- <dependency>
- <groupId>org.apache.httpcomponents</groupId>
- <artifactId>httpclient</artifactId>
- </dependency>
- </dependencies>
-
-</project>
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-import com.gigaspaces.aria.rest.client.exceptions.StorageException;\r
-import com.gigaspaces.aria.rest.client.exceptions.ValidationException;\r
-\r
-import java.util.List;\r
-import java.util.Map;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface AriaClient {\r
-\r
- /**\r
- * Installs a service template\r
- *\r
- * @param template\r
- * @throws ValidationException\r
- * @throws StorageException\r
- */\r
- public void install_service_template(ServiceTemplate template)throws ValidationException, StorageException, Exception;\r
-\r
- /**\r
- * Validate a service template\r
- * @param template\r
- * @return\r
- */\r
- public ValidationResult validate_service_template(ServiceTemplate template)throws Exception;\r
-\r
- /**\r
- * Fetch a list of stored service templates\r
- *\r
- * @return\r
- */\r
- public List<? extends ServiceTemplate> list_service_templates();\r
-\r
- /**\r
- * Delete an existing template\r
- *\r
- * @param template_id\r
- * @throws IllegalArgumentException\r
- */\r
- public void delete_service_template(int template_id) throws IllegalArgumentException, Exception;\r
-\r
- /**\r
- * Returns a list of node templates for a given service template\r
- * @param template_id\r
- * @return\r
- */\r
- List<? extends NodeTemplate> list_nodes(int template_id);\r
-\r
- /**\r
- * Fetch a given node template\r
- *\r
- * @param node_id\r
- * @return\r
- * @throws IllegalArgumentException\r
- */\r
- public NodeTemplate get_node( int node_id) throws IllegalArgumentException;\r
-\r
- /**\r
- * List all services\r
- *\r
- * @return\r
- */\r
- public List<? extends Service> list_services();\r
-\r
- /**\r
- * Fetch the specified service\r
- *\r
- * @param service_id\r
- * @return\r
- * @throws IllegalArgumentException\r
- */\r
- public Service get_service(int service_id) throws IllegalArgumentException;\r
-\r
- /**\r
- * Fetch the outputs of the specified service\r
- *\r
- * @param service_id\r
- * @return\r
- * @throws IllegalArgumentException\r
- */\r
- public List<? extends Output> list_service_outputs(int service_id) throws IllegalArgumentException;\r
-\r
- /**\r
- * Fetch the inputs of the specified service\r
- *\r
- * @param service_id\r
- * @return\r
- * @throws IllegalArgumentException\r
- */\r
- public List<? extends Input> list_service_inputs(int service_id) throws IllegalArgumentException;\r
-\r
- /**\r
- * Create a service\r
- *\r
- * @param template_id\r
- * @param service_name\r
- * @param inputs\r
- * @throws Exception\r
- */\r
- public void create_service(int template_id, String service_name, List<Input> inputs)throws Exception;\r
-\r
- /**\r
- * Delete the specified service\r
- *\r
- * @param service_id\r
- * @throws IllegalArgumentException\r
- */\r
- public void delete_service(int service_id)throws Exception;\r
-\r
- /**\r
- * List workflows for the provided service\r
- *\r
- * @param service_id\r
- * @return\r
- * @throws IllegalArgumentException\r
- */\r
- public List<? extends Workflow> list_workflows(int service_id)throws IllegalArgumentException;\r
-\r
- /**\r
- * Fetch the specified workflow\r
- *\r
- * @param workflow_id\r
- * @return the requested Workflow\r
- * @throws IllegalArgumentException when the workflow_id doesn't exist\r
- */\r
- public Workflow get_workflow(int workflow_id)throws IllegalArgumentException;\r
-\r
- /**\r
- * List all executions\r
- *\r
- * @return\r
- * @throws Exception\r
- */\r
- public List<? extends Execution> list_executions()throws Exception;\r
-\r
- /**\r
- * List executions for provided service\r
- *\r
- * @param service_id\r
- * @return\r
- * @throws Exception\r
- */\r
- public List<? extends Execution> list_executions(int service_id)throws Exception;\r
-\r
- /**\r
- * Fetch the specified execution\r
- *\r
- * @param execution_id\r
- * @return\r
- * @throws IllegalArgumentException\r
- */\r
- public Execution get_execution(int execution_id)throws IllegalArgumentException;\r
-\r
- /**\r
- * Starts an execution\r
- *\r
- * @param service_id\r
- * @param workflow_name\r
- * @param details\r
- * @return the execution id\r
- * @throws Exception\r
- */\r
- public int start_execution(int service_id, String workflow_name, ExecutionDetails details)throws Exception;\r
-\r
- /**\r
- * Resumes an interrupted execution\r
- *\r
- * @param execution_id\r
- * @param details\r
- * @throws IllegalArgumentException\r
- */\r
- public void resume_execution(int execution_id, ExecutionDetails details)throws IllegalArgumentException;\r
-\r
- /**\r
- * Cancels the specified execution\r
- *\r
- * @param execution_id\r
- * @throws IllegalArgumentException\r
- */\r
- public void cancel_execution(int execution_id)throws Exception;\r
-}\r
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-import java.net.URL;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public class AriaClientFactory {\r
-\r
- public AriaClient createRestClient(String protocol, String address, int port, String version){\r
- return new AriaRestClient(protocol, address, port, version);\r
- }\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-import java.util.List;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonNode;
-import org.codehaus.jackson.jaxrs.JacksonJsonProvider;
-import org.codehaus.jackson.map.ObjectMapper;
-import com.gigaspaces.aria.rest.client.exceptions.StorageException;
-import com.gigaspaces.aria.rest.client.exceptions.ValidationException;
-
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-/**
- * Created by DeWayne on 7/12/2017.
- */
-public class AriaRestClient implements AriaClient {
- private Client client = null;
- private WebTarget base_target = null;
-
- /**
- * Construct an Aria REST client
- *
- * @param protocol
- * either http or https
- * @param address
- * the IP address or host name
- * @param port
- * the port of the service
- * @param version
- * the api version
- */
- public AriaRestClient(String protocol, String address, int port, String version) {
- this.client = ClientBuilder.newBuilder().register(JacksonJsonProvider.class).build();
- base_target = client.target(protocol + "://" + address + ":" + port + "/api/" + version);
- }
-
- /**
- * Installs a service template
- *
- * @param template
- * the template object
- * @throws ValidationException
- * @throws StorageException
- */
- public void install_service_template(ServiceTemplate template)
- throws ValidationException, StorageException, Exception {
-
- byte[] csarBytes = template.getCSARBytes();
- Response response = null;
- if (csarBytes == null) {
- response = base_target.path("templates/" + template.getName()).request(MediaType.APPLICATION_JSON)
- .put(Entity.entity(
- "{\"service-template-path\":\"" + template.getURI().toString() + "\""
- + ",\"service-template-filename\":\"" + template.getFilename() + "\"",
- MediaType.APPLICATION_JSON));
- }
- else {
-
- response = base_target.path("templates/" + template.getName()).request("application/zip")
- .put(Entity.entity(csarBytes, "application/zip"));
- }
-
- if (response.getStatus() == 500) {
- throw new StorageException(response.readEntity(String.class));
- } else if (response.getStatus() == 400) {
- throw new ValidationException(response.readEntity(String.class));
- } else if (response.getStatus() > 199 && response.getStatus() < 300) {
- return;
- } else {
- throw new Exception(
- "Error installing template: " + response.getStatus() + " " + response.readEntity(String.class));
- }
- }
-
- public ValidationResult validate_service_template(ServiceTemplate template) throws Exception {
- Response response = base_target.path("templates").request(MediaType.APPLICATION_JSON)
- .post(Entity.entity(
- "{\"service-template-path\":\"" + template.getURI().toString() + "\""
- + ",\"service-template-filename\":\"" + template.getFilename() + "\"}",
- MediaType.APPLICATION_JSON));
-
- ValidationResultImpl result = new ValidationResultImpl();
- if (response.getStatus() >= 200 && response.getStatus() < 300) {
- result.setFailed(false);
- } else if (response.getStatus() == 400) {
- result.setFailed(true);
- } else {
- throw new Exception(
- "received error response '" + response.getStatus() + "':" + response.readEntity(String.class));
- }
- return result;
-
- }
-
- /**
- *
- * @return a list of service templates
- */
- public List<? extends ServiceTemplate> list_service_templates() {
- List<? extends ServiceTemplate> templates = base_target.path("templates").request(MediaType.APPLICATION_JSON)
- .get(new GenericType<List<ServiceTemplateImpl>>() {
- });
-
- return templates;
- }
-
- /**
- * Deletes the specified template.
- *
- * TODO: Error handling is a little blunt. Need to describe failures better
- *
- * @param template_id
- * the template id to delete
- * @throws IllegalArgumentException
- * thrown when the template can't be deleted
- * @throws Exception
- * other server side errors
- */
- public void delete_service_template(int template_id) throws IllegalArgumentException, Exception {
- Response response = base_target.path("templates/" + template_id).request(MediaType.APPLICATION_JSON).delete();
-
- if (response.getStatus() >= 200 && response.getStatus() < 300) {
- return;
- } else if (response.getStatus() == 400) {
- throw new IllegalArgumentException("Error deleting template '" + template_id + "'");
- } else {
- throw new Exception("Error processing request. Return code = " + response.getStatus());
- }
- }
-
- /**
- * List the node templates for a given template id
- *
- * @param template_id
- * @return
- */
- public List<? extends NodeTemplate> list_nodes(int template_id) {
- List<? extends NodeTemplate> nodes = base_target.path("templates/" + template_id + "/nodes")
- .request(MediaType.APPLICATION_JSON).get(new GenericType<List<NodeTemplateImpl>>() {
- });
- return nodes;
- }
-
- /**
- * Get a specific node by id
- *
- * @param node_id
- * the node id
- * @return
- * @throws IllegalArgumentException
- */
- public NodeTemplate get_node(int node_id) throws IllegalArgumentException {
- NodeTemplate node = base_target.path("nodes/" + node_id).request(MediaType.APPLICATION_JSON)
- .get(NodeTemplateImpl.class);
- return node;
- }
-
- public List<? extends Service> list_services() {
- List<? extends Service> services = base_target.path("services").request(MediaType.APPLICATION_JSON)
- .get(new GenericType<List<ServiceImpl>>() {
- });
- return services;
- }
-
- public Service get_service(int service_id) throws IllegalArgumentException {
- throw new NotImplementedException();
- }
-
- public List<? extends Output> list_service_outputs(int service_id) throws IllegalArgumentException {
- List<? extends Output> outputs = base_target.path("services").request(MediaType.APPLICATION_JSON)
- .get(new GenericType<List<OutputImpl>>() {
- });
- return outputs;
- }
-
- public List<? extends Input> list_service_inputs(int service_id) throws IllegalArgumentException {
- List<? extends Input> inputs = base_target.path("services").request(MediaType.APPLICATION_JSON)
- .get(new GenericType<List<InputImpl>>() {
- });
- return inputs;
- }
-
- /**
- * Create a service based on the supplied template
- *
- * @param template_id
- * the template to create the service for
- * @param service_name
- * a name for the service
- * @param inputs
- * an optional list of inputs for the service (can be null)
- * @throws Exception
- */
- public void create_service(int template_id, String service_name, List<Input> inputs) throws Exception {
-
- String json = "{" + inputsToJson(inputs) + "}";
-
- Response response = base_target.path("templates/" + template_id + "/services/" + service_name)
- .request(MediaType.APPLICATION_JSON).post(Entity.entity(json, MediaType.APPLICATION_JSON));
-
- if (response.getStatus() < 200 || response.getStatus() > 299) {
- throw new Exception(
- "create service failed:" + response.getStatus() + " " + response.readEntity(String.class));
- }
- }
-
- public void delete_service(int service_id) throws Exception {
- Response response = base_target.path("services/" + service_id).request(MediaType.APPLICATION_JSON).delete();
- if (!responseOK(response)) {
- throw new Exception(
- "delete service failed: " + response.getStatus() + " " + response.readEntity(String.class));
- }
- }
-
- /**
- * List user workflows for supplied service
- *
- * @param service_id
- * @return
- * @throws IllegalArgumentException
- */
- public List<? extends Workflow> list_workflows(int service_id) throws IllegalArgumentException {
- List<? extends Workflow> workflows = base_target.path("services/" + service_id + "/workflows")
- .request(MediaType.APPLICATION_JSON).get(new GenericType<List<WorkflowImpl>>() {
- });
- return workflows;
- }
-
- public Workflow get_workflow(int workflow_id) throws IllegalArgumentException {
- throw new NotImplementedException();
- }
-
- /**
- * List all executions
- *
- * @return
- * @throws Exception
- */
- public List<? extends Execution> list_executions() throws Exception {
- List<? extends Execution> executions = base_target.path("executions").request(MediaType.APPLICATION_JSON)
- .get(new GenericType<List<ExecutionImpl>>() {
- });
- return executions;
- }
-
- /**
- * List executions for specified service
- *
- * @param service_id
- * @return
- * @throws Exception
- */
- public List<? extends Execution> list_executions(int service_id) throws Exception {
- List<? extends Execution> executions = base_target.path("services/" + service_id + "/executions")
- .request(MediaType.APPLICATION_JSON).get(new GenericType<List<ExecutionImpl>>() {
- });
- return executions;
- }
-
- /**
- * Get details about a specified execution
- *
- * @param execution_id
- * @return
- * @throws IllegalArgumentException
- */
- public Execution get_execution(int execution_id) throws IllegalArgumentException {
- Execution execution = base_target.path("executions/" + execution_id).request(MediaType.APPLICATION_JSON)
- .get(ExecutionImpl.class);
- return execution;
- }
-
- /**
- * Start an execution for the specified service
- *
- * @param service_id
- * the service to run the execution for
- * @param workflow_name
- * the name of the workflow to execute
- * @param details
- * details controlling execution operation
- * @return the execution id
- * @throws Exception
- */
- public int start_execution(int service_id, String workflow_name, ExecutionDetails details) throws Exception {
- StringBuilder json = new StringBuilder("{");
- if (details.getExecutor().length() > 0) {
- json.append("\"executor\":\"").append(details.getExecutor()).append("\",");
- }
- if (details.getInputs() != null) {
- json.append(inputsToJson(details.getInputs()));
- }
- json.append("\"task_max_attempts\":").append(details.getTaskMaxAttempts()).append(",");
- json.append("\"task_retry_interval\":").append(details.getTaskRetryInterval()).append("}");
-
- System.out.println("JSON=" + json.toString());
-
- Response response = base_target.path("services/" + service_id + "/executions/" + workflow_name)
- .request(MediaType.APPLICATION_JSON).post(Entity.entity(json.toString(), MediaType.APPLICATION_JSON));
-
- if (!responseOK(response)) {
- throw new Exception(
- "start execution failed: " + response.getStatus() + " " + response.readEntity(String.class));
- }
-
- ObjectMapper mapper = new ObjectMapper(new JsonFactory());
- JsonNode rootNode = mapper.readTree(response.readEntity(String.class));
- int id = rootNode.get("id").asInt(-1);
- return id;
- }
-
- public void resume_execution(int execution_id, ExecutionDetails details) throws IllegalArgumentException {
- StringBuilder json = new StringBuilder("{");
- if (details.getExecutor().length() > 0) {
- json.append("\"executor\":\"").append(details.getExecutor()).append("\",");
- }
- json.append("\"retry_failed_tasks\":").append(details.isRetry_failed_tasks()).append("}");
- Response response = base_target.path("executions/" + execution_id).request(MediaType.APPLICATION_JSON)
- .post(Entity.entity(json.toString(), MediaType.APPLICATION_JSON));
- }
-
- public void cancel_execution(int execution_id) throws Exception {
- Response response = base_target.path("executions/" + execution_id).request(MediaType.APPLICATION_JSON).delete();
- if (!responseOK(response)) {
- throw new Exception(
- "delete service failed: " + response.getStatus() + " " + response.readEntity(String.class));
- }
- }
-
- /**
- * ----- ----- PRIVATE METHODS -----
- */
-
- private boolean responseOK(Response response) {
- return response.getStatus() > 199 && response.getStatus() < 300;
- }
-
- private String inputsToJson(List<Input> inputs) {
- if (inputs == null)
- return null;
-
- StringBuilder sb = new StringBuilder("\"inputs\":{");
- for (Input input : inputs) {
- sb.append("\"").append(input.getName()).append("\":\"").append(input.getValue()).append("\",");
- }
- if (inputs.size() > 0)
- sb.deleteCharAt(sb.length() - 1); // trim comma
-
- return sb.toString();
- }
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface Execution {\r
- int getExecutionId();\r
- String getWorkflowName();\r
- String getServiceTemplateName();\r
- String getServiceName();\r
- String getStatus();\r
-}\r
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-import java.util.List;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public class ExecutionDetails {\r
- private String executor=""; //default\r
- private int task_max_attempts=30;\r
- private int task_retry_interval=30;\r
- private List<Input> inputs=null;\r
- private boolean retry_failed_tasks=false;\r
-\r
- public ExecutionDetails(){}\r
-\r
- public ExecutionDetails(String executor){\r
- this.executor=executor;\r
- }\r
-\r
- public ExecutionDetails(String executor, int task_max_attempts, int task_retry_interval, boolean retry_failed_tasks,\r
- List<Input> inputs){\r
- this.executor=executor;\r
- this.task_max_attempts=task_max_attempts;\r
- this.task_retry_interval=task_retry_interval;\r
- this.retry_failed_tasks = retry_failed_tasks;\r
- this.inputs=inputs;\r
- }\r
- public String getExecutor(){\r
- return executor;\r
- }\r
- public void setExecutor(String executor){\r
- this.executor=executor;\r
- }\r
- public int getTaskMaxAttempts(){\r
- return task_max_attempts;\r
- }\r
- public void setTaskMaxAttempts(int max){\r
- this.task_max_attempts=max;\r
- }\r
- public int getTaskRetryInterval(){\r
- return task_retry_interval;\r
- }\r
- public void setTaskRetryInterval(int interval){\r
- this.task_retry_interval=interval;\r
- }\r
- public List<Input> getInputs(){\r
- return inputs;\r
- }\r
- public void setInputs(List<Input> inputs){\r
- this.inputs=inputs;\r
- }\r
- public boolean isRetry_failed_tasks() {return retry_failed_tasks;}\r
- public void setRetry_failed_tasks(boolean retry_failed_tasks) {this.retry_failed_tasks = retry_failed_tasks;}\r
-\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/**
- * Created by DeWayne on 7/17/2017.
- */
-public class ExecutionImpl implements Execution {
- @JsonProperty("execution_id")
- int execution_id;
- @JsonProperty("workflow_name")
- String workflow_name;
- @JsonProperty("service_template_name")
- String service_template_name;
- @JsonProperty("service_name")
- String service_name;
- String status;
-
- public int getExecutionId() {
- return execution_id;
- }
- public String getWorkflowName() {
- return workflow_name;
- }
-
- public String getServiceTemplateName() {
- return service_template_name;
- }
-
- public String getServiceName() {
- return service_name;
- }
-
- public String getStatus() {
- return status;
- }
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface Input {\r
- String getName();\r
- String getDescription();\r
- String getValue();\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-/**
- * Created by DeWayne on 7/17/2017.
- */
-public class InputImpl implements Input {
- private String name, description, value;
-
- public InputImpl(){}
-
- public InputImpl(String name,String value,String description){
- if(name==null || value==null){
- throw new IllegalArgumentException("null argument supplied");
- }
- this.name=name;
- this.value=value;
- if(description!=null)this.description=description;
- }
-
- public String getName() {
- return name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getValue() {
- return value;
- }
-
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface NodeTemplate {\r
- int getId();\r
- String getName();\r
- String getDescription();\r
- int getServiceTemplateId();\r
- String getTypeName();\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-/**
- * Created by DeWayne on 7/18/2017.
- */
-public class NodeTemplateImpl implements NodeTemplate {
- private int id;
- private String name;
- private String description="";
- @JsonProperty("service_template_id")
- private int service_template_id;
- @JsonProperty("type_name")
- private String type_name="";
-
- public NodeTemplateImpl(){}
-
- public NodeTemplateImpl(int id, String name, String description, int service_template_id, String type_name){
- this.id=id;
- this.description=description;
- this.service_template_id=service_template_id;
- this.type_name=type_name;
- }
-
- public int getId() {
- return id;
- }
-
- public String getDescription() {
- return description;
- }
-
- public int getServiceTemplateId() {
- return service_template_id;
- }
-
- public String getTypeName() {
- return type_name;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
-
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface Output {\r
- String getName();\r
- String getDescription();\r
- String getValue();\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-/**
- * Created by DeWayne on 7/17/2017.
- */
-public class OutputImpl implements Output {
- private String name, description, value;
-
- public String getName() {
- return name;
- }
-
- public String getDescription() {
- return description;
- }
-
- public String getValue() {
- return value;
- }
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-import java.util.Date;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface Service {\r
- int getId();\r
- String getDescription();\r
- String getName();\r
- String getServiceTemplate();\r
- Date getCreated();\r
- Date getUpdated();\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-import java.net.URI;
-import java.util.Date;
-
-/**
- *
- *
- * Created by DeWayne on 7/17/2017.
- */
-public class ServiceImpl implements Service {
- private int id;
- private String description, name, template;
- private Date created, updated;
-
- public int getId(){
- return id;
- }
-
- public String getDescription(){
- return description;
- }
-
- public String getName(){
- return name;
- }
-
- public String getServiceTemplate(){
- return template;
- }
-
- public Date getCreated(){
- return created;
- }
-
- public Date getUpdated(){
- return updated;
- }
-
-
-}
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-import java.net.URI;
-
-/**
- * Created by DeWayne on 7/12/2017.
- */
-public interface ServiceTemplate {
- String getName();
- URI getURI();
- int getId();
- String getFilename();
- String getDescription();
- byte[] getCSARBytes();
-}
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-import java.net.URI;
-
-/**
- * CSAR based implementation
- *
- * Created by DeWayne on 7/17/2017.
- */
-public class ServiceTemplateImpl implements ServiceTemplate {
- public static final String DEFAULT_TEMPLATE_NAME = "service-template.yaml";
- private String name;
- private int id;
- private URI uri;
- private String filename = DEFAULT_TEMPLATE_NAME;
- private String description;
- private byte[] csar_blob; // for opaque binary
-
- public ServiceTemplateImpl(){}
-
- public ServiceTemplateImpl(String name, URI uri){
- this.name=name;
- this.uri=uri;
- }
-
- /**
- * Construct service template from CSAR byte array
- */
- public ServiceTemplateImpl(String name, byte[] csar){
- this.csar_blob = csar;
- this.name = name;
- }
-
- /**
- * Construct an instance based on CSAR
- * @param name a textual name for the template
- * @param uri a URI to a CSAR
- * @param filename the filename in the CSAR representing main yaml template
- */
- public ServiceTemplateImpl(String name, URI uri, String filename, String description){
- this.name=name;
- this.uri=uri;
- this.filename=filename;
- this.description=description;
- }
-
- public int getId(){
- return id;
- }
- public void setId(int id){
- this.id=id;
- }
- public String getName() {
- return name;
- }
- public void setName(String name){
- this.name=name;
- }
- public URI getURI() {
- return uri;
- }
- public void setPath(String path){
- this.uri=uri;
- }
- public String getFilename() {
- return filename;
- }
- public void setFilename(String filename){
- this.filename=filename;
- }
- public byte[] getCSARBytes() {
- return csar_blob;
- }
-
- public String getDescription(){ return description;}
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface ValidationResult {\r
-\r
- boolean getFailed();\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-/**
- * Created by DeWayne on 7/17/2017.
- */
-public class ValidationResultImpl implements ValidationResult {
- private boolean failed=false;
-
- public void setFailed(boolean failed){
- this.failed=failed;
- }
- public boolean getFailed() {
- return failed;
- }
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public interface Workflow {\r
- String getName();\r
-}\r
+++ /dev/null
-/*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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 com.gigaspaces.aria.rest.client;
-
-/**
- * Created by DeWayne on 7/17/2017.
- */
-public class WorkflowImpl implements Workflow{
- String name;
-
- public String getName() {
- return name;
- }
-}
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client.exceptions;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public class StorageException extends Exception {\r
- public StorageException(String message){\r
- super(message);\r
- }\r
-}\r
+++ /dev/null
-/*\r
- * ============LICENSE_START===================================================\r
- * Copyright (c) 2017 Cloudify.co. All rights reserved.\r
- * ===================================================================\r
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not\r
- * use this file except in compliance with the License. You may obtain a copy\r
- * of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\r
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r
- * License for the specific language governing permissions and limitations under\r
- * the License.\r
- * ============LICENSE_END====================================================\r
-*/\r
-package com.gigaspaces.aria.rest.client.exceptions;\r
-\r
-/**\r
- * Created by DeWayne on 7/12/2017.\r
- */\r
-public class ValidationException extends Exception {\r
- public ValidationException(String message){\r
- super(message);\r
- }\r
-}\r
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import org.junit.Test;
-
-public class AriaClientFactoryTest {
-
- @Test
- public void test() {
- AriaClientFactory acf=new AriaClientFactory();
- assert(acf!=null);
- acf.createRestClient("https", "address", 9060, "V1");
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import static org.junit.Assert.*;
-import java.util.Arrays;
-import java.util.List;
-import org.junit.Test;
-
-public class ExecutionDetailsTest {
-
-private Input inputs;
-private ExecutionDetails ed;
-
-@Test
- public void test() {
- List<Input> actual = Arrays.asList(inputs);
- ed= new ExecutionDetails("",30,30,false,actual);
- ed=new ExecutionDetails("");
- ed.setExecutor("");
- ed.setInputs(actual);
- ed.setTaskMaxAttempts(30);
- ed.setTaskRetryInterval(30);
- ed.setRetry_failed_tasks(false);
- assert(ed.getExecutor()).equals("");
- assertFalse(ed.isRetry_failed_tasks());
- assert(ed.getInputs().equals(actual));
- assertEquals(30,ed.getTaskMaxAttempts());
- assertEquals(30,ed.getTaskRetryInterval());
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import org.junit.Test;
-
-public class ExecutionImplTest {
-
- @Test
- public void testExecutionImpl() {
- ExecutionImpl eil = new ExecutionImpl();
-
- eil.getExecutionId();
- eil.getServiceName();
- eil.getServiceTemplateName();
- eil.getStatus();
- eil.getWorkflowName();
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import org.junit.Test;
-
-public class InputImpTest {
- private InputImpl ip;
-
- @Test
- public void test() {
- ip=new InputImpl("name","value","desc");
- assert(ip.getName().equals("name"));
- assert(ip.getValue().equals("value"));
- assert(ip.getDescription().equals("desc"));
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import static org.junit.Assert.*;
-import org.junit.Test;
-
-public class NodeTemplateImplTest {
-
- private NodeTemplateImpl nti;
-
- @Test
- public void test() {
- nti=new NodeTemplateImpl(12, null, "desc", 12, "tname");
- assertEquals(12,nti.getId());
- assertEquals(12,nti.getServiceTemplateId());
- assertEquals(null,nti.getName());
- assertEquals("desc",nti.getDescription());
- assertEquals("tname",nti.getTypeName());
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import org.junit.Test;
-
-public class OutputImplTest {
-
- @Test
- public void test() {
- OutputImpl oil= new OutputImpl();
- oil.getDescription();
- oil.getName();
- oil.getValue();
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import org.junit.Test;
-
-public class ServiceImplTest {
-
- private ServiceImpl sil;
-
- @Test
- public void test() {
- sil=new ServiceImpl();
- sil.getId();
- sil.getDescription();
- sil.getName();
- sil.getServiceTemplate();
- sil.getUpdated();
- sil.getCreated();
- }
-
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import static org.junit.Assert.*;
-
-import java.net.URI;
-
-import org.junit.Test;
-
-public class ServiceTemplateImplTest {
-
- private URI uri;
- private byte[] csar_blob;
- private ServiceTemplateImpl sti;
-
- @Test
- public void test() {
- sti=new ServiceTemplateImpl("name", uri, "filename", "description");
- ServiceTemplateImpl stid=new ServiceTemplateImpl("name", csar_blob);
- ServiceTemplateImpl std=new ServiceTemplateImpl("name", uri);
- sti.setFilename("filename");
- sti.setId(10);
- sti.setName("name");
- sti.setPath("path");
- assertEquals(10,sti.getId());
- assertEquals("name",sti.getName());
- assertEquals(uri,sti.getURI());
- assertEquals("filename",sti.getFilename());
- assertEquals("description",sti.getDescription());
- assertEquals(csar_blob,stid.getCSARBytes());
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import static org.junit.Assert.*;
-import org.junit.Test;
-
-public class ValidationResultImplTest {
-
- private boolean failed=false;
-
- private ValidationResultImpl vri;
-
- @Test
- public void test() {
- vri=new ValidationResultImpl();
- vri.setFailed(failed);
- assertFalse(vri.getFailed());
- }
-}
+++ /dev/null
-/*
-* ============LICENSE_START=======================================================
-* ONAP : SO
-* ================================================================================
-* Copyright 2018 TechMahindra
-*=================================================================================
-* 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 com.gigaspaces.aria.rest.client;
-
-import org.junit.Test;
-
-public class WorkflowimplTest {
-
- private WorkflowImpl wfi;
-
- @Test
- public void test() {
- wfi=new WorkflowImpl();
- wfi.getName();
- }
-}
+++ /dev/null
-#
-# ============LICENSE_START===================================================
-# Copyright (c) 2017 Cloudify.co. 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====================================================
-#
-
-import subprocess
-import os
-import sys
-import glob
-import xml.etree.ElementTree as etree
-
-# create and enter venv
-def create_venv( name):
- if subprocess.call("virtualenv {}".format(name), shell = True):
- raise Exception("virtualenv create failed")
- ret = subprocess.call(". {}/bin/activate && python {} run". \
- format(name,__file__), shell = True)
- sys.exit(ret)
-
-def init_venv():
- subprocess.call("pip install -U pip", shell = True)
- subprocess.call("pip install -U setuptools", shell = True)
- subprocess.call("pip install wheel", shell = True)
- subprocess.call("pip install twine", shell = True)
-
-
-if len(sys.argv) == 1:
- create_venv ("mavenvenv")
-else:
- init_venv()
-
- if os.environ['MVN_PHASE'] == 'package':
- wheelname = os.environ['WHEEL_NAME']
- inputdir = os.environ['INPUT_DIR']
- outputdir = os.environ['OUTPUT_DIR']
- savedir = os.getcwd()
- os.chdir(inputdir)
-
- if subprocess.call( [ "python",
- "setup.py",
- "bdist_wheel",
- "-d",
- outputdir
- ]):
- sys.stderr("wheel create failed")
- sys.exit(1)
- f = glob.glob(outputdir+"/*.whl")[0]
- os.rename(f , outputdir+"/"+ wheelname)
-
- elif os.environ['MVN_PHASE'] == 'deploy':
-
- it = etree.iterparse(os.environ['SETTINGS_FILE'])
- for _, el in it:
- el.tag = el.tag.split('}', 1)[1] # strip namespace
- settings = it.root
-
- username = settings.find('.//server[id="{}"]/username'.format(
- os.environ['PYPI_SERVERID'])).text
- password = settings.find('.//server[id="{}"]/password'.format(
- os.environ['PYPI_SERVERID'])).text
-
- try:
- if subprocess.call( [ "twine",
- "upload",
- "--username",
- username,
- "--password",
- password,
- "--repository-url",
- os.environ["PYPI_SERVER_BASEURL"],
- os.environ["WHEEL_PATH"]
- ] ):
- sys.stderr.write("pypi upload failed")
- sys.exit(1)
- finally:
- subprocess.call("rm -rf mavenvenv", shell = True)
-
- sys.exit(0)
- else:
- sys.stderr.write("Unrecognized phase '{}'\n".format(
- os.environ('MVN_PHASE')))
- sys.exit(1)
+++ /dev/null
-<?xml version="1.0"?>
-<!--
- /*
- * ============LICENSE_START===================================================
- * Copyright (c) 2017 Cloudify.co. 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====================================================
- */
- -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <packaging>pom</packaging>
- <groupId>org.onap.aria</groupId>
- <artifactId>ariarest</artifactId>
- <name>ariarest</name>
- <version>0.1.0-SNAPSHOT</version>
- <description>ARIA REST API wheel build</description>
- <parent>
- <groupId>org.onap.oparent</groupId>
- <artifactId>oparent</artifactId>
- <version>1.1.0</version>
- </parent>
-
- <properties>
- <python_version>2</python_version>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <wheel.name>${project.artifactId}-${project.version}-py${python_version}-none-any.whl</wheel.name>
- <python.sourceDirectory>${project.basedir}/src/main/python/aria-rest</python.sourceDirectory>
- <!-- <onap.nexus.pypiserver.baseurl>http://192.168.33.1:8081/repository/pypi-internal/</onap.nexus.pypiserver.baseurl> -->
- <!--<onap.nexus.pypiserver.serverid>ecomp-snapshots</onap.nexus.pypiserver.serverid> -->
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>3.0.0</version>
- <executions>
- <execution>
- <id>write-python-version</id>
- <goals>
- <goal>regex-property</goal>
- </goals>
- <phase>initialize</phase>
- <configuration>
- <name>python_version</name>
- <regex>-SNAPSHOT</regex>
- <value>${project.version}</value>
- <replacement>\.dev0</replacement>
- <failIfNoMatch>false</failIfNoMatch>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.6.0</version>
- <executions>
- <execution>
- <id>package</id>
- <phase>package</phase>
- <goals><goal>exec</goal></goals>
- <configuration>
- <executable>python</executable>
- <arguments>
- <argument>${project.basedir}/build.py</argument>
- </arguments>
- <environmentVariables>
- <MVN_PHASE>package</MVN_PHASE>
- <WHEEL_NAME>${wheel.name}</WHEEL_NAME>
- <INPUT_DIR>${project.basedir}/src/main/python/aria-rest</INPUT_DIR>
- <OUTPUT_DIR>${project.build.directory}</OUTPUT_DIR>
- </environmentVariables>
- </configuration>
- </execution>
- <!--execution>
- <id>deploy</id>
- <phase>deploy</phase>
- <goals><goal>exec</goal></goals>
- <configuration>
- <executable>python</executable>
- <arguments>
- <argument>${project.basedir}/build.py</argument>
- </arguments>
- <environmentVariables>
- <MVN_PHASE>deploy</MVN_PHASE>
- <PROJECT_VERSION>${project.version}</PROJECT_VERSION>
- <DOCKERREGISTRY_SNAPSHOT>${onap.nexus.dockerregistry.snapshot}</DOCKERREGISTRY_SNAPSHOT>
- <DOCKERREGISTRY_RELEASE>${onap.nexus.dockerregistry.release}</DOCKERREGISTRY_RELEASE>
- <PYPI_SERVER_BASEURL>${onap.nexus.pypiserver.baseurl}</PYPI_SERVER_BASEURL>
- <PYPI_SERVERID>${onap.nexus.pypiserver.serverid}</PYPI_SERVERID>
- <WHEEL_PATH>${project.build.directory}/${wheel.name}</WHEEL_PATH>
- </environmentVariables>
- </configuration>
- </execution-->
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
-
+++ /dev/null
-# org.onap.dcae
-# ============LICENSE_START====================================================
-# Copyright (c) 2018 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======================================================
-#
-# ECOMP is a trademark and service mark of AT&T Intellectual Property.
-
-from setuptools import setup, find_packages
-
-setup(
- name='aria-rest-server',
- version='0.1.0',
- packages=find_packages(),
- author = '',
- author_email = '',
- description = ('Library for ...'),
- license = 'Apache 2.0',
- keywords = '',
- url = '',
- zip_safe = True,
- install_requires=[],
- entry_points = {}
-)
+++ /dev/null
-[tox]
-envlist = py27
-[testenv]
-deps=
- pytest
- coverage
- pytest-cov
-setenv =
- PYTHONPATH={toxinidir}
-commands=
- echo "There are no tests yet"
- #pytest --junitxml xunit-results.xml --cov dcaeapplib --cov-report xml
- #coverage xml
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.onap.so</groupId>
- <artifactId>so</artifactId>
- <version>1.2.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>aria</artifactId>
-
- <name>ARIA related artifacts</name>
- <description>ARIA related artifacts</description>
- <packaging>pom</packaging>
-
- <modules>
- <module>aria-rest-java-client</module>
- <!-- <module>aria-rest-server</module> -->
- <module>multivim-plugin</module>
- </modules>
-</project>
try {
jsonStr = mapper.writeValueAsString(this);
} catch(JsonProcessingException e) {
- msoLogger.debug("JsonProcessingException", e);
- e.printStackTrace();
+ msoLogger.error("JsonProcessingException", e);
}
return jsonStr;
}
try {
jsonStr = mapper.writeValueAsString(this);
} catch(JsonProcessingException e) {
- msoLogger.debug("JsonProcessingException", e);
- e.printStackTrace();
+ msoLogger.error("JsonProcessingException", e);
}
return jsonStr;
}
Map<String, Object> resourceInputsFromServiceDeclaredLevel = buildResouceRequest(serviceUuid, resourceCustomizationUuid, serviceInput);
resourceInputsFromUuiMap.putAll(resourceInputsFromServiceDeclaredLevel);
} catch(SdcToscaParserException e) {
- LOGGER.debug("SdcToscaParserException", e);
- e.printStackTrace();
+ LOGGER.error("SdcToscaParserException", e);
}
String resourceInputsStr = getJsonString(resourceInputsFromUuiMap);
String result = "{\n"
try {
jsonStr = mapper.writeValueAsString(srcObj);
} catch(JsonProcessingException e) {
- LOGGER.debug("SdcToscaParserException", e);
- e.printStackTrace();
+ LOGGER.error("SdcToscaParserException", e);
}
return jsonStr;
}
Assert.assertNull(context2);
}
- @Test
+/* @Test
public void testProcessCallback() {
WorkflowContextHolder contextHolder = WorkflowContextHolder.getInstance();
AsynchronousResponse asyncResponse = mock(AsynchronousResponse.class);
WorkflowContext context1 = contextHolder.getWorkflowContext(workflowContext.getRequestId());
Assert.assertNull(context1);
- }
+ }*/
}
--- /dev/null
+/*-
+ * ============LICENSE_START=======================================================
+ * OPENECOMP - SO
+ * ================================================================================
+ * Copyright (C) 2018 Huawei Technologies Co., Ltd. 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.scripts
+
+import org.openecomp.mso.bpmn.common.scripts.AbstractServiceTaskProcessor
+import org.camunda.bpm.engine.delegate.DelegateExecution
+import org.openecomp.mso.bpmn.core.json.JsonUtils
+import org.openecomp.mso.bpmn.common.scripts.ExceptionUtil
+import org.openecomp.mso.bpmn.common.scripts.SDNCAdapterUtils
+
+/**
+ * This groovy class supports the <class>ActivateSDNCCNetworkResource.bpmn</class> process.
+ * flow for SDNC Network Resource Activate
+ */
+public class ActivateSDNCNetworkResource extends AbstractServiceTaskProcessor {
+
+ String Prefix = "ACTSDNCRES_"
+
+ ExceptionUtil exceptionUtil = new ExceptionUtil()
+
+ JsonUtils jsonUtil = new JsonUtils()
+
+ SDNCAdapterUtils sdncAdapterUtils = new SDNCAdapterUtils()
+
+ public void preProcessRequest(DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ utils.log("INFO"," ***** Started preProcessRequest *****", isDebugEnabled)
+ }
+
+ public void prepareUpdateAfterActivateSDNCResource(DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ utils.log("INFO"," ***** started prepareUpdateAfterActivateSDNCResource *****", isDebugEnabled)
+ }
+
+ public void postCreateSDNCCall(DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ utils.log("INFO"," ***** started postCreateSDNCCall *****", isDebugEnabled)
+ }
+
+ public void sendSyncResponse(DelegateExecution execution) {
+ def isDebugEnabled = execution.getVariable("isDebugLogEnabled")
+ utils.log("INFO"," ***** started sendSyncResponse *****", isDebugEnabled)
+ }
+}
\ No newline at end of file
httpClient = HttpClientBuilder.create().build();
pnfCorrelationIdToThreadMap = new ConcurrentHashMap<>();
dmaapHost = PropertyConfiguration.getInstance().getProperties(PropertyConfiguration.MSO_BPMN_URN_PROPERTIES)
- .get("dmaapHost");
+ .get("mso.dmaap.host");
dmaapPort = Integer.parseInt(PropertyConfiguration.getInstance()
- .getProperties(PropertyConfiguration.MSO_BPMN_URN_PROPERTIES).get("dmaapPort"));
+ .getProperties(PropertyConfiguration.MSO_BPMN_URN_PROPERTIES).get("mso.dmaap.port"));
executor = null;
getRequest = new HttpGet(buildURI());
}
}
private List<Object> queryTerminalPointsFromServiceProviderSystem(String srcLocation, String dstLocation) {
- Map<String, String> locationSrc = new HashMap<String, String>();
+ Map<String, String> locationSrc = new HashMap<>();
locationSrc.put("location", srcLocation);
- Map<String, String> locationDst = new HashMap<String, String>();
+ Map<String, String> locationDst = new HashMap<>();
locationDst.put("location", dstLocation);
- List<Map<String, String>> locations = new ArrayList<Map<String, String>>();
+ List<Map<String, String>> locations = new ArrayList<>();
locations.add(locationSrc);
locations.add(locationDst);
- List<Object> returnList = new ArrayList<Object>();
+ List<Object> returnList = new ArrayList<>();
String reqContent = getJsonString(locations);
String url = getThirdSPEndPoint();
String responseContent = sendRequest(url, "POST", reqContent);
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<String, Object>();
+ 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"));
String url = getOOFCalcEndPoint();
String responseContent = sendRequest(url, "POST", oofRequestReq);
- List<Object> returnList = new ArrayList<Object>();
+ List<Object> returnList = new ArrayList<>();
if (null != responseContent) {
returnList = getJsonObject(responseContent, List.class);
}
}
private Map<String, Object> getReturnRoute(List<Object> returnList){
- Map<String, Object> returnRoute = new HashMap<String,Object>();
+ 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");
<?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.2">
<bpmn:process id="CreateSDNCNetworkResource" name="CreateSDNCNetworkResource" isExecutable="true">
<bpmn:startEvent id="createNS_StartEvent" name="createNS_StartEvent">
<bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing>
<bpmn:scriptTask id="PreprocessIncomingRequest_task" name="prepare SDNC Request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_18l3crb</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0khtova</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
def dcsi = new CreateSDNCNetworkResource()
-dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
+dcsi.prepareSDNCRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:endEvent id="EndEvent_1x6k78c" name="create SDNC call end">
- <bpmn:incoming>SequenceFlow_17md60u</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_0auvfvm</bpmn:incoming>
</bpmn:endEvent>
<bpmn:callActivity id="CallActivity_1600xlj" name="Call SDNC RSRC Create Adapter V1 " calledElement="sdncAdapter">
<bpmn:extensionElements>
<camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" />
</bpmn:extensionElements>
<bpmn:incoming>SequenceFlow_15mvedq</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_1ex9ov6</bpmn:outgoing>
</bpmn:callActivity>
- <bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0uwlr22" />
- <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="ScriptTask_1g5zyi6" />
<bpmn:scriptTask id="Task_023hred" name="post SDNC create call">
- <bpmn:incoming>SequenceFlow_1vnx1pp</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+ <bpmn:incoming>SequenceFlow_1ex9ov6</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1kzj1j5</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
def dcsi = new CreateSDNCNetworkResource()
-dcsi.postCreateSDNCCall(execution)]]></bpmn:script>
+dcsi.postCreateSDNCCall(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_0w2es8j" sourceRef="Task_1dlrfiw" targetRef="Task_13sx2bp" />
<bpmn:sequenceFlow id="SequenceFlow_18l3crb" sourceRef="Task_13sx2bp" targetRef="PreprocessIncomingRequest_task" />
<bpmn:scriptTask id="Task_1dlrfiw" name="Set the Recipe DesignTimeParam" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_1qo2pln</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_0w2es8j</bpmn:outgoing>
- <bpmn:script><![CDATA[String recipeParamXsdDemo="""{"operationType":"GRE"}"""
+ <bpmn:script>String recipeParamXsdDemo="""{"operationType":"GRE"}"""
String recipeParamXsd=""
-execution.setVariable("recipeParamXsd", recipeParamXsd)]]></bpmn:script>
+execution.setVariable("recipeParamXsd", recipeParamXsd)</bpmn:script>
</bpmn:scriptTask>
<bpmn:scriptTask id="Task_13sx2bp" name="Pre Process Request" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0w2es8j</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_18l3crb</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
def dcsi = new CreateSDNCNetworkResource()
-dcsi.preProcessRequest(execution)]]></bpmn:script>
+dcsi.preProcessRequest(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:sequenceFlow id="SequenceFlow_1mz0vdx" sourceRef="Task_0tezqd4" targetRef="Task_18tomkl" />
<bpmn:sequenceFlow id="SequenceFlow_15mvedq" sourceRef="Task_18tomkl" targetRef="CallActivity_1600xlj" />
<bpmn:scriptTask id="Task_0tezqd4" name="Create progress update parameters before create" scriptFormat="groovy">
<bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming>
<bpmn:outgoing>SequenceFlow_1mz0vdx</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
def dcsi = new CreateSDNCNetworkResource()
-dcsi.prepareUpdateBeforeCreateSDNCResource(execution)]]></bpmn:script>
- </bpmn:scriptTask>
- <bpmn:scriptTask id="Task_0uwlr22" name="Create progress update parameters After create" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_1xk5xed</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1jr6zi0</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
-def dcsi = new CreateSDNCNetworkResource()
-dcsi.prepareUpdateAfterCreateSDNCResource(execution)]]></bpmn:script>
+dcsi.prepareUpdateBeforeCreateSDNCResource(execution)</bpmn:script>
</bpmn:scriptTask>
<bpmn:serviceTask id="Task_18tomkl" name="update progress update">
<bpmn:extensionElements>
<camunda:connectorId>http-connector</camunda:connectorId>
</camunda:connector>
</bpmn:extensionElements>
- <bpmn:incoming>SequenceFlow_1jr6zi0</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_1vnx1pp</bpmn:outgoing>
+ <bpmn:incoming>SequenceFlow_1kzj1j5</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0o7h0ag</bpmn:outgoing>
</bpmn:serviceTask>
- <bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" />
- <bpmn:sequenceFlow id="SequenceFlow_1vnx1pp" sourceRef="ServiceTask_1cm8iwr" targetRef="Task_023hred" />
<bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
- <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
- <bpmn:outgoing>SequenceFlow_17md60u</bpmn:outgoing>
- <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+ <bpmn:incoming>SequenceFlow_1cd8ujq</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0auvfvm</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
def csi = new CreateSDNCNetworkResource()
-csi.sendSyncResponse(execution)]]></bpmn:script>
+csi.sendSyncResponse(execution)</bpmn:script>
</bpmn:scriptTask>
- <bpmn:sequenceFlow id="SequenceFlow_17md60u" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:exclusiveGateway id="ExclusiveGateway_0cdulnk" name="is activate required">
+ <bpmn:incoming>SequenceFlow_0o7h0ag</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1dww8ye</bpmn:outgoing>
+ <bpmn:outgoing>SequenceFlow_05m2j56</bpmn:outgoing>
+ </bpmn:exclusiveGateway>
+ <bpmn:sequenceFlow id="SequenceFlow_1dww8ye" name="yes" sourceRef="ExclusiveGateway_0cdulnk" targetRef="Task_0bga3e8" />
+ <bpmn:sequenceFlow id="SequenceFlow_1ex9ov6" sourceRef="CallActivity_1600xlj" targetRef="Task_023hred" />
+ <bpmn:sequenceFlow id="SequenceFlow_1kzj1j5" sourceRef="Task_023hred" targetRef="ServiceTask_1cm8iwr" />
+ <bpmn:sequenceFlow id="SequenceFlow_0o7h0ag" sourceRef="ServiceTask_1cm8iwr" targetRef="ExclusiveGateway_0cdulnk" />
+ <bpmn:scriptTask id="Task_0uwlr22" name="Create progress update parameters After create" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_05m2j56</bpmn:incoming>
+ <bpmn:incoming>SequenceFlow_05niqbf</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1cd8ujq</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new CreateSDNCNetworkResource()
+dcsi.prepareUpdateAfterCreateSDNCResource(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_05m2j56" name="No" sourceRef="ExclusiveGateway_0cdulnk" targetRef="Task_0uwlr22" />
+ <bpmn:sequenceFlow id="SequenceFlow_05niqbf" sourceRef="Task_0bga3e8" targetRef="Task_0uwlr22" />
+ <bpmn:sequenceFlow id="SequenceFlow_1cd8ujq" sourceRef="Task_0uwlr22" targetRef="ScriptTask_1g5zyi6" />
+ <bpmn:sequenceFlow id="SequenceFlow_0auvfvm" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:callActivity id="Task_0bga3e8" name="call Activate SDNC network Resource" calledElement="ActivateSDNCNetworkResource">
+ <bpmn:incoming>SequenceFlow_1dww8ye</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_05niqbf</bpmn:outgoing>
+ </bpmn:callActivity>
</bpmn:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateSDNCNetworkResource">
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln">
- <di:waypoint xsi:type="dc:Point" x="-75" y="129" />
- <di:waypoint xsi:type="dc:Point" x="-10" y="129" />
+ <di:waypoint x="-75" y="129" />
+ <di:waypoint x="-10" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="-87.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova">
- <di:waypoint xsi:type="dc:Point" x="413" y="129" />
- <di:waypoint xsi:type="dc:Point" x="460" y="129" />
- <di:waypoint xsi:type="dc:Point" x="500" y="129" />
+ <di:waypoint x="413" y="129" />
+ <di:waypoint x="460" y="129" />
+ <di:waypoint x="500" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="391.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
<dc:Bounds x="313" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
- <dc:Bounds x="1040" y="317" width="36" height="36" />
+ <dc:Bounds x="1046" y="317" width="36" height="36" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="1004" y="359" width="81" height="28" />
+ <dc:Bounds x="1009" y="359" width="84" height="27" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj">
- <dc:Bounds x="109" y="295" width="100" height="80" />
+ <dc:Bounds x="-10" y="295" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1xk5xed_di" bpmnElement="SequenceFlow_1xk5xed">
- <di:waypoint xsi:type="dc:Point" x="209" y="335" />
- <di:waypoint xsi:type="dc:Point" x="302" y="335" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="210.5" y="314" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
- <di:waypoint xsi:type="dc:Point" x="795" y="335" />
- <di:waypoint xsi:type="dc:Point" x="856" y="335" />
- <bpmndi:BPMNLabel>
- <dc:Bounds x="780.5" y="314" width="90" height="12" />
- </bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
<bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred">
- <dc:Bounds x="695" y="295" width="100" height="80" />
+ <dc:Bounds x="172" y="295" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_0w2es8j_di" bpmnElement="SequenceFlow_0w2es8j">
- <di:waypoint xsi:type="dc:Point" x="90" y="129" />
- <di:waypoint xsi:type="dc:Point" x="148" y="129" />
+ <di:waypoint x="90" y="129" />
+ <di:waypoint x="148" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="74" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb">
- <di:waypoint xsi:type="dc:Point" x="248" y="129" />
- <di:waypoint xsi:type="dc:Point" x="313" y="129" />
+ <di:waypoint x="248" y="129" />
+ <di:waypoint x="313" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="235.5" y="108" width="90" height="12" />
</bpmndi:BPMNLabel>
<dc:Bounds x="148" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1mz0vdx_di" bpmnElement="SequenceFlow_1mz0vdx">
- <di:waypoint xsi:type="dc:Point" x="606" y="129" />
- <di:waypoint xsi:type="dc:Point" x="638" y="129" />
- <di:waypoint xsi:type="dc:Point" x="638" y="129" />
- <di:waypoint xsi:type="dc:Point" x="738" y="129" />
+ <di:waypoint x="606" y="129" />
+ <di:waypoint x="638" y="129" />
+ <di:waypoint x="638" y="129" />
+ <di:waypoint x="738" y="129" />
<bpmndi:BPMNLabel>
<dc:Bounds x="608" y="123" width="90" height="12" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_15mvedq_di" bpmnElement="SequenceFlow_15mvedq">
- <di:waypoint xsi:type="dc:Point" x="788" y="169" />
- <di:waypoint xsi:type="dc:Point" x="788" y="218" />
- <di:waypoint xsi:type="dc:Point" x="0" y="218" />
- <di:waypoint xsi:type="dc:Point" x="0" y="335" />
- <di:waypoint xsi:type="dc:Point" x="109" y="335" />
+ <di:waypoint x="788" y="169" />
+ <di:waypoint x="788" y="218" />
+ <di:waypoint x="-89" y="218" />
+ <di:waypoint x="-89" y="335" />
+ <di:waypoint x="-10" y="335" />
<bpmndi:BPMNLabel>
<dc:Bounds x="349" y="197" width="90" height="12" />
</bpmndi:BPMNLabel>
<bpmndi:BPMNShape id="ScriptTask_1kqf4ge_di" bpmnElement="Task_0tezqd4">
<dc:Bounds x="506" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNShape id="ScriptTask_0hu4lhm_di" bpmnElement="Task_0uwlr22">
- <dc:Bounds x="302" y="295" width="100" height="80" />
- </bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1q6ssz7_di" bpmnElement="Task_18tomkl">
<dc:Bounds x="738" y="89" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="ServiceTask_1cm8iwr_di" bpmnElement="ServiceTask_1cm8iwr">
- <dc:Bounds x="487" y="295" width="100" height="80" />
+ <dc:Bounds x="366" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="890" y="295" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_1jr6zi0_di" bpmnElement="SequenceFlow_1jr6zi0">
- <di:waypoint xsi:type="dc:Point" x="402" y="335" />
- <di:waypoint xsi:type="dc:Point" x="487" y="335" />
+ <bpmndi:BPMNShape id="ExclusiveGateway_0cdulnk_di" bpmnElement="ExclusiveGateway_0cdulnk" isMarkerVisible="true">
+ <dc:Bounds x="539" y="310" width="50" height="50" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="444.5" y="314" width="0" height="12" />
+ <dc:Bounds x="539" y="273" width="49" height="27" />
</bpmndi:BPMNLabel>
- </bpmndi:BPMNEdge>
- <bpmndi:BPMNEdge id="SequenceFlow_1vnx1pp_di" bpmnElement="SequenceFlow_1vnx1pp">
- <di:waypoint xsi:type="dc:Point" x="587" y="335" />
- <di:waypoint xsi:type="dc:Point" x="695" y="335" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1dww8ye_di" bpmnElement="SequenceFlow_1dww8ye">
+ <di:waypoint x="564" y="360" />
+ <di:waypoint x="564" y="471" />
+ <di:waypoint x="608" y="471" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="641" y="314" width="0" height="12" />
+ <dc:Bounds x="571" y="391" width="18" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
- <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
- <dc:Bounds x="856" y="295" width="100" height="80" />
+ <bpmndi:BPMNEdge id="SequenceFlow_1ex9ov6_di" bpmnElement="SequenceFlow_1ex9ov6">
+ <di:waypoint x="90" y="335" />
+ <di:waypoint x="172" y="335" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1kzj1j5_di" bpmnElement="SequenceFlow_1kzj1j5">
+ <di:waypoint x="272" y="335" />
+ <di:waypoint x="366" y="335" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0o7h0ag_di" bpmnElement="SequenceFlow_0o7h0ag">
+ <di:waypoint x="466" y="335" />
+ <di:waypoint x="539" y="335" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0hu4lhm_di" bpmnElement="Task_0uwlr22">
+ <dc:Bounds x="721" y="295" width="100" height="80" />
</bpmndi:BPMNShape>
- <bpmndi:BPMNEdge id="SequenceFlow_17md60u_di" bpmnElement="SequenceFlow_17md60u">
- <di:waypoint xsi:type="dc:Point" x="956" y="335" />
- <di:waypoint xsi:type="dc:Point" x="1040" y="335" />
+ <bpmndi:BPMNEdge id="SequenceFlow_05m2j56_di" bpmnElement="SequenceFlow_05m2j56">
+ <di:waypoint x="589" y="335" />
+ <di:waypoint x="721" y="335" />
<bpmndi:BPMNLabel>
- <dc:Bounds x="998" y="313" width="0" height="14" />
+ <dc:Bounds x="648" y="317" width="14" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_05niqbf_di" bpmnElement="SequenceFlow_05niqbf">
+ <di:waypoint x="708" y="471" />
+ <di:waypoint x="771" y="471" />
+ <di:waypoint x="771" y="375" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1cd8ujq_di" bpmnElement="SequenceFlow_1cd8ujq">
+ <di:waypoint x="821" y="335" />
+ <di:waypoint x="890" y="335" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0auvfvm_di" bpmnElement="SequenceFlow_0auvfvm">
+ <di:waypoint x="990" y="335" />
+ <di:waypoint x="1046" y="335" />
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="CallActivity_0aywvn3_di" bpmnElement="Task_0bga3e8">
+ <dc:Bounds x="608" y="431" width="100" height="80" />
+ </bpmndi:BPMNShape>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn:definitions>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.16.2">
+ <bpmn:process id="ActivateSDNCNetworkResource" name="ActivateSDNCNetworkResource" isExecutable="true">
+ <bpmn:startEvent id="createNS_StartEvent" name="createNS_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1c92ks3</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:endEvent id="EndEvent_1x6k78c" name="create SDNC call end">
+ <bpmn:incoming>SequenceFlow_17md60u</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:callActivity id="CallActivity_1600xlj" name="Call SDNC resource activate Adapter V1 " calledElement="sdncAdapter">
+ <bpmn:extensionElements>
+ <camunda:in source="CRESDNCRES_activateSDNCRequest" target="sdncAdapterWorkflowRequest" />
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+ <camunda:out source="sdncAdapterResponse" target="CRENWKI_activateSDNCResponse" />
+ <camunda:out source="SDNCA_ResponseCode" target="CRESDNCRES_sdncCreateReturnCode" />
+ <camunda:out source="SDNCA_SuccessIndicator" target="CRESDNCRES_SuccessIndicator" />
+ <camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_18l3crb</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0uwlr22" />
+ <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="ScriptTask_1g5zyi6" />
+ <bpmn:scriptTask id="Task_023hred" name="post SDNC activate call">
+ <bpmn:incoming>SequenceFlow_1vnx1pp</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new ActivateSDNCNetworkResource()
+dcsi.postCreateSDNCCall(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_18l3crb" sourceRef="Task_13sx2bp" targetRef="CallActivity_1600xlj" />
+ <bpmn:scriptTask id="Task_13sx2bp" name="Pre Process Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1c92ks3</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_18l3crb</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new ActivateSDNCNetworkResource()
+dcsi.preProcessRequest(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:scriptTask id="Task_0uwlr22" name="Create progress update parameters After create" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1xk5xed</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1jr6zi0</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new ActivateSDNCNetworkResource()
+dcsi.prepareUpdateAfterActivateSDNCResource(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:serviceTask id="ServiceTask_1cm8iwr" name="update progress update">
+ <bpmn:extensionElements>
+ <camunda:connector>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter>
+ <camunda:inputParameter name="headers">
+ <camunda:map>
+ <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+ <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry>
+ </camunda:map>
+ </camunda:inputParameter>
+ <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter>
+ <camunda:inputParameter name="method">POST</camunda:inputParameter>
+ <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter>
+ <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter>
+ </camunda:inputOutput>
+ <camunda:connectorId>http-connector</camunda:connectorId>
+ </camunda:connector>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1jr6zi0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1vnx1pp</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" />
+ <bpmn:sequenceFlow id="SequenceFlow_1vnx1pp" sourceRef="ServiceTask_1cm8iwr" targetRef="Task_023hred" />
+ <bpmn:scriptTask id="ScriptTask_1g5zyi6" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_17md60u</bpmn:outgoing>
+ <bpmn:script>import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new ActivateSDNCNetworkResource()
+csi.sendSyncResponse(execution)</bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_17md60u" sourceRef="ScriptTask_1g5zyi6" targetRef="EndEvent_1x6k78c" />
+ <bpmn:sequenceFlow id="SequenceFlow_1c92ks3" sourceRef="createNS_StartEvent" targetRef="Task_13sx2bp" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="ActivateSDNCNetworkResource">
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="createNS_StartEvent">
+ <dc:Bounds x="-203" y="306" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-230" y="352" width="89" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
+ <dc:Bounds x="930" y="306" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="893" y="348" width="84" height="27" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj">
+ <dc:Bounds x="77" y="284" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1xk5xed_di" bpmnElement="SequenceFlow_1xk5xed">
+ <di:waypoint x="177" y="324" />
+ <di:waypoint x="247" y="324" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="210.5" y="314" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
+ <di:waypoint x="694" y="324" />
+ <di:waypoint x="765" y="324" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="780.5" y="314" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred">
+ <dc:Bounds x="594" y="284" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb">
+ <di:waypoint x="12" y="324" />
+ <di:waypoint x="77" y="324" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="235.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_14l9mlv_di" bpmnElement="Task_13sx2bp">
+ <dc:Bounds x="-88" y="284" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_0hu4lhm_di" bpmnElement="Task_0uwlr22">
+ <dc:Bounds x="247" y="284" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1cm8iwr_di" bpmnElement="ServiceTask_1cm8iwr">
+ <dc:Bounds x="417" y="284" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1jr6zi0_di" bpmnElement="SequenceFlow_1jr6zi0">
+ <di:waypoint x="347" y="324" />
+ <di:waypoint x="417" y="324" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="444.5" y="314" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1vnx1pp_di" bpmnElement="SequenceFlow_1vnx1pp">
+ <di:waypoint x="517" y="324" />
+ <di:waypoint x="594" y="324" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="641" y="314" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_1g5zyi6_di" bpmnElement="ScriptTask_1g5zyi6">
+ <dc:Bounds x="765" y="284" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_17md60u_di" bpmnElement="SequenceFlow_17md60u">
+ <di:waypoint x="865" y="324" />
+ <di:waypoint x="930" y="324" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="998" y="313" width="0" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1c92ks3_di" bpmnElement="SequenceFlow_1c92ks3">
+ <di:waypoint x="-167" y="324" />
+ <di:waypoint x="-88" y="324" />
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="1.10.0">
+ <bpmn:process id="DeleteSDNCNetworkResource" name="DeleteSDNCNetworkResource" isExecutable="true">
+ <bpmn:startEvent id="deleteNetworkResource_StartEvent" name="deleteNetworkResource_StartEvent">
+ <bpmn:outgoing>SequenceFlow_1qo2pln</bpmn:outgoing>
+ </bpmn:startEvent>
+ <bpmn:sequenceFlow id="SequenceFlow_1qo2pln" sourceRef="deleteNetworkResource_StartEvent" targetRef="Task_1dlrfiw" />
+ <bpmn:sequenceFlow id="SequenceFlow_0khtova" sourceRef="PreprocessIncomingRequest_task" targetRef="Task_0tezqd4" />
+ <bpmn:scriptTask id="PreprocessIncomingRequest_task" name="prepare SDNC Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_18l3crb</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0khtova</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteSDNCNetworkResource()
+dcsi.prepareSDNCRequest(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:endEvent id="EndEvent_1x6k78c" name="delete SDNC call end">
+ <bpmn:incoming>SequenceFlow_15wux6a</bpmn:incoming>
+ </bpmn:endEvent>
+ <bpmn:callActivity id="CallActivity_1600xlj" name="Call SDNC RSRC Adapter V1 " calledElement="sdncAdapter">
+ <bpmn:extensionElements>
+ <camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" />
+ <camunda:in source="mso-request-id" target="mso-request-id" />
+ <camunda:in source="mso-service-instance-id" target="mso-service-instance-id" />
+ <camunda:out source="sdncAdapterResponse" target="DELSDNCRES_activateSDNCResponse" />
+ <camunda:out source="SDNCA_ResponseCode" target="DELSDNCRES_sdncDeleteReturnCode" />
+ <camunda:out source="SDNCA_SuccessIndicator" target="DELSDNCRES_SuccessIndicator" />
+ <camunda:out source="WorkflowException" target="WorkflowException" />
+ <camunda:in source="sdncAdapterWorkflowRequest" target="sdncAdapterWorkflowRequest" />
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_15mvedq</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1xk5xed</bpmn:outgoing>
+ </bpmn:callActivity>
+ <bpmn:sequenceFlow id="SequenceFlow_1xk5xed" sourceRef="CallActivity_1600xlj" targetRef="Task_0uwlr22" />
+ <bpmn:sequenceFlow id="SequenceFlow_0ow44q0" sourceRef="Task_023hred" targetRef="ScriptTask_1emjxm2" />
+ <bpmn:scriptTask id="Task_023hred" name="post SDNC delete call">
+ <bpmn:incoming>SequenceFlow_1vnx1pp</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0ow44q0</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteSDNCNetworkResource()
+dcsi.postDeleteSDNCCall(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_0w2es8j" sourceRef="Task_1dlrfiw" targetRef="Task_13sx2bp" />
+ <bpmn:sequenceFlow id="SequenceFlow_18l3crb" sourceRef="Task_13sx2bp" targetRef="PreprocessIncomingRequest_task" />
+ <bpmn:scriptTask id="Task_1dlrfiw" name="Set the Recipe DesignTimeParam" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1qo2pln</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_0w2es8j</bpmn:outgoing>
+ <bpmn:script><![CDATA[String recipeParamXsdDemo="""{"operationType":"GRE"}"""
+String recipeParamXsd=""
+execution.setVariable("recipeParamXsd", recipeParamXsd)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:scriptTask id="Task_13sx2bp" name="Pre Process Request" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0w2es8j</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_18l3crb</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteSDNCNetworkResource()
+dcsi.preProcessRequest(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1mz0vdx" sourceRef="Task_0tezqd4" targetRef="Task_18tomkl" />
+ <bpmn:sequenceFlow id="SequenceFlow_15mvedq" sourceRef="Task_18tomkl" targetRef="CallActivity_1600xlj" />
+ <bpmn:scriptTask id="Task_0tezqd4" name="Delete progress update parameters before delete" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0khtova</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1mz0vdx</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteSDNCNetworkResource()
+dcsi.prepareUpdateBeforeDeleteSDNCResource(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:scriptTask id="Task_0uwlr22" name="Create progress update parameters After delete" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_1xk5xed</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1jr6zi0</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def dcsi = new DeleteSDNCNetworkResource()
+dcsi.prepareUpdateAfterDeleteSDNCResource(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:serviceTask id="Task_18tomkl" name="update progress update">
+ <bpmn:extensionElements>
+ <camunda:connector>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter>
+ <camunda:inputParameter name="headers">
+ <camunda:map>
+ <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+ <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry>
+ </camunda:map>
+ </camunda:inputParameter>
+ <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter>
+ <camunda:inputParameter name="method">POST</camunda:inputParameter>
+ <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter>
+ <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter>
+ </camunda:inputOutput>
+ <camunda:connectorId>http-connector</camunda:connectorId>
+ </camunda:connector>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1mz0vdx</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_15mvedq</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:serviceTask id="ServiceTask_1cm8iwr" name="update progress update">
+ <bpmn:extensionElements>
+ <camunda:connector>
+ <camunda:inputOutput>
+ <camunda:inputParameter name="url">${CVFMI_dbAdapterEndpoint}</camunda:inputParameter>
+ <camunda:inputParameter name="headers">
+ <camunda:map>
+ <camunda:entry key="content-type">application/soap+xml</camunda:entry>
+ <camunda:entry key="Authorization">Basic QlBFTENsaWVudDpwYXNzd29yZDEk</camunda:entry>
+ </camunda:map>
+ </camunda:inputParameter>
+ <camunda:inputParameter name="payload">${CVFMI_updateResOperStatusRequest}</camunda:inputParameter>
+ <camunda:inputParameter name="method">POST</camunda:inputParameter>
+ <camunda:outputParameter name="CVFMI_dbResponseCode">${statusCode}</camunda:outputParameter>
+ <camunda:outputParameter name="CVFMI_dbResponse">${response}</camunda:outputParameter>
+ </camunda:inputOutput>
+ <camunda:connectorId>http-connector</camunda:connectorId>
+ </camunda:connector>
+ </bpmn:extensionElements>
+ <bpmn:incoming>SequenceFlow_1jr6zi0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_1vnx1pp</bpmn:outgoing>
+ </bpmn:serviceTask>
+ <bpmn:sequenceFlow id="SequenceFlow_1jr6zi0" sourceRef="Task_0uwlr22" targetRef="ServiceTask_1cm8iwr" />
+ <bpmn:sequenceFlow id="SequenceFlow_1vnx1pp" sourceRef="ServiceTask_1cm8iwr" targetRef="Task_023hred" />
+ <bpmn:scriptTask id="ScriptTask_1emjxm2" name="Send Sync Ack Response" scriptFormat="groovy">
+ <bpmn:incoming>SequenceFlow_0ow44q0</bpmn:incoming>
+ <bpmn:outgoing>SequenceFlow_15wux6a</bpmn:outgoing>
+ <bpmn:script><![CDATA[import org.openecomp.mso.bpmn.infrastructure.scripts.*
+def csi = new DeleteSDNCNetworkResource()
+csi.sendSyncResponse(execution)]]></bpmn:script>
+ </bpmn:scriptTask>
+ <bpmn:sequenceFlow id="SequenceFlow_15wux6a" sourceRef="ScriptTask_1emjxm2" targetRef="EndEvent_1x6k78c" />
+ </bpmn:process>
+ <bpmndi:BPMNDiagram id="BPMNDiagram_1">
+ <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="DeleteSDNCNetworkResource">
+ <bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="deleteNetworkResource_StartEvent">
+ <dc:Bounds x="-111" y="111" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-136" y="147" width="89" height="28" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1qo2pln_di" bpmnElement="SequenceFlow_1qo2pln">
+ <di:waypoint xsi:type="dc:Point" x="-75" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="-10" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="-87.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0khtova_di" bpmnElement="SequenceFlow_0khtova">
+ <di:waypoint xsi:type="dc:Point" x="413" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="460" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="500" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="391.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_03j6ogo_di" bpmnElement="PreprocessIncomingRequest_task">
+ <dc:Bounds x="313" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="EndEvent_15pcuuc_di" bpmnElement="EndEvent_1x6k78c">
+ <dc:Bounds x="967" y="317" width="36" height="36" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="933" y="359" width="79" height="28" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="CallActivity_1600xlj_di" bpmnElement="CallActivity_1600xlj">
+ <dc:Bounds x="109" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1xk5xed_di" bpmnElement="SequenceFlow_1xk5xed">
+ <di:waypoint xsi:type="dc:Point" x="209" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="302" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="210.5" y="314" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_0ow44q0_di" bpmnElement="SequenceFlow_0ow44q0">
+ <di:waypoint xsi:type="dc:Point" x="735" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="793" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="719" y="314" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0gyej62_di" bpmnElement="Task_023hred">
+ <dc:Bounds x="635" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_0w2es8j_di" bpmnElement="SequenceFlow_0w2es8j">
+ <di:waypoint xsi:type="dc:Point" x="90" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="148" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="74" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_18l3crb_di" bpmnElement="SequenceFlow_18l3crb">
+ <di:waypoint xsi:type="dc:Point" x="248" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="313" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="235.5" y="108" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_0lc6l7a_di" bpmnElement="Task_1dlrfiw">
+ <dc:Bounds x="-10" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_14l9mlv_di" bpmnElement="Task_13sx2bp">
+ <dc:Bounds x="148" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1mz0vdx_di" bpmnElement="SequenceFlow_1mz0vdx">
+ <di:waypoint xsi:type="dc:Point" x="606" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="638" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="638" y="129" />
+ <di:waypoint xsi:type="dc:Point" x="738" y="129" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="608" y="123" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_15mvedq_di" bpmnElement="SequenceFlow_15mvedq">
+ <di:waypoint xsi:type="dc:Point" x="788" y="169" />
+ <di:waypoint xsi:type="dc:Point" x="788" y="218" />
+ <di:waypoint xsi:type="dc:Point" x="0" y="218" />
+ <di:waypoint xsi:type="dc:Point" x="0" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="109" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="349" y="197" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_1kqf4ge_di" bpmnElement="Task_0tezqd4">
+ <dc:Bounds x="506" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ScriptTask_0hu4lhm_di" bpmnElement="Task_0uwlr22">
+ <dc:Bounds x="302" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1q6ssz7_di" bpmnElement="Task_18tomkl">
+ <dc:Bounds x="738" y="89" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNShape id="ServiceTask_1cm8iwr_di" bpmnElement="ServiceTask_1cm8iwr">
+ <dc:Bounds x="487" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_1jr6zi0_di" bpmnElement="SequenceFlow_1jr6zi0">
+ <di:waypoint xsi:type="dc:Point" x="402" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="487" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="444.5" y="314" width="0" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNEdge id="SequenceFlow_1vnx1pp_di" bpmnElement="SequenceFlow_1vnx1pp">
+ <di:waypoint xsi:type="dc:Point" x="587" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="635" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="566" y="314" width="90" height="12" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ <bpmndi:BPMNShape id="ScriptTask_1emjxm2_di" bpmnElement="ScriptTask_1emjxm2">
+ <dc:Bounds x="793" y="295" width="100" height="80" />
+ </bpmndi:BPMNShape>
+ <bpmndi:BPMNEdge id="SequenceFlow_15wux6a_di" bpmnElement="SequenceFlow_15wux6a">
+ <di:waypoint xsi:type="dc:Point" x="893" y="335" />
+ <di:waypoint xsi:type="dc:Point" x="967" y="335" />
+ <bpmndi:BPMNLabel>
+ <dc:Bounds x="930" y="313" width="0" height="14" />
+ </bpmndi:BPMNLabel>
+ </bpmndi:BPMNEdge>
+ </bpmndi:BPMNPlane>
+ </bpmndi:BPMNDiagram>
+</bpmn:definitions>
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.junit.Test;
+import org.onap.aai.domain.yang.Pnf;
public class CreateAaiEntryWithPnfIdDelegateTest {
// when
delegate.execute(execution);
// then
- assertThat(aaiConnection.getCreated().get("testCorrelationId").getPnfId()).isEqualTo("testCorrelationId");
- assertThat(aaiConnection.getCreated().get("testCorrelationId").getPnfName()).isEqualTo("testCorrelationId");
+ Pnf createdEntry = aaiConnection.getCreated().get("testCorrelationId");
+ assertThat(createdEntry.getPnfId()).isEqualTo("testCorrelationId");
+ assertThat(createdEntry.getPnfName()).isEqualTo("testCorrelationId");
+ assertThat(createdEntry.isInMaint()).isTrue();
}
}
\ No newline at end of file
private Map<String, String> createProperties() {
Map<String, String> map = new HashMap<>();
- map.put("dmaapHost", HOST);
- map.put("dmaapPort", String.valueOf(PORT));
+ map.put("mso.dmaap.host", HOST);
+ map.put("mso.dmaap.port", String.valueOf(PORT));
return map;
}
\r
} catch (Exception e) \r
{\r
- \r
- e.printStackTrace();\r
+ msoLogger.error("Exception while executing query", e);\r
} finally {\r
try { r.close(); } catch (Exception e) { /* ignored */ }\r
try { psData.close(); } catch (Exception e) { /* ignored */ }\r
} \r
\r
} catch (Exception e) \r
- {\r
- \r
- e.printStackTrace();\r
+ {\r
+ msoLogger.error("Exception while performing JNDI lookup", e);\r
}\r
\r
return conn;\r
\r
} catch (Exception e) \r
{\r
- \r
- e.printStackTrace();\r
+ msoLogger.error("Exception while executing query", e);\r
} finally {\r
try { psData.close(); } catch (Exception e) { /* ignored */ }\r
try { conn.close(); } catch (Exception e) { /* ignored */ }\r
\r
} catch (Exception e) \r
{\r
- \r
- e.printStackTrace();\r
+ msoLogger.error("Exception while executing query", e);\r
} finally {\r
try { psData.close(); } catch (Exception e) { /* ignored */ }\r
try { conn.close(); } catch (Exception e) { /* ignored */ }\r
}
catch (Exception e) {
// Catchall for anything else, must throw as a RuntimeException
- e.printStackTrace();
+ LOGGER.error("Client exception", e);
throw new RuntimeException("Unexpected client exception", e);
}
finally {
public DefaultAAIPropertiesImpl() {
File initialFile = new File("src/test/resources/aai.properties");
Map<Object, Object> temp;
- try {
- InputStream targetStream = new FileInputStream(initialFile);
+ try(InputStream targetStream = new FileInputStream(initialFile)) {
Properties properties = new Properties();
properties.load(targetStream);
temp = properties;
final Map<Object, Object> props;
public PolicyRestPropertiesImpl() {
File initialFile = new File("src/test/resources/policy.properties");
- InputStream targetStream;
+
Map<Object, Object> temp;
- try {
- targetStream = new FileInputStream(initialFile);
+ try(InputStream targetStream = new FileInputStream(initialFile)) {
Properties properties = new Properties();
properties.load(targetStream);
temp = properties;
AAIResultWrapper aaiResult = aaiHelper.getAaiOperationalEnvironment(operationalEnvironmentId);\r
operationalEnv = aaiResult.asBean(AAIOperationalEnvironment.class).get();\r
} catch (JsonParseException e) {\r
- msoLogger.debug(" **** JsonParseException: " + e.getMessage());\r
- e.printStackTrace();\r
+ msoLogger.error(" **** JsonParseException: ", e);\r
} catch (JsonMappingException e) {\r
- msoLogger.debug(" **** JsonMappingException: " + e.getMessage());\r
- e.printStackTrace();\r
+ msoLogger.error(" **** JsonMappingException: ", e);\r
} catch (IOException e) {\r
- msoLogger.debug(" **** IOException: " + e.getMessage());\r
- e.printStackTrace();\r
+ msoLogger.error(" **** IOException: ", e);\r
} catch (Exception e) {\r
- msoLogger.debug(" **** Exception: " + e.getMessage());\r
- e.printStackTrace();\r
+ msoLogger.error(" **** Exception: ", e);\r
}\r
\r
return operationalEnv;\r
getRequestDb().updateInfraSuccessCompletion("SUCCESSFULLY Created ECOMP OperationalEnvironment.", getRequestId(), getRequest().getOperationalEnvironmentId());
}
catch (Exception e) {
- e.printStackTrace();
+ msoLogger.error("exception while publishing operational environment", e);
msoLogger.error(MessageEnum.APIH_GENERAL_EXCEPTION, "", "", "", MsoLogger.ErrorCode.UnknownError, e.getMessage());
getRequestDb().updateInfraFailureCompletion(e.getMessage(), getRequestId(), getRequest().getOperationalEnvironmentId());
}
</build>
</image>
<image>
- <name>openecomp/mso:%l</name>
- <alias>onap/so:%1</alias>
+ <name>onap/so:%l</name>
+ <alias>openecomp/mso:%l</alias>
<alias>mso</alias>
<alias>so</alias>
<build>