From 032929d287cbafefe8367e0fcee18dec4b1bf9f7 Mon Sep 17 00:00:00 2001 From: vempo Date: Mon, 22 Oct 2018 11:33:19 +0300 Subject: Deleted deprecated workflow project Change-Id: I2ad75adab7d47d8df5b3996a315a9b173fa4bbfe Issue-ID: SDC-1855 Signed-off-by: vempo --- .../ActivitySpecServiceProxyInfo.java | 97 ------- .../sdc/workflowdesigner/SDCServiceProxyInfo.java | 74 ------ .../sdc/workflowdesigner/WorkflowDesignerApp.java | 106 -------- .../WorkflowDesignerConfiguration.java | 103 -------- .../common/ActivitySpecProxyException.java | 34 --- .../workflowdesigner/common/SDCProxyException.java | 33 --- .../sdc/workflowdesigner/config/AdapterType.java | 20 -- .../sdc/workflowdesigner/config/AppConfig.java | 81 ------ .../onap/sdc/workflowdesigner/config/Config.java | 54 ---- .../externalservice/sdc/ActivitySpecService.java | 51 ---- .../sdc/ActivitySpecServiceProxy.java | 89 ------- .../externalservice/sdc/SDCService.java | 51 ---- .../externalservice/sdc/SDCServiceProxy.java | 94 ------- .../sdc/entity/ActivityContent.java | 59 ----- .../externalservice/sdc/entity/ActivitySpec.java | 179 ------------- .../sdc/entity/GenericCollectionWrapper.java | 61 ----- .../externalservice/sdc/entity/Parameter.java | 87 ------- .../sdc/entity/WorkflowArtifactInfo.java | 102 -------- .../sdc/workflowdesigner/model/DataObject.java | 42 --- .../onap/sdc/workflowdesigner/model/Element.java | 85 ------ .../onap/sdc/workflowdesigner/model/EndEvent.java | 16 -- .../sdc/workflowdesigner/model/ErrorEndEvent.java | 28 -- .../workflowdesigner/model/ErrorStartEvent.java | 28 -- .../workflowdesigner/model/ExclusiveGateway.java | 16 -- .../model/IntermediateCatchEvent.java | 25 -- .../workflowdesigner/model/ParallelGateway.java | 16 -- .../onap/sdc/workflowdesigner/model/Parameter.java | 103 -------- .../onap/sdc/workflowdesigner/model/Position.java | 33 --- .../onap/sdc/workflowdesigner/model/Process.java | 67 ----- .../workflowdesigner/model/RestServiceTask.java | 95 ------- .../sdc/workflowdesigner/model/ScriptTask.java | 33 --- .../sdc/workflowdesigner/model/SequenceFlow.java | 70 ----- .../sdc/workflowdesigner/model/ServiceTask.java | 44 ---- .../sdc/workflowdesigner/model/StartEvent.java | 29 --- .../model/TimerEventDefinition.java | 52 ---- .../parser/Bpmn4ToscaJsonParser.java | 216 ---------------- .../onap/sdc/workflowdesigner/parser/JsonKeys.java | 92 ------- .../resources/ExtendActivityResource.java | 283 -------------------- .../resources/HealthCheckResource.java | 51 ---- .../resources/WorkflowModelerResource.java | 267 ------------------- .../resources/entity/CategoryData.java | 65 ----- .../workflowdesigner/resources/entity/Content.java | 95 ------- .../resources/entity/ExtActivity.java | 120 --------- .../resources/entity/ExtActivityDisplayInfo.java | 53 ---- .../resources/entity/I18nString.java | 69 ----- .../resources/entity/IconData.java | 68 ----- .../resources/entity/InputOutput.java | 135 ---------- .../resources/entity/NodeCategory.java | 34 --- .../resources/entity/WorkflowInfo.java | 133 ---------- .../utils/FileCommonConstants.java | 21 -- .../workflowdesigner/utils/FileCommonUtils.java | 287 --------------------- .../onap/sdc/workflowdesigner/utils/JsonUtils.java | 41 --- .../onap/sdc/workflowdesigner/utils/RestUtils.java | 28 -- .../onap/sdc/workflowdesigner/utils/ToolUtils.java | 26 -- .../utils/entity/CommonErrorResponse.java | 56 ---- .../writer/BpmnPlanArtefactWriter.java | 64 ----- 56 files changed, 4361 deletions(-) delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java delete mode 100644 deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java (limited to 'deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap') diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java deleted file mode 100644 index fb82e506..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/ActivitySpecServiceProxyInfo.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ - -package org.onap.sdc.workflowdesigner; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * - */ -public class ActivitySpecServiceProxyInfo { - private String serviceAddr; - - private String xEcompInstanceId; - - private String authorization; - - private String userId; - - /** - * @return the serviceAddr - */ - @JsonProperty - public String getServiceAddr() { - return serviceAddr; - } - - /** - * @param serviceAddr the serviceAddr to set - */ - @JsonProperty - public void setServiceAddr(String serviceAddr) { - this.serviceAddr = serviceAddr; - } - - /** - * @return the xEcompInstanceId - */ - @JsonProperty - public String getxEcompInstanceId() { - return xEcompInstanceId; - } - - /** - * @param xEcompInstanceId the xEcompInstanceId to set - */ - @JsonProperty - public void setxEcompInstanceId(String xEcompInstanceId) { - this.xEcompInstanceId = xEcompInstanceId; - } - - /** - * @return the authorization - */ - @JsonProperty - public String getAuthorization() { - return authorization; - } - - /** - * @param authorization the authorization to set - */ - @JsonProperty - public void setAuthorization(String authorization) { - this.authorization = authorization; - } - - /** - * @return the userId - */ - @JsonProperty - public String getUserId() { - return userId; - } - - /** - * @param userId the userId to set - */ - @JsonProperty - public void setUserId(String userId) { - this.userId = userId; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java deleted file mode 100644 index e8fd07d4..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/SDCServiceProxyInfo.java +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner; - -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * - */ -public class SDCServiceProxyInfo { - private String serviceAddr; - - private String xEcompInstanceId; - - private String authorization; - - /** - * @return the serviceAddr - */ - @JsonProperty - public String getServiceAddr() { - return serviceAddr; - } - - /** - * @param serviceAddr the serviceAddr to set - */ - @JsonProperty - public void setServiceAddr(String serviceAddr) { - this.serviceAddr = serviceAddr; - } - - /** - * @return the xEcompInstanceId - */ - @JsonProperty - public String getxEcompInstanceId() { - return xEcompInstanceId; - } - - /** - * @param xEcompInstanceId the xEcompInstanceId to set - */ - @JsonProperty - public void setxEcompInstanceId(String xEcompInstanceId) { - this.xEcompInstanceId = xEcompInstanceId; - } - - /** - * @return the authorization - */ - @JsonProperty - public String getAuthorization() { - return authorization; - } - - /** - * @param authorization the authorization to set - */ - @JsonProperty - public void setAuthorization(String authorization) { - this.authorization = authorization; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java deleted file mode 100644 index c9e0c40d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner; - -import org.onap.sdc.workflowdesigner.config.AdapterType; -import org.onap.sdc.workflowdesigner.config.AppConfig; -import org.onap.sdc.workflowdesigner.resources.ExtendActivityResource; -import org.onap.sdc.workflowdesigner.resources.WorkflowModelerResource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.annotation.JsonInclude; - -import io.dropwizard.Application; -import io.dropwizard.assets.AssetsBundle; -import io.dropwizard.server.SimpleServerFactory; -import io.dropwizard.setup.Bootstrap; -import io.dropwizard.setup.Environment; -import io.swagger.jaxrs.config.BeanConfig; -import io.swagger.jaxrs.listing.ApiListingResource; - -public class WorkflowDesignerApp extends Application { - private static final Logger LOGGER = LoggerFactory.getLogger(WorkflowDesignerApp.class); - - public static void main(String[] args) throws Exception { - new WorkflowDesignerApp().run(args); - } - - @Override - public String getName() { - return "Workflow Designer"; - } - - @Override - public void initialize(Bootstrap bootstrap) { - bootstrap.addBundle(new AssetsBundle("/api-doc", "/api-doc", "index.html", "api-doc")); - bootstrap.addBundle(new AssetsBundle("/workflow-modeler", "/workflow-modeler", "index.html", - "workflow-modeler")); - bootstrap.addBundle(new AssetsBundle("/workflow-modeler", "/", "index.html", "ng")); - } - - @Override - public void run(WorkflowDesignerConfiguration configuration, Environment environment) { - LOGGER.info("Start to initialize Workflow Designer."); - - saveAppConfig(configuration); - - environment.jersey().register(new WorkflowModelerResource()); - environment.jersey().register(new ExtendActivityResource()); - - // register rest interface - environment.jersey().packages("org.onap.sdc.workflowdesigner.resources"); - - initSwaggerConfig(environment, configuration); - - LOGGER.info("Initialize catalogue finished."); - } - - /** - * @param configuration - */ - private void saveAppConfig(WorkflowDesignerConfiguration configuration) { - AppConfig.setAdapterType(AdapterType.valueOf(configuration.getAdapterType())); - AppConfig.setSdcServiceProxy(configuration.getSdcServiceProxy()); - AppConfig.setActivitySpecServiceProxy(configuration.getActivitySpecServiceProxy()); - } - - /** - * initialize swagger configuration. - * - * @param environment environment information - * @param configuration catalogue configuration - */ - private void initSwaggerConfig(Environment environment, - WorkflowDesignerConfiguration configuration) { - environment.jersey().register(new ApiListingResource()); - environment.getObjectMapper().setSerializationInclusion(JsonInclude.Include.NON_NULL); - - BeanConfig config = new BeanConfig(); - config.setTitle("Workflow Designer rest API"); - config.setVersion("1.0.0"); - config.setResourcePackage("org.onap.sdc.workflowdesigner.resources"); - - // set rest api basepath in swagger - SimpleServerFactory simpleServerFactory = - (SimpleServerFactory) configuration.getServerFactory(); - String basePath = simpleServerFactory.getApplicationContextPath(); - String rootPath = simpleServerFactory.getJerseyRootPath().get(); - rootPath = rootPath.substring(0, rootPath.indexOf("/*")); - basePath = basePath.equals("/") ? rootPath - : (new StringBuilder()).append(basePath).append(rootPath).toString(); - config.setBasePath(basePath); - config.setScan(true); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java deleted file mode 100644 index 4c6766be..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner; - -import javax.validation.constraints.NotNull; - -import com.fasterxml.jackson.annotation.JsonProperty; - -import io.dropwizard.Configuration; - -public class WorkflowDesignerConfiguration extends Configuration { - private String template; - - private String defaultName = "Workflow Designer"; - - private String adapterType; - - @NotNull - private SDCServiceProxyInfo sdcServiceProxy; - - @NotNull - private ActivitySpecServiceProxyInfo activitySpecServiceProxy; - - - @JsonProperty - public String getTemplate() { - return template; - } - - @JsonProperty - public void setTemplate(String template) { - this.template = template; - } - - @JsonProperty - public String getDefaultName() { - return defaultName; - } - - @JsonProperty - public void setDefaultName(String name) { - this.defaultName = name; - } - - /** - * @return the adapterType - */ - @JsonProperty - public String getAdapterType() { - return adapterType; - } - - /** - * @param adapterType the adapterType to set - */ - @JsonProperty - public void setAdapterType(String adapterType) { - this.adapterType = adapterType; - } - - /** - * @return the sdcServiceProxy - */ - @JsonProperty - public SDCServiceProxyInfo getSdcServiceProxy() { - return sdcServiceProxy; - } - - /** - * @param sdcServiceProxy the sdcServiceProxy to set - */ - @JsonProperty - public void setSdcServiceProxy(SDCServiceProxyInfo sdcServiceProxy) { - this.sdcServiceProxy = sdcServiceProxy; - } - - /** - * @return the activitySpecServiceProxy - */ - @JsonProperty - public ActivitySpecServiceProxyInfo getActivitySpecServiceProxy() { - return activitySpecServiceProxy; - } - - /** - * @param activitySpecServiceProxy the activitySpecServiceProxy to set - */ - @JsonProperty - public void setActivitySpecServiceProxy(ActivitySpecServiceProxyInfo activitySpecServiceProxy) { - this.activitySpecServiceProxy = activitySpecServiceProxy; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java deleted file mode 100644 index bc3cf4b6..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/ActivitySpecProxyException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ - -package org.onap.sdc.workflowdesigner.common; - -public class ActivitySpecProxyException extends Exception { - - private static final long serialVersionUID = 1L; - - public ActivitySpecProxyException() { - super(); - } - - public ActivitySpecProxyException(String msg, Exception e) { - super(msg, e); - } - - public ActivitySpecProxyException(String msg) { - super(msg); - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java deleted file mode 100644 index 8f596b0c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/common/SDCProxyException.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.common; - -public class SDCProxyException extends Exception { - - private static final long serialVersionUID = 1L; - - public SDCProxyException() { - super(); - } - - public SDCProxyException(String msg, Exception e) { - super(msg, e); - } - - public SDCProxyException(String msg) { - super(msg); - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java deleted file mode 100644 index 0c6e4c8b..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AdapterType.java +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.config; - -/** - * - */ -public enum AdapterType { - DEFAULT, SDC - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java deleted file mode 100644 index a6f72be0..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.config; - -import org.onap.sdc.workflowdesigner.SDCServiceProxyInfo; -import org.onap.sdc.workflowdesigner.ActivitySpecServiceProxyInfo; - -/** - * - */ -public class AppConfig { - private static AdapterType adapterType; - - private static SDCServiceProxyInfo sdcServiceProxy; - - private static ActivitySpecServiceProxyInfo activitySpecServiceProxy; - - private AppConfig() {} - - /** - * @return the adapterType - */ - public static AdapterType getAdapterType() { - return adapterType; - } - - /** - * @param adapterType the adapterType to set - */ - public static void setAdapterType(AdapterType adapterType) { - AppConfig.adapterType = adapterType; - } - - /** - * @param sdcServiceProxy - */ - public static void setSdcServiceProxy(SDCServiceProxyInfo sdcServiceProxy) { - AppConfig.sdcServiceProxy = sdcServiceProxy; - } - - /** - * @return the sdcServiceProxy - */ - public static SDCServiceProxyInfo getSdcServiceProxy() { - return sdcServiceProxy; - } - - /** - * @return - */ - public static boolean isSDCAdapter() { - return adapterType.equals(AdapterType.SDC); - } - - /** - * @param activitySpecServiceProxy - */ - public static void setActivitySpecServiceProxy(ActivitySpecServiceProxyInfo activitySpecServiceProxy) { - AppConfig.activitySpecServiceProxy = activitySpecServiceProxy; - } - - /** - * @return the activitySpecServiceProxy - */ - public static ActivitySpecServiceProxyInfo getActivitySpecServiceProxy() { - return activitySpecServiceProxy; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java deleted file mode 100644 index 74d80e04..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/Config.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.config; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.InputStream; -import java.util.Properties; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class Config { - private static Logger log = LoggerFactory.getLogger(Config.class); - private static String configFilePath = "bpmn.config.properties"; - public final static String HANDLER_ClASS = "handlerClass"; - public final static String TEMPLATE_PATH = "templatePath"; - - public final static Properties PROPERTIES = load(); - - public static Properties load() { - Properties properties = new Properties(); - InputStream in = null; - try { - in = Config.class.getClassLoader().getResourceAsStream(configFilePath); - properties.load(in); - } catch (FileNotFoundException e) { - log.error(configFilePath, e); - } catch (IOException e) { - log.error(configFilePath, e); - } catch (Exception e) { - log.error(configFilePath, e); - } finally { - if (in != null) { - try { - in.close(); - } catch (IOException e) { - log.error(configFilePath, e); - } - } - } - - return properties; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java deleted file mode 100644 index b85d6d0b..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecService.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.ActivitySpec; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.GenericCollectionWrapper; - -@Path("") -public interface ActivitySpecService { - @GET - @Path("/activity-spec?Filter=Certified") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public GenericCollectionWrapper getActivitySpecs( - @HeaderParam("USER_ID") String userId, - @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, - @HeaderParam("Authorization") String authorization) throws Exception; - - @GET - @Path("/activity-spec/{id}/versions/{versionId}") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public ActivitySpec getActivitySpec( - @HeaderParam("USER_ID") String userId, - @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, - @HeaderParam("Authorization") String authorization, - @PathParam("versionId") String versionId, - @PathParam("id") String id) throws Exception; - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java deleted file mode 100644 index e210e872..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/ActivitySpecServiceProxy.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import org.glassfish.jersey.client.ClientConfig; -import org.onap.sdc.workflowdesigner.common.ActivitySpecProxyException; -import org.onap.sdc.workflowdesigner.config.AppConfig; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.ActivitySpec; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.GenericCollectionWrapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; - -/** - * - */ -public class ActivitySpecServiceProxy { - private static final Logger LOGGER = LoggerFactory.getLogger(ActivitySpecServiceProxy.class); - - private static final String AUTHORIZATION = AppConfig.getActivitySpecServiceProxy().getAuthorization(); - - private static final String X_ECOMP_INSTANCE_ID = AppConfig.getActivitySpecServiceProxy().getxEcompInstanceId(); - - private static final String USER_ID = AppConfig.getActivitySpecServiceProxy().getUserId(); - - /** */ - private static final String ACTIVITY_ROOT_PATH = "/activity-spec-api/v1.0"; - - private static final String ACTIVITY_SPEC_VERSION_ID_DEFAULT_VALUE = "latest"; - - private static String getActivityRootPath() { - return AppConfig.getActivitySpecServiceProxy().getServiceAddr() + ACTIVITY_ROOT_PATH; - } - - /** - * @return - */ - private ActivitySpecService getActivitySpecServiceProxy() { - ClientConfig config = new ClientConfig(); - return ConsumerFactory.createConsumer(getActivityRootPath(), config, ActivitySpecService.class); - } - - - /** - * - * @return - * @throws ActivitySpecProxyException - */ - public ActivitySpec[] getActivitySpecs() throws ActivitySpecProxyException { - ActivitySpecService serviceProxy = getActivitySpecServiceProxy(); - List activitySpecList = new ArrayList<>(); - try { - GenericCollectionWrapper activityCollection = serviceProxy.getActivitySpecs(USER_ID, X_ECOMP_INSTANCE_ID, AUTHORIZATION); - for (Object obj : activityCollection.getResults()) { - if (obj instanceof Map){ - Map activitySpecMap = (Map) obj; - String activitySpecId = activitySpecMap.get("id").toString(); - ActivitySpec activitySpec = serviceProxy.getActivitySpec(USER_ID, X_ECOMP_INSTANCE_ID, AUTHORIZATION, ACTIVITY_SPEC_VERSION_ID_DEFAULT_VALUE, activitySpecId); - activitySpec.setId(activitySpecId); - activitySpecList.add(activitySpec); - } - } - } catch (Exception e) { - LOGGER.error("Get Activity Specifications Failed.", e); - throw new ActivitySpecProxyException("Get Activity Specifications Failed.", e); - } - return activitySpecList.toArray(new ActivitySpec[activitySpecList.size()]); - } - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java deleted file mode 100644 index d5a55669..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCService.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; - -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.WorkflowArtifactInfo; - -@Path("/catalog") -public interface SDCService { - @POST - @Path("/resource/{uuid}/interfaces/{operationID}/artifacts/{id}") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public void saveWorkflowArtifact(@PathParam("uuid") String uuid, - @PathParam("operationID") String operationId, @PathParam("id") String workflowId, - @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, - @HeaderParam("Authorization") String authorization, - WorkflowArtifactInfo workflowArtifactInfo) throws Exception; - - - @GET - @Path("/resource/{uuid}/interfaces/{operationID}/artifacts/{id}") - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - public WorkflowArtifactInfo getWorkflowArtifact(@PathParam("uuid") String uuid, - @PathParam("operationID") String operationId, @PathParam("id") String workflowId, - @HeaderParam("X-ECOMP-InstanceID") String xEcompInstanceId, - @HeaderParam("Authorization") String authorization) throws Exception; - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java deleted file mode 100644 index 374bca7a..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/SDCServiceProxy.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * Copyright 2017-2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc; - -import org.glassfish.jersey.client.ClientConfig; -import org.onap.sdc.workflowdesigner.common.SDCProxyException; -import org.onap.sdc.workflowdesigner.config.AppConfig; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.WorkflowArtifactInfo; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.eclipsesource.jaxrs.consumer.ConsumerFactory; - -/** - * - */ -public class SDCServiceProxy { - private static final Logger LOGGER = LoggerFactory.getLogger(SDCService.class); - - private static final String AUTHORIZATION = AppConfig.getSdcServiceProxy().getAuthorization(); - - private static final String X_ECOMP_INSTANCE_ID = - AppConfig.getSdcServiceProxy().getxEcompInstanceId(); - /** */ - private static final String SDC_ROOT_PATH = "/sdc/v1"; - - - private static String getSDCRootPath() { - return AppConfig.getSdcServiceProxy().getServiceAddr() + SDC_ROOT_PATH; - } - - /** - * @return - */ - private SDCService getSDCServiceProxy() { - ClientConfig config = new ClientConfig(); - return ConsumerFactory.createConsumer(getSDCRootPath(), config, SDCService.class); - } - - /** - * - * @param uuid - * @param operationId - * @param workflowId - * @param workflowArtifactInfo - * @throws SDCProxyException - */ - public void saveWorkflowArtifact(String uuid, String operationId, String workflowId, - WorkflowArtifactInfo workflowArtifactInfo) throws SDCProxyException { - SDCService serviceProxy = getSDCServiceProxy(); - try { - serviceProxy.saveWorkflowArtifact(uuid, operationId, workflowId, X_ECOMP_INSTANCE_ID, - AUTHORIZATION, workflowArtifactInfo); - } catch (Exception e) { - LOGGER.error("Save WorkflowArtifact Failed.", e); - throw new SDCProxyException("Save WorkflowArtifact Failed.", e); - } - } - - /** - * - * @param uuid - * @param operationId - * @param workflowId - * @return - * @throws SDCProxyException - */ - public WorkflowArtifactInfo getWorkflowArtifact(String uuid, String operationId, - String workflowId) throws SDCProxyException { - SDCService serviceProxy = getSDCServiceProxy(); - try { - return serviceProxy.getWorkflowArtifact(uuid, operationId, workflowId, X_ECOMP_INSTANCE_ID, - AUTHORIZATION); - } catch (Exception e) { - LOGGER.error("Get WorkflowArtifact Failed.", e); - throw new SDCProxyException("Get WorkflowArtifact Failed.", e); - } - } - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java deleted file mode 100644 index 092e8627..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivityContent.java +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; - -/** - * - */ -public class ActivityContent { - @JsonProperty(value="class") // for dropwizard's Jackson - @SerializedName("class") // for Gson - public String clazz; - - private String scriptFormat; - - private String script; - - - /** - * @return the scriptFormat - */ - public String getScriptFormat() { - return scriptFormat; - } - - /** - * @param scriptFormat the scriptFormat to set - */ - public void setScriptFormat(String scriptFormat) { - this.scriptFormat = scriptFormat; - } - - /** - * @return the script - */ - public String getScript() { - return script; - } - - /** - * @param script the script to set - */ - public void setScript(String script) { - this.script = script; - } - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java deleted file mode 100644 index ecaffb38..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/ActivitySpec.java +++ /dev/null @@ -1,179 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -/** - * - */ -public class ActivitySpec { - private String id; - - private String versionId; - - private String name; - - private String description; - - private String type; - - private String content; - - private String[] categoryList; - - private Parameter[] inputs; - - private Parameter[] outputs; - - private String status; - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the versionId - */ - public String getVersionId() { - return versionId; - } - - /** - * @param versionId the versionId to set - */ - public void setVersionId(String versionId) { - this.versionId = versionId; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type the type to set - */ - public void setType(String type) { - this.type = type; - } - - /** - * @return the content - */ - public String getContent() { - return content; - } - - /** - * @param content the content to set - */ - public void setContent(String content) { - this.content = content; - } - - /** - * @return the categoryList - */ - public String[] getCategoryList() { - return categoryList; - } - - /** - * @param categoryList the categoryList to set - */ - public void setCategoryList(String[] categoryList) { - this.categoryList = categoryList; - } - - /** - * @return the inputs - */ - public Parameter[] getInputs() { - return inputs; - } - - /** - * @param inputs the inputs to set - */ - public void setInputs(Parameter[] inputs) { - this.inputs = inputs; - } - - /** - * @return the outputs - */ - public Parameter[] getOutputs() { - return outputs; - } - - /** - * @param outputs the outputs to set - */ - public void setOutputs(Parameter[] outputs) { - this.outputs = outputs; - } - - /** - * @return the status - */ - public String getStatus() { - return status; - } - - /** - * @param status the status to set - */ - public void setStatus(String status) { - this.status = status; - } - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java deleted file mode 100644 index 59813605..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/GenericCollectionWrapper.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright © 2016-2018 European Support Limited - * - * 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. - */ - -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import java.io.Serializable; -import java.util.ArrayList; -import java.util.List; - -public class GenericCollectionWrapper implements Serializable { - private static final long serialVersionUID = 1L; - - private transient List results; - private int listCount; - - public GenericCollectionWrapper() { - this.results = new ArrayList<>(); - } - - /** - * Instantiates a new Generic collection wrapper. - * - * @param list the list - */ - public GenericCollectionWrapper(List list) { - if (!list.isEmpty()) { - this.results = list; - this.listCount = list.size(); - } - } - - public List getResults() { - return results; - } - - public void setResults(List results) { - this.results = results; - } - - public int getListCount() { - return listCount; - } - - public void setListCount(int listCount) { - this.listCount = listCount; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java deleted file mode 100644 index 86a3d578..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/Parameter.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import com.google.gson.annotations.SerializedName; - -/** - * - */ -public class Parameter { - private String name; - - private String type; - - @SerializedName("default") - private String defaultValue; - - private String value; - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type the type to set - */ - public void setType(String type) { - this.type = type; - } - - /** - * @return the defaultValue - */ - public String getDefault() { - return defaultValue; - } - - /** - * @param defaultValue the defaultValue to set - */ - public void setDefault(String defaultValue) { - this.defaultValue = defaultValue; - } - - /** - * @return the value - */ - public String getValue() { - return value; - } - - /** - * @param value the value to set - */ - public void setValue(String value) { - this.value = value; - } - - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java deleted file mode 100644 index e2cab05e..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/externalservice/sdc/entity/WorkflowArtifactInfo.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ -package org.onap.sdc.workflowdesigner.externalservice.sdc.entity; - -import java.io.Serializable; - -public class WorkflowArtifactInfo implements Serializable { - public static final long serialVersionUID = 1L; - - private String artifactName; - - private String description; - - private String artifactType = "WORKFLOW"; - - private String payloadData; - - public WorkflowArtifactInfo(String artifactName, String description, - String payloadData) { - super(); - this.artifactName = artifactName; - this.description = description; - this.payloadData = payloadData; - } - - /** - * @return the artifactName - */ - public String getArtifactName() { - return artifactName; - } - - /** - * @param artifactName the artifactName to set - */ - public void setArtifactName(String artifactName) { - this.artifactName = artifactName; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @return the artifactType - */ - public String getArtifactType() { - return artifactType; - } - - /** - * @param artifactType the artifactType to set - */ - public void setArtifactType(String artifactType) { - this.artifactType = artifactType; - } - - /** - * @return the payloadData - */ - public String getPayloadData() { - return payloadData; - } - - /** - * @param payloadData the payloadData to set - */ - public void setPayloadData(String payloadData) { - this.payloadData = payloadData; - } - - /** - * @return the serialversionuid - */ - public static long getSerialversionuid() { - return serialVersionUID; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java deleted file mode 100644 index 7c1e058c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/DataObject.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class DataObject { - private String id; - private String name; - private String value; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getValue() { - return value; - } - - public void setValue(String value) { - this.value = value; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java deleted file mode 100644 index 4c362231..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Element.java +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import java.util.List; - -public class Element { - public enum TYPE { - startEvent, - endEvent, - errorStartEvent, - errorEndEvent, - serviceTask, - scriptTask, - exclusiveGateway, - parallelGateway, - restTask, - intermediateCatchEvent - }; - - private String id; - private String name; - private TYPE type; - private String documentation; - private Position position; - private List connections; - - public String getId() { - return id; - } - - public Position getPosition() { - return position; - } - - public void setPosition(Position position) { - this.position = position; - } - - public List getConnections() { - return connections; - } - - public void setConnections(List connections) { - this.connections = connections; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getDocumentation() { - return documentation; - } - - public void setDocumentation(String documentation) { - this.documentation = documentation; - } - - public TYPE getType() { - return type; - } - - public void setType(TYPE type) { - this.type = type; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java deleted file mode 100644 index 56d81e63..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/EndEvent.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class EndEvent extends Element { - public final static String TYPE = "endEvent"; -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java deleted file mode 100644 index 0fda8c27..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorEndEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class ErrorEndEvent extends Element { - @JsonProperty("parameter") - private Parameter parameter; - - public Parameter getParameter() { - return parameter; - } - - public void setParameter(Parameter parameter) { - this.parameter = parameter; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java deleted file mode 100644 index b4cf96c0..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ErrorStartEvent.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class ErrorStartEvent extends Element { - @JsonProperty("parameter") - private Parameter parameter; - - public Parameter getParameter() { - return parameter; - } - - public void setParameter(Parameter parameter) { - this.parameter = parameter; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java deleted file mode 100644 index d34a4f9e..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ExclusiveGateway.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class ExclusiveGateway extends Element { - public final static String TYPE = "exclusiveGateway"; -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java deleted file mode 100644 index be8b28ea..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/IntermediateCatchEvent.java +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class IntermediateCatchEvent extends Element { - private TimerEventDefinition timerEventDefinition; - - public TimerEventDefinition getTimerEventDefinition() { - return timerEventDefinition; - } - - public void setTimerEventDefinition(TimerEventDefinition timerEventDefinition) { - this.timerEventDefinition = timerEventDefinition; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java deleted file mode 100644 index bde17957..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ParallelGateway.java +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class ParallelGateway extends Element { - public final static String TYPE = "parallelGateway"; -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java deleted file mode 100644 index 039427ca..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Parameter.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; - -public class Parameter { - private static Logger log = LoggerFactory.getLogger(Parameter.class); - private String description = ""; - private String name; - private String position; - private boolean required; - private String type; - - // body parameter may be a json object - private Object value; - - @JsonInclude(Include.NON_NULL) - private String valueSource; - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getPosition() { - return position; - } - - public void setPosition(String position) { - this.position = position; - } - - public boolean isRequired() { - return required; - } - - public void setRequired(boolean required) { - this.required = required; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public Object getValue() { - return value; - } - - public void setValue(Object value) { - this.value = value; - } - - public String getValueSource() { - return valueSource; - } - - public void setValueSource(String valueSource) { - this.valueSource = valueSource; - } - - public String toString() { - ObjectMapper mapper = new ObjectMapper(); - String result = null; - try { - result = mapper.writeValueAsString(this); - } catch (JsonProcessingException e) { - log.error("fail to convert parameter to json string", e); - } - return result; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java deleted file mode 100644 index 094bce34..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Position.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class Position { - private int left; - private int top; - - public int getLeft() { - return left; - } - - public void setLeft(int left) { - this.left = left; - } - - public int getTop() { - return top; - } - - public void setTop(int top) { - this.top = top; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java deleted file mode 100644 index 3a9c7def..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/Process.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import java.util.ArrayList; -import java.util.List; - -public class Process { - private String id; - private boolean isExecutable; - private List elementList = new ArrayList(); - private List sequenceFlowList = new ArrayList(); - private List dataObjectList = new ArrayList(); - - public Process(String id) { - this.id = id; - } - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public boolean isExecutable() { - return isExecutable; - } - - public void setExecutable(boolean isExecutable) { - this.isExecutable = isExecutable; - } - - public List getElementList() { - return elementList; - } - - public void setElementList(List elementList) { - this.elementList = elementList; - } - - public List getSequenceFlowList() { - return sequenceFlowList; - } - - public void setSequenceFlowList(List sequenceFlowList) { - this.sequenceFlowList = sequenceFlowList; - } - - public List getDataObjectList() { - return dataObjectList; - } - - public void setDataObjectList(List dataObjectList) { - this.dataObjectList = dataObjectList; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java deleted file mode 100644 index fb425aae..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/RestServiceTask.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import java.util.List; - -import org.onap.sdc.workflowdesigner.config.Config; - -public class RestServiceTask extends ServiceTask { - private static String handler = Config.PROPERTIES.getProperty(Config.HANDLER_ClASS); - -// private String restConfigId; -// public String getRestConfigId() { -// return restConfigId; -// } -// public void setRestConfigId(String restConfigId) { -// this.restConfigId = restConfigId; -// } - private List produces; - private List consumes; - - - private List parameters; - private String baseUrl; - private String serviceName; - private String serviceVersion; - private String path; - private String method; - - public String getBaseUrl() { - return baseUrl; - } - public void setBaseUrl(String url) { - this.baseUrl = url; - } - - public String getMethod() { - return method; - } - - public static String getHandler() { - return handler; - } - public static void setHandler(String handler) { - RestServiceTask.handler = handler; - } - public void setMethod(String method) { - this.method = method; - } - public List getProduces() { - return produces; - } - public void setProduces(List produces) { - this.produces = produces; - } - public List getConsumes() { - return consumes; - } - public void setConsumes(List consumes) { - this.consumes = consumes; - } - public List getParameters() { - return parameters; - } - public void setParameters(List parameters) { - this.parameters = parameters; - } - public String getServiceName() { - return serviceName; - } - public void setServiceName(String serviceName) { - this.serviceName = serviceName; - } - public String getServiceVersion() { - return serviceVersion; - } - public void setServiceVersion(String serviceVersion) { - this.serviceVersion = serviceVersion; - } - public String getPath() { - return path; - } - public void setPath(String path) { - this.path = path; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java deleted file mode 100644 index 51d916cd..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ScriptTask.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class ScriptTask extends Element { - private String scriptFormat; - private String script; - - public String getScriptFormat() { - return scriptFormat; - } - - public void setScriptFormat(String scriptFormat) { - this.scriptFormat = scriptFormat; - } - - public String getScript() { - return script; - } - - public void setScript(String script) { - this.script = script; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java deleted file mode 100644 index 6e7588a7..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/SequenceFlow.java +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class SequenceFlow { - private String id = ""; - private String name; - private String sourceRef; - private String targetRef; - private String documentation; - private String condition; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getSourceRef() { - return sourceRef; - } - - public void setSourceRef(String sourceRef) { - this.sourceRef = sourceRef; - } - - public String getTargetRef() { - return targetRef; - } - - public void setTargetRef(String targetRef) { - this.targetRef = targetRef; - } - - public String getDocumentation() { - return documentation; - } - - public void setDocumentation(String documentation) { - this.documentation = documentation; - } - - public String getCondition() { - return condition; - } - - public void setCondition(String condition) { - this.condition = condition; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java deleted file mode 100644 index 8770d39c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/ServiceTask.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import java.util.List; - -public class ServiceTask extends Element { - private String className; - private List inputs; - private List outputs; - - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public List getInputs() { - return inputs; - } - - public void setInputs(List inputs) { - this.inputs = inputs; - } - - public List getOutputs() { - return outputs; - } - - public void setOutputs(List outputs) { - this.outputs = outputs; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java deleted file mode 100644 index c6517512..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/StartEvent.java +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -import java.util.List; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class StartEvent extends Element { - @JsonProperty("parameters") - private List parameters; - - public List getParameters() { - return parameters; - } - - public void setParameters(List parameters) { - this.parameters = parameters; - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java deleted file mode 100644 index 67304f96..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/model/TimerEventDefinition.java +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.model; - -public class TimerEventDefinition { - private String type; - private String timeDuration; - private String timeDate; - private String timeCycle; - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getTimeDuration() { - return timeDuration; - } - - public void setTimeDuration(String timeDuration) { - this.timeDuration = timeDuration; - } - - public String getTimeDate() { - return timeDate; - } - - public void setTimeDate(String timeDate) { - this.timeDate = timeDate; - } - - public String getTimeCycle() { - return timeCycle; - } - - public void setTimeCycle(String timeCycle) { - this.timeCycle = timeCycle; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java deleted file mode 100644 index f41faa37..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/Bpmn4ToscaJsonParser.java +++ /dev/null @@ -1,216 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.parser; - -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URI; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -import org.onap.sdc.workflowdesigner.model.DataObject; -import org.onap.sdc.workflowdesigner.model.Element; -import org.onap.sdc.workflowdesigner.model.EndEvent; -import org.onap.sdc.workflowdesigner.model.ErrorEndEvent; -import org.onap.sdc.workflowdesigner.model.ErrorStartEvent; -import org.onap.sdc.workflowdesigner.model.ExclusiveGateway; -import org.onap.sdc.workflowdesigner.model.IntermediateCatchEvent; -import org.onap.sdc.workflowdesigner.model.ParallelGateway; -import org.onap.sdc.workflowdesigner.model.Parameter; -import org.onap.sdc.workflowdesigner.model.Process; -import org.onap.sdc.workflowdesigner.model.RestServiceTask; -import org.onap.sdc.workflowdesigner.model.ScriptTask; -import org.onap.sdc.workflowdesigner.model.SequenceFlow; -import org.onap.sdc.workflowdesigner.model.ServiceTask; -import org.onap.sdc.workflowdesigner.model.StartEvent; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.SerializationFeature; - -public class Bpmn4ToscaJsonParser { - - private static Logger log = LoggerFactory.getLogger(Bpmn4ToscaJsonParser.class); - - private static ObjectMapper MAPPER = new ObjectMapper(); - - private Map restConfigMap = new HashMap(); - - static { - MAPPER.enable(SerializationFeature.INDENT_OUTPUT); - MAPPER.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - } - - public Process parse(String processName, URI jsonFileUrl) - throws JsonParseException, JsonMappingException, MalformedURLException, IOException { - Process process = new Process(processName); - - JsonNode rootNode = MAPPER.readValue(jsonFileUrl.toURL(), JsonNode.class); - - log.debug("Creating Process models..."); -// JsonNode nodes = rootNode.get(JsonKeys.NODES); - JsonNode data = rootNode.get(JsonKeys.DATA); - if(null == data) { - return process; - } - JsonNode nodes = data.get(JsonKeys.NODES); - if (nodes == null) { - return process; - } - - this.loadConfigs(rootNode.get(JsonKeys.CONFIGS)); - - Iterator iter = nodes.iterator(); - while (iter.hasNext()) { - JsonNode jsonNode = (JsonNode) iter.next(); - - // get element - Element element = createElementFromJson(jsonNode); - process.getElementList().add(element); - - // get sequence flows - List flowList = getSequenceFlows(jsonNode); - process.getSequenceFlowList().addAll(flowList); - - // add dataObject - if (element instanceof StartEvent) { - List dataObjects = this.getDataObject((StartEvent) element); - process.getDataObjectList().addAll(dataObjects); - } - } - - return process; - - } - - private List getDataObject(StartEvent startEvent) { - List dataObjects = new ArrayList(); - - for (Parameter parameter : startEvent.getParameters()) { - DataObject dataObject = new DataObject(); - dataObject.setId(parameter.getName()); - dataObject.setName(parameter.getName()); - dataObject.setValue((String) parameter.getValue()); - - dataObjects.add(dataObject); - } - - return dataObjects; - } - - private void loadConfigs(JsonNode config) { - if(config == null) { - return; - } - loadRestConfigs(config.get(JsonKeys.REST_CONFIGS)); - } - - private void loadRestConfigs(JsonNode restConfigs) { - if(restConfigs == null) { - return; - } - - Iterator iter = restConfigs.iterator(); - while (iter.hasNext()) { - JsonNode restConfig = (JsonNode) iter.next(); - - String configId = getValueFromJsonNode(restConfig, JsonKeys.ID); - restConfigMap.put(configId, restConfig); - } - } - - private List getSequenceFlows(JsonNode jsonNode) { - List flowList = new ArrayList(); - String elementId = getValueFromJsonNode(jsonNode, JsonKeys.ID); - JsonNode connectionsNode = jsonNode.get(JsonKeys.CONNECTIONS); - - Iterator iter = connectionsNode.iterator(); - while (iter.hasNext()) { - JsonNode connectionEntry = (JsonNode) iter.next(); - String targetRef = getValueFromJsonNode(connectionEntry, JsonKeys.TARGET_REF); - String condition = getValueFromJsonNode(connectionEntry, JsonKeys.CONDITION); - SequenceFlow flow = new SequenceFlow(); - flow.setId(elementId + targetRef); - flow.setSourceRef(elementId); - flow.setTargetRef(targetRef); - flow.setCondition(condition); - flowList.add(flow); - } - - return flowList; - } - - protected Element createElementFromJson(JsonNode jsonNode) - throws JsonParseException, JsonMappingException, IOException { - String jsonObject = jsonNode.toString(); - Element element; - - String nodeType = getValueFromJsonNode(jsonNode, JsonKeys.TYPE); - if (nodeType == null) { - log.warn("Ignoring node: type is null"); - return null; - } - - switch (nodeType) { - case "startEvent": - element = MAPPER.readValue(jsonObject, StartEvent.class); - break; - case "endEvent": - element = MAPPER.readValue(jsonObject, EndEvent.class); - break; - case "errorStartEvent": - element = MAPPER.readValue(jsonObject, ErrorStartEvent.class); - break; - case "errorEndEvent": - element = MAPPER.readValue(jsonObject, ErrorEndEvent.class); - break; - case "intermediateCatchEvent": - element = MAPPER.readValue(jsonObject, IntermediateCatchEvent.class); - break; - case "serviceTask": - element = MAPPER.readValue(jsonObject, ServiceTask.class); - break; - case "restTask": - // element = this.createRestServiceTask(jsonObject); - element = MAPPER.readValue(jsonObject, RestServiceTask.class); - break; - case "scriptTask": - element = MAPPER.readValue(jsonObject, ScriptTask.class); - break; - case "exclusiveGateway": - element = MAPPER.readValue(jsonObject, ExclusiveGateway.class); - break; - case "parallelGateway": - element = MAPPER.readValue(jsonObject, ParallelGateway.class); - break; - default: - log.warn("Ignoring node: type '" + nodeType + "' is unkown"); - return null; - } - - return element; - } - - - private String getValueFromJsonNode(JsonNode jsonNode, String key) { - return jsonNode.get(key) == null ? null : jsonNode.get(key).asText(); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java deleted file mode 100644 index 6128cfdf..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/parser/JsonKeys.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.parser; - -public interface JsonKeys { - - - /* - * Field names of BPMN4Tosca Model - */ - public static final String DATA = "data"; - public static final String NODES = "nodes"; - public static final String REST_CONFIGS = "restConfigs"; - public static final String CONFIGS = "configs"; - - - // microservice info - public static final String MICROSERVICE_URL = "url"; - public static final String MICROSERVICE_NAME = "name"; - public static final String MICROSERVICE_VERSION = "version"; - - public static final String NAME = "name"; - - public static final String ID = "id"; - - public static final String TYPE = "type"; - - public static final String INPUT = "input"; - - public static final String OUTPUT = "output"; - - public static final String VALUE = "value"; - - public static final String NODE_TEMPLATE = "node_template"; - - public static final String NODE_OPERATION = "node_operation"; - - public static final String NODE_INTERFACE_NAME = "interface"; - - public static final String CONNECTIONS = "connection"; - - public static final String SOURCE_REF = "sourceRef"; - - public static final String TARGET_REF = "targetRef"; - - public static final String CONDITIONS = "conditions"; - - public static final String CONDITION = "condition"; - - public static final String DEFAULT = "default"; - - - /* - * Exclusive-Gateway, Event, Management-Task Types - * - */ - public static final String NODE_TYPE_MGMT_TASK = "ToscaNodeManagementTask"; - - public static final String NODE_TYPE_START_EVENT = "StartEvent"; - - public static final String NODE_TYPE_END_EVENT = "EndEvent"; - - public static final String NODE_TYPE_GATEWAY_EXCLUSIVE = "ExclusiveGateway"; - - public static final String NODE_TYPE_GATEWAY_EXCLUSIVE_END = "ExclusiveGatewayEnd"; - - - /* - * Parameter Types - */ - public static final String PARAM_TYPE_VALUE_STRING = "string"; - - public static final String PARAM_TYPE_VALUE_TOPOLOGY = "topology"; - - public static final String PARAM_TYPE_VALUE_PLAN = "plan"; - - public static final String PARAM_TYPE_VALUE_CONCAT = "concat"; - - public static final String PARAM_TYPE_VALUE_IA = "implementation_artifact"; - - public static final String PARAM_TYPE_VALUE_DA = "deployment_artifact"; - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java deleted file mode 100644 index 4a40597a..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/ExtendActivityResource.java +++ /dev/null @@ -1,283 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner.resources; - -import java.io.IOException; -import java.util.HashMap; -import java.util.Map; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.eclipse.jetty.http.HttpStatus; -import org.onap.sdc.workflowdesigner.common.ActivitySpecProxyException; -import org.onap.sdc.workflowdesigner.config.AppConfig; -import org.onap.sdc.workflowdesigner.externalservice.sdc.ActivitySpecServiceProxy; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.ActivitySpec; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.Parameter; -import org.onap.sdc.workflowdesigner.resources.entity.ExtActivityDisplayInfo; -import org.onap.sdc.workflowdesigner.resources.entity.I18nString; -import org.onap.sdc.workflowdesigner.resources.entity.InputOutput; -import org.onap.sdc.workflowdesigner.resources.entity.NodeCategory; -import org.onap.sdc.workflowdesigner.resources.entity.CategoryData; -import org.onap.sdc.workflowdesigner.resources.entity.Content; -import org.onap.sdc.workflowdesigner.resources.entity.ExtActivity; -import org.onap.sdc.workflowdesigner.utils.FileCommonUtils; -import org.onap.sdc.workflowdesigner.utils.JsonUtils; -import org.onap.sdc.workflowdesigner.utils.RestUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.codahale.metrics.annotation.Timed; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -/** - * Extend Activity Resource. - * - */ -@Path("/ext-activities") -@Api(tags = {"Workflow Modeler"}) -public class ExtendActivityResource { - private static final Logger LOGGER = LoggerFactory.getLogger(ExtendActivityResource.class); - - /** */ - private static final String EXT_ACTIVITIES_DISPLAY_INFO_FILE_NAME = - "ext-activities-display-info.json"; - - private static final String EXT_ACTIVITIES_FILE_NAME = "ext-activities.json"; - - private static final CategoryData EXTENSION_TASK_CATEGORY = - new CategoryData(new I18nString("Extension Task", "Extension Task")); - - private static final String EXTENSION_TASK_CATEGORY_CATEGORY_ID = "extension_task_category_id"; - - /** - * test function. - * - * @return Response - */ - @Path("/") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Get Extend Activities.", response = ExtActivity.class, - responseContainer = "List") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = String.class)}) - @Timed - public Response getExtActivities(@ApiParam(value = "sence") @QueryParam("sence") String sence) { - if (AppConfig.isSDCAdapter()) { - return getExtActivitiesfromSDC(); - } else { - return getExtActivitiesfromLocal(); - } - } - - /** - * @return - */ - private Response getExtActivitiesfromLocal() { - try { - String json = FileCommonUtils.readString(EXT_ACTIVITIES_FILE_NAME); - ExtActivity[] extActivities = JsonUtils.fromJson(json, ExtActivity[].class); - return Response.status(Response.Status.OK).entity(extActivities).build(); - } catch (IOException e) { - LOGGER.error("Get ExtActivities from local failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - /** - * @return - */ - private Response getExtActivitiesfromSDC() { - try { - ActivitySpecServiceProxy proxy = new ActivitySpecServiceProxy(); - ActivitySpec[] activitySpecs = proxy.getActivitySpecs(); - ExtActivity[] extActivities = convert2ExtActivities(activitySpecs); - return Response.status(Response.Status.OK).entity(extActivities).build(); - } catch (ActivitySpecProxyException e) { - LOGGER.error("Get ExtActivities from sdc failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - /** - * @param activitySpecs - * @return - */ - private ExtActivity[] convert2ExtActivities(ActivitySpec[] activitySpecs) { - ExtActivity[] extendActivities = new ExtActivity[activitySpecs.length]; - for (int i = 0; i < activitySpecs.length; i++) { - extendActivities[i] = convert2ExtActivity(activitySpecs[i]); - } - return extendActivities; - } - - /** - * @param activitySpec - * @return - */ - private ExtActivity convert2ExtActivity(ActivitySpec activitySpec) { - ExtActivity extActivity = new ExtActivity(); - extActivity.setId(activitySpec.getId()); - extActivity.setDisplayName(new I18nString(activitySpec.getName(), activitySpec.getName())); - extActivity.setDescription( - new I18nString(activitySpec.getDescription(), activitySpec.getDescription())); - extActivity.setType(activitySpec.getType()); - extActivity.setContent(buildContent(activitySpec)); - return extActivity; - } - - /** - * @param activitySpec - * @return - */ - private Content buildContent(ActivitySpec activitySpec) { - Content content = new Content(); - content.setScript(activitySpec.getContent()); - content.setInputs(convert2InputOutputs(activitySpec.getInputs())); - content.setOutputs(convert2InputOutputs(activitySpec.getOutputs())); - return content; - } - - /** - * @param parameters - * @return - */ - private Map convert2InputOutputs(Parameter[] parameters) { - Map inputOutputs = new HashMap<>(); - for (Parameter parameter : parameters) { - inputOutputs.put(parameter.getName(), convert2InputOutput(parameter)); - } - return inputOutputs; - } - - /** - * @param parameter - * @return - */ - private InputOutput convert2InputOutput(Parameter parameter) { - InputOutput inputOutput = new InputOutput(); - inputOutput.setDisplayName(new I18nString(parameter.getName(), parameter.getName())); - inputOutput.setType(parameter.getType()); - inputOutput.setDefault(parameter.getDefault()); - inputOutput.setValue(parameter.getValue()); - return inputOutput; - } - - - @Path("/displayInfo") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Get Extend Activities DisplayInfo", - response = ExtActivityDisplayInfo.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = String.class)}) - @Timed - public Response getDisplayInfo(@ApiParam(value = "sence") @QueryParam("sence") String sence) { - if (AppConfig.isSDCAdapter()) { - return getDisplayInfofromSDC(); - } else { - return getDisplayInfofromLocal(sence); - } - } - - /** - * @param sence - * @return - */ - private Response getDisplayInfofromLocal(String sence) { - try { - ExtActivityDisplayInfo displayInfo = retriveDisplayInfo(sence); - return Response.status(Response.Status.OK).entity(displayInfo).build(); - } catch (IOException e) { - LOGGER.error("Get Extend Activities DisplayInfo from failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - /** - * @return - */ - private Response getDisplayInfofromSDC() { - try { - ActivitySpecServiceProxy proxy = new ActivitySpecServiceProxy(); - ActivitySpec[] activitySpecs = proxy.getActivitySpecs(); - ExtActivityDisplayInfo displayInfo = convert2ExtActivityDisplayInfo(activitySpecs); - return Response.status(Response.Status.OK).entity(displayInfo).build(); - } catch (ActivitySpecProxyException e) { - LOGGER.error("Get Extend Activities DisplayInfo from sdc failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - /** - * @param activitySpecs - * @return - */ - private ExtActivityDisplayInfo convert2ExtActivityDisplayInfo(ActivitySpec[] activitySpecs) { - ExtActivityDisplayInfo displayInfo = new ExtActivityDisplayInfo(); - - for (ActivitySpec activitySpec : activitySpecs) { - displayInfo.getNodes().put(activitySpec.getId(), buildNodeCategory(activitySpec)); - } - - displayInfo.getCategoryData().put(EXTENSION_TASK_CATEGORY_CATEGORY_ID, EXTENSION_TASK_CATEGORY); - - return displayInfo; - } - - /** - * @param activitySpec - * @return - */ - private NodeCategory buildNodeCategory(ActivitySpec activitySpec) { - NodeCategory nodeCategory = new NodeCategory(); - nodeCategory.setCategory(EXTENSION_TASK_CATEGORY_CATEGORY_ID); - - return nodeCategory; - } - - /** - * @param sence - * @return - * @throws IOException - */ - private ExtActivityDisplayInfo retriveDisplayInfo(String sence) throws IOException { - String json = FileCommonUtils.readString(EXT_ACTIVITIES_DISPLAY_INFO_FILE_NAME); - return JsonUtils.fromJson(json, ExtActivityDisplayInfo.class); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java deleted file mode 100644 index 263ac73d..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/HealthCheckResource.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright 2018 ZTE Corporation. - * - * 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. - */ - -package org.onap.sdc.workflowdesigner.resources; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import org.eclipse.jetty.http.HttpStatus; -import com.codahale.metrics.annotation.Timed; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -@Path("/healthCheck") -@Api(tags = {" Health Check "}) -public class HealthCheckResource { - - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = " Health Check ") - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "internal server error", - response = String.class)}) - @Timed - public Response queryEmsList() { - return Response.ok("hello world !").build(); - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java deleted file mode 100644 index c08fcef5..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/WorkflowModelerResource.java +++ /dev/null @@ -1,267 +0,0 @@ -/** - * Copyright (c) 2017-2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner.resources; - -import java.io.IOException; -import java.net.URI; -import java.nio.file.Paths; -import java.util.List; -import java.util.UUID; - -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import org.dom4j.Comment; -import org.dom4j.Document; -import org.dom4j.DocumentException; -import org.dom4j.DocumentHelper; -import org.eclipse.jetty.http.HttpStatus; -import org.onap.sdc.workflowdesigner.common.SDCProxyException; -import org.onap.sdc.workflowdesigner.config.AppConfig; -import org.onap.sdc.workflowdesigner.externalservice.sdc.SDCServiceProxy; -import org.onap.sdc.workflowdesigner.externalservice.sdc.entity.WorkflowArtifactInfo; -import org.onap.sdc.workflowdesigner.model.Process; -import org.onap.sdc.workflowdesigner.parser.Bpmn4ToscaJsonParser; -import org.onap.sdc.workflowdesigner.resources.entity.WorkflowInfo; -import org.onap.sdc.workflowdesigner.utils.FileCommonUtils; -import org.onap.sdc.workflowdesigner.utils.JsonUtils; -import org.onap.sdc.workflowdesigner.utils.RestUtils; -import org.onap.sdc.workflowdesigner.utils.ToolUtils; -import org.onap.sdc.workflowdesigner.writer.BpmnPlanArtefactWriter; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import com.codahale.metrics.annotation.Timed; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; - -/** - * Workflow Modeler Resource. - * - */ -@Path("/models") -@Api(tags = {"Workflow Modeler"}) -public class WorkflowModelerResource { - private static final Logger logger = LoggerFactory.getLogger(WorkflowModelerResource.class); - - private static final String WORKFLOW_JSON_TEMP_FILE_NAME = "temp_workflow.json"; - private static final String WORKFLOW_XML_TEMP_FILE_NAME = "temp_workflow.xml"; - - - /** - * - * @return Response - */ - @Path("/{id}") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Get Model", response = WorkflowInfo.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = String.class)}) - @Timed - public Response getModel(@ApiParam(value = "id") @PathParam("id") String id, - @ApiParam(value = "name") @QueryParam("name") String name, - @ApiParam(value = "uuid") @QueryParam("uuid") String uuid, - @ApiParam(value = "operationId") @QueryParam("operationId") String operationId) { - if (AppConfig.isSDCAdapter()) { - return getModelfromSDC(uuid, operationId, id, name); - } else { - return getModelfromLocal(); - } - - } - - /** - * @return - */ - private Response getModelfromLocal() { - try { - String json = FileCommonUtils.readString(WORKFLOW_JSON_TEMP_FILE_NAME); - return Response.status(Response.Status.OK).entity(json).build(); - } catch (IOException e) { - logger.error("get workflow from local failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - - /** - * @param uuid - * @param operationId - * @param id - * @param name - * @return - */ - private Response getModelfromSDC(String uuid, String operationId, String id, String name) { - try { - SDCServiceProxy sdcProxy = new SDCServiceProxy(); - WorkflowArtifactInfo wai = sdcProxy.getWorkflowArtifact(uuid, operationId, id); - String bpmn = wai.getPayloadData(); - String json = readJsonfromBPMN(bpmn); - if (ToolUtils.isEmpty(json)) { - WorkflowInfo wfi = newEmptyWorkflowInfo(uuid, operationId, id, name); - return Response.status(Response.Status.OK).entity(wfi).build(); - } - return Response.status(Response.Status.OK).entity(json).build(); - } catch (SDCProxyException e) { - logger.error("get workflow from sdc failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } catch (DocumentException e) { - logger.error("get workflow from sdc failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - /** - * @param id - * @param operationId - * @param uuid - * @param name - * @return - */ - private WorkflowInfo newEmptyWorkflowInfo(String uuid, String operationId, String id, - String name) { - WorkflowInfo wfi = new WorkflowInfo(); - wfi.setId(id); - wfi.setName(name); - wfi.setUuid(uuid); - wfi.setOperationId(operationId); - - return wfi; - } - - - - @Path("/{id}") - @PUT - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @ApiOperation(value = "Save Model", response = String.class) - @ApiResponses(value = { - @ApiResponse(code = HttpStatus.NOT_FOUND_404, message = "microservice not found", - response = String.class), - @ApiResponse(code = HttpStatus.UNSUPPORTED_MEDIA_TYPE_415, - message = "Unprocessable MicroServiceInfo Entity ", response = String.class), - @ApiResponse(code = HttpStatus.INTERNAL_SERVER_ERROR_500, message = "server internal error", - response = String.class)}) - @Timed - public Response saveModel(@ApiParam(value = "id") @PathParam("id") String id, - @ApiParam(value = "Model Content", required = true) String json) { - try { - FileCommonUtils.write(WORKFLOW_JSON_TEMP_FILE_NAME, json); - - URI srcUri = Paths.get(".", WORKFLOW_JSON_TEMP_FILE_NAME).toUri(); - String processName = "plan_" + UUID.randomUUID().toString(); - String bpmn = buildBPMN(srcUri, processName); - String jsonBpmn = insertJson2Bpmn(json, bpmn); - - if (AppConfig.isSDCAdapter()) { - save2SDC(json, jsonBpmn); - } - FileCommonUtils.write(WORKFLOW_XML_TEMP_FILE_NAME, jsonBpmn); - - return Response.status(Response.Status.OK).entity(json).build(); - } catch (IOException e) { - logger.error("save workflow failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } catch (Exception e) { - logger.error("convert workflow from json to bpmn failed.", e); - throw RestUtils.newInternalServerErrorException(e); - } - } - - /** - * @param json - * @param bpmn - * @return - */ - protected String insertJson2Bpmn(String json, String bpmn) { - StringBuffer sb = new StringBuffer(bpmn); - sb.append("\n"); - - return sb.toString(); - } - - /** - * - * @return - * @throws DocumentException - */ - protected String readJsonfromBPMN(String bpmn) throws DocumentException { - if (ToolUtils.isEmpty(bpmn)) { - return null; - } - - Document doc = DocumentHelper.parseText(bpmn); - List elementList = doc.content(); - for (Object object : elementList) { - if (object instanceof Comment) { - Comment comment = (Comment) object; - return comment.getText().trim(); - } - } - - return null; - } - - - /** - * @param json - * @param bpmn - * @throws SDCProxyException - */ - private void save2SDC(String json, String bpmn) throws SDCProxyException { - WorkflowInfo workflowInfo = JsonUtils.fromJson(json, WorkflowInfo.class); - WorkflowArtifactInfo workflowArtifactInfo = - new WorkflowArtifactInfo(workflowInfo.getName(), workflowInfo.getDescription(), bpmn); - - SDCServiceProxy sdcProxy = new SDCServiceProxy(); - sdcProxy.saveWorkflowArtifact(workflowInfo.getUuid(), workflowInfo.getOperationId(), - workflowInfo.getId(), workflowArtifactInfo); - } - - /** - * - * @param srcUri - * @param processName - * @return - * @throws IOException - * @throws Exception - */ - protected String buildBPMN(URI srcUri, String processName) throws IOException, Exception { - Bpmn4ToscaJsonParser parser = new Bpmn4ToscaJsonParser(); - Process process = parser.parse(processName, srcUri); - - // transform bpmn template - BpmnPlanArtefactWriter writer = new BpmnPlanArtefactWriter(process); - return writer.completePlanTemplate(); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java deleted file mode 100644 index 04ce29ea..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/CategoryData.java +++ /dev/null @@ -1,65 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -/** - * - */ -public class CategoryData { - private I18nString displayName; - - private boolean collapse; - - /** - * - */ - public CategoryData() { - super(); - } - - /** - * @param displayName - */ - public CategoryData(I18nString displayName) { - super(); - this.displayName = displayName; - } - - /** - * @return the displayName - */ - public I18nString getDisplayName() { - return displayName; - } - - /** - * @param displayName the displayName to set - */ - public void setDisplayName(I18nString displayName) { - this.displayName = displayName; - } - - /** - * @return the collapse - */ - public boolean isCollapse() { - return collapse; - } - - /** - * @param collapse the collapse to set - */ - public void setCollapse(boolean collapse) { - this.collapse = collapse; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java deleted file mode 100644 index a2b814d8..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/Content.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import java.util.Map; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.google.gson.annotations.SerializedName; - -/** - * - */ -@JsonInclude(Include.NON_NULL) -public class Content { - @JsonProperty(value="class") // for dropwizard's Jackson - @SerializedName("class") // for Gson - public String clazz; - - private String script; - - private String scriptFormat; - - private Map inputs; - - private Map outputs; - - - /** - * @return the script - */ - public String getScript() { - return script; - } - - /** - * @param script the script to set - */ - public void setScript(String script) { - this.script = script; - } - - /** - * @return the scriptFormat - */ - public String getScriptFormat() { - return scriptFormat; - } - - /** - * @param scriptFormat the scriptFormat to set - */ - public void setScriptFormat(String scriptFormat) { - this.scriptFormat = scriptFormat; - } - - /** - * @return the inputs - */ - public Map getInputs() { - return inputs; - } - - /** - * @param inputs the inputs to set - */ - public void setInputs(Map inputs) { - this.inputs = inputs; - } - - /** - * @return the outputs - */ - public Map getOutputs() { - return outputs; - } - - /** - * @param outputs the outputs to set - */ - public void setOutputs(Map outputs) { - this.outputs = outputs; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java deleted file mode 100644 index ca63bebe..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivity.java +++ /dev/null @@ -1,120 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonInclude.Include; - -/** - * - */ -@JsonInclude(Include.NON_NULL) -public class ExtActivity { - private String id; - - private I18nString displayName; - - private I18nString description; - - private String type; - - private IconData icon; - - private Content content; - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type the type to set - */ - public void setType(String type) { - this.type = type; - } - - /** - * @return the icon - */ - public IconData getIcon() { - return icon; - } - - /** - * @param icon the icon to set - */ - public void setIcon(IconData icon) { - this.icon = icon; - } - - /** - * @return the content - */ - public Content getContent() { - return content; - } - - /** - * @param content the content to set - */ - public void setContent(Content content) { - this.content = content; - } - - /** - * @return the displayName - */ - public I18nString getDisplayName() { - return displayName; - } - - /** - * @param displayName the displayName to set - */ - public void setDisplayName(I18nString displayName) { - this.displayName = displayName; - } - - /** - * @return the description - */ - public I18nString getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(I18nString description) { - this.description = description; - } - - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java deleted file mode 100644 index ac91a771..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/ExtActivityDisplayInfo.java +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import java.util.HashMap; -import java.util.Map; - -/** - * - */ -public class ExtActivityDisplayInfo { - private Map nodes = new HashMap<>(); - - private Map categoryData = new HashMap<>(); - - /** - * @return the nodes - */ - public Map getNodes() { - return nodes; - } - - /** - * @param nodes the nodes to set - */ - public void setNodes(Map nodes) { - this.nodes = nodes; - } - - /** - * @return the categoryData - */ - public Map getCategoryData() { - return categoryData; - } - - /** - * @param categoryData the categoryData to set - */ - public void setCategoryData(Map categoryData) { - this.categoryData = categoryData; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java deleted file mode 100644 index faddfaa1..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/I18nString.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -/** - * - */ -public class I18nString { - private String en_US; - - private String zh_CN; - - /** - * - */ - public I18nString() { - super(); - } - - /** - * @param en_US - * @param zh_CN - */ - public I18nString(String en_US, String zh_CN) { - super(); - this.en_US = en_US; - this.zh_CN = zh_CN; - } - - /** - * @return the en_US - */ - public String getEn_US() { - return en_US; - } - - /** - * @param en_US the en_US to set - */ - public void setEn_US(String en_US) { - this.en_US = en_US; - } - - /** - * @return the zh_CN - */ - public String getZh_CN() { - return zh_CN; - } - - /** - * @param zh_CN the zh_CN to set - */ - public void setZh_CN(String zh_CN) { - this.zh_CN = zh_CN; - } - - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java deleted file mode 100644 index 731ad7c9..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/IconData.java +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -/** - * - */ -public class IconData { - private String name; - - private int width; - - private int height; - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the width - */ - public int getWidth() { - return width; - } - - /** - * @param width the width to set - */ - public void setWidth(int width) { - this.width = width; - } - - /** - * @return the height - */ - public int getHeight() { - return height; - } - - /** - * @param height the height to set - */ - public void setHeight(int height) { - this.height = height; - } - - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java deleted file mode 100644 index 1d5c34a7..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/InputOutput.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import com.google.gson.annotations.SerializedName; - -/** - * - */ -public class InputOutput { - private String type; - - @SerializedName("default") - private String defaultValue; - - private boolean required; - - private I18nString displayName; - - private boolean show = true; - - private boolean editable = true; - - private String value; - - - /** - * @return the type - */ - public String getType() { - return type; - } - - /** - * @param type the type to set - */ - public void setType(String type) { - this.type = type; - } - - /** - * @return the defaultValue - */ - public String getDefault() { - return defaultValue; - } - - /** - * @param defaultValue the defaultValue to set - */ - public void setDefault(String defaultValue) { - this.defaultValue = defaultValue; - } - - /** - * @return the required - */ - public boolean isRequired() { - return required; - } - - /** - * @param required the required to set - */ - public void setRequired(boolean required) { - this.required = required; - } - - /** - * @return the displayName - */ - public I18nString getDisplayName() { - return displayName; - } - - /** - * @param displayName the displayName to set - */ - public void setDisplayName(I18nString displayName) { - this.displayName = displayName; - } - - /** - * @return the show - */ - public boolean isShow() { - return show; - } - - /** - * @param show the show to set - */ - public void setShow(boolean show) { - this.show = show; - } - - /** - * @return the editable - */ - public boolean isEditable() { - return editable; - } - - /** - * @param editable the editable to set - */ - public void setEditable(boolean editable) { - this.editable = editable; - } - - /** - * @return the value - */ - public String getValue() { - return value; - } - - /** - * @param value the value to set - */ - public void setValue(String value) { - this.value = value; - } - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java deleted file mode 100644 index bb1ce7c0..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/NodeCategory.java +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -/** - * - */ -public class NodeCategory { - private String category; - - /** - * @return the category - */ - public String getCategory() { - return category; - } - - /** - * @param category the category to set - */ - public void setCategory(String category) { - this.category = category; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java deleted file mode 100644 index b4747162..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/resources/entity/WorkflowInfo.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.resources.entity; - -import com.google.gson.JsonObject; - -/** - * - */ -public class WorkflowInfo { - private String uuid; - - private String operationId; - - private String id; - - private String name; - - private String description; - - private String scene; - - private JsonObject data; - - /** - * @return the uuid - */ - public String getUuid() { - return uuid; - } - - /** - * @param uuid the uuid to set - */ - public void setUuid(String uuid) { - this.uuid = uuid; - } - - /** - * @return the operationId - */ - public String getOperationId() { - return operationId; - } - - /** - * @param operationId the operationId to set - */ - public void setOperationId(String operationId) { - this.operationId = operationId; - } - - /** - * @return the id - */ - public String getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(String id) { - this.id = id; - } - - /** - * @return the name - */ - public String getName() { - return name; - } - - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - - /** - * @return the description - */ - public String getDescription() { - return description; - } - - /** - * @param description the description to set - */ - public void setDescription(String description) { - this.description = description; - } - - /** - * @return the scene - */ - public String getScene() { - return scene; - } - - /** - * @param scene the scene to set - */ - public void setScene(String scene) { - this.scene = scene; - } - - /** - * @return the data - */ - public JsonObject getData() { - return data; - } - - /** - * @param data the data to set - */ - public void setData(JsonObject data) { - this.data = data; - } - - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java deleted file mode 100644 index fdf11959..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonConstants.java +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner.utils; - -/** - * - */ -public interface FileCommonConstants { - String DEFAULT_CHARSET_NAME = "UTF-8"; - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java deleted file mode 100644 index 0f07dc50..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/FileCommonUtils.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner.utils; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.Reader; -import java.io.Writer; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * common utility class. - * - */ -public class FileCommonUtils { - private static final Logger logger = LoggerFactory.getLogger(FileCommonUtils.class); - - /** - * @param ins - */ - public static void closeInputStream(InputStream ins) { - if (ins != null) { - try { - ins.close(); - } catch (IOException e) { - logger.info("Close InputStream failed.", e); - } - } - } - - - /** - * - * @param os - */ - public static void closeOutputStream(OutputStream os) { - if (os != null) { - try { - os.close(); - } catch (IOException e) { - logger.info("Close OutputStream failed.", e); - } - } - } - - - /** - * @param reader - */ - public static void closeReader(Reader reader) { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - logger.info("Close Reader failed.", e); - } - } - } - - - /** - * - * @param writer - */ - public static void closeWriter(Writer writer) { - if (writer != null) { - try { - writer.close(); - } catch (IOException e) { - logger.info("Close Writer failed.", e); - } - } - } - - - /** - * - * @param ins - * @return - * @throws IOException - */ - public static String[] readLines(InputStream ins) throws IOException { - InputStreamReader insReader = new InputStreamReader(ins); - BufferedReader reader = new BufferedReader(insReader); - - List lineList = new ArrayList<>(); - String line; - try { - while ((line = reader.readLine()) != null) { - lineList.add(line); - } - } finally { - closeReader(reader); - closeReader(insReader); - } - - return lineList.toArray(new String[0]); - } - - - /** - * - * @param ins - * @return - * @throws IOException - */ - public static String readString(InputStream ins) throws IOException { - return IOUtils.toString(ins, "UTF-8"); - } - - - /** - * - * @param filePath - * @return - * @throws IOException - */ - public static String readString(String filePath) throws IOException { - InputStream ins = null; - try { - ins = Files.newInputStream(Paths.get(filePath)); - return readString(ins); - } finally { - closeInputStream(ins); - } - } - - - /** - * - * @param ins - * @param path - * @param fileName - * @return - * @throws IOException - */ - public static String saveFile(InputStream ins, String path, String fileName) throws IOException { - File tmpPath = new File(path); - if (!tmpPath.exists()) { - tmpPath.mkdirs(); - } - - File file = new File(path + File.separator + fileName); - OutputStream os = null; - try { - int read = 0; - byte[] bytes = new byte[1024]; - os = new FileOutputStream(file, false); - while ((read = ins.read(bytes)) != -1) { - os.write(bytes, 0, read); - } - os.flush(); - return file.getAbsolutePath(); - } finally { - closeOutputStream(os); - } - } - - - /** - * - * @param path - * @param fileName - * @param content - * @throws IOException - */ - public static void writetoAbsoluteFile(String path, String fileName, String content) - throws IOException { - writetoAbsoluteFile(path, fileName, content, FileCommonConstants.DEFAULT_CHARSET_NAME); - } - - - /** - * - * @param path - * @param fileName - * @param content - * @param charsetName - * @throws IOException - */ - public static void writetoAbsoluteFile(String path, String fileName, String content, - String charsetName) throws IOException { - write(path, fileName, content, charsetName); - } - - - /** - * - * @param fileName - * @param s - * @throws IOException - */ - public static void write(String fileName, String s) throws IOException { - write(".", fileName, s, FileCommonConstants.DEFAULT_CHARSET_NAME); - - } - - - /** - * - * @param path - * @param fileName - * @param s - * @param charsetName - * @throws IOException - */ - public static void write(String path, String fileName, String s, String charsetName) - throws IOException { - File tmpPath = new File(path); - if (!tmpPath.exists()) { - tmpPath.mkdirs(); - } - - String absolutePath = path + File.separator + fileName; - FileOutputStream out = null; - try { - out = new FileOutputStream(absolutePath); - out.write(s.getBytes(charsetName)); - out.close(); - } finally { - closeOutputStream(out); - } - } - - - /** - * - * @param fileName - * @param s - * @param charsetName - * @throws IOException - */ - public static void write(String fileName, String s, String charsetName) throws IOException { - write(".", fileName, s, charsetName); - } - - - /** - * - * @param fileName - * @param ss - * @throws IOException - */ - public static void write(String fileName, String[] ss) throws IOException { - write(fileName, ss, FileCommonConstants.DEFAULT_CHARSET_NAME); - } - - - /** - * - * @param fileName - * @param ss - * @param charsetName - * @throws IOException - */ - public static void write(String fileName, String[] ss, String charsetName) throws IOException { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < ss.length; i++) { - sb.append(ss[i]).append(System.lineSeparator()); - } - - write(fileName, sb.toString(), charsetName); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java deleted file mode 100644 index ee8a35e0..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/JsonUtils.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.utils; - -import com.google.gson.Gson; - -/** - * - */ -public class JsonUtils { - /** - * - * @param json - * @param clazz - * @return - */ - public static T fromJson(String json, Class clazz) { - Gson gson = new Gson(); - return gson.fromJson(json, clazz); - } - - /** - * - * @param t - * @return - */ - public static String toJson(T t) { - Gson gson = new Gson(); - return gson.toJson(t); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java deleted file mode 100644 index b8ba428c..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/RestUtils.java +++ /dev/null @@ -1,28 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner.utils; - -import javax.ws.rs.InternalServerErrorException; -import javax.ws.rs.core.Response; - -import org.onap.sdc.workflowdesigner.utils.entity.CommonErrorResponse; - -/** - * - */ -public class RestUtils { - public static InternalServerErrorException newInternalServerErrorException(Exception e) { - return new InternalServerErrorException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) - .entity(new CommonErrorResponse(e.getMessage())).build(), e); - } -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java deleted file mode 100644 index ea13cf8a..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/ToolUtils.java +++ /dev/null @@ -1,26 +0,0 @@ -/** - * Copyright (c) 2018 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.utils; - -/** - * - */ -public class ToolUtils { - /** - * @param val - * @return - */ - public static boolean isEmpty(String val) { - return val == null || val.trim().isEmpty(); - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java deleted file mode 100644 index 5983a5a5..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/utils/entity/CommonErrorResponse.java +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ - -package org.onap.sdc.workflowdesigner.utils.entity; - -public class CommonErrorResponse { - private String code; - private String message; - - public static Object failure(String message) { - return message; - } - - public CommonErrorResponse(String message) { - super(); - this.message = message; - } - - /** - * @return the code - */ - public String getCode() { - return code; - } - - /** - * @param code the code to set - */ - public void setCode(String code) { - this.code = code; - } - - /** - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * @param message the message to set - */ - public void setMessage(String message) { - this.message = message; - } - -} diff --git a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java b/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java deleted file mode 100644 index 4b369ff3..00000000 --- a/deprecated-workflow-designer/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/writer/BpmnPlanArtefactWriter.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Copyright (c) 2017 ZTE Corporation. - * All rights reserved. This program and the accompanying materials - * are made available under the Apache License, Version 2.0 - * and the Eclipse Public License v1.0 which both accompany this distribution, - * and are available at http://www.eclipse.org/legal/epl-v10.html - * and http://www.apache.org/licenses/LICENSE-2.0 - * - * Contributors: - * ZTE - initial API and implementation and/or initial documentation - */ -package org.onap.sdc.workflowdesigner.writer; - -import java.io.StringWriter; - -import org.apache.velocity.Template; -import org.apache.velocity.VelocityContext; -import org.apache.velocity.app.Velocity; -import org.apache.velocity.app.VelocityEngine; -import org.apache.velocity.exception.ParseErrorException; -import org.apache.velocity.exception.ResourceNotFoundException; -import org.onap.sdc.workflowdesigner.config.Config; -import org.onap.sdc.workflowdesigner.model.Process; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class BpmnPlanArtefactWriter { - - private Process process; - - private final static String TEMPLATE_PATH = Config.PROPERTIES.getProperty(Config.TEMPLATE_PATH); - - private static Logger log = LoggerFactory.getLogger(BpmnPlanArtefactWriter.class); - - public BpmnPlanArtefactWriter(Process process) throws Exception { - this.process = process; - Velocity.init(); - } - - public String completePlanTemplate() throws ResourceNotFoundException, ParseErrorException, Exception { - log.debug("Completing BPMN process template..."); - - VelocityContext context = new VelocityContext(); - - VelocityEngine ve = new VelocityEngine(); - ve.setProperty("resource.loader", "class"); - ve.setProperty("class.resource.loader.class", - "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); - Template planTemplate = ve.getTemplate(TEMPLATE_PATH + "bpmn_template.xml"); - - context.put("process", process); - context.put("templatePath", TEMPLATE_PATH); - StringWriter planWriter = new StringWriter(); - planTemplate.merge(context, planWriter); - - String bpmnProcessContent = planWriter.toString(); - - log.debug("Completed BPMN process template" + bpmnProcessContent); - - return bpmnProcessContent; - - } - -} -- cgit 1.2.3-korg