summaryrefslogtreecommitdiffstats
path: root/sdc-workflow-designer-server
diff options
context:
space:
mode:
authorYuanHu <yuan.hu1@zte.com.cn>2018-03-16 16:19:09 +0800
committerYuanHu <yuan.hu1@zte.com.cn>2018-03-16 16:19:09 +0800
commit4e1d1d797e185a0ae259e8251d292418232cff67 (patch)
tree28988ef80fe2d4e3667791effc733238cfcdf826 /sdc-workflow-designer-server
parent42bcd6b64dd6433ce52929013cf1fb450eba419c (diff)
Get msbServerAddr from config file.
Get msbServerAddr from application config file. Issue-ID: SDC-1128 Change-Id: Id260f8f94598ec3f3e4824b4c5e1a085d9a248fd Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
Diffstat (limited to 'sdc-workflow-designer-server')
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java5
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java15
-rw-r--r--sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java34
3 files changed, 52 insertions, 2 deletions
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java
index 1e289057..e2ec2711 100644
--- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerApp.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2017 ZTE Corporation.
+ * 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,
@@ -13,6 +13,7 @@
package org.onap.sdc.workflowdesigner;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
+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;
@@ -52,6 +53,8 @@ public class WorkflowDesignerApp extends Application<WorkflowDesignerConfigurati
@Override
public void run(WorkflowDesignerConfiguration configuration, Environment environment) {
LOGGER.info("Start to initialize Workflow Designer.");
+
+ AppConfig.setMsbServerAddr(configuration.getMsbServerAddr());
environment.jersey().register(new WorkflowModelerResource());
environment.jersey().register(new ExtendActivityResource());
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java
index 16f807ea..b4ed3d10 100644
--- a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/WorkflowDesignerConfiguration.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2017 ZTE Corporation.
+ * 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,
@@ -24,6 +24,9 @@ public class WorkflowDesignerConfiguration extends Configuration {
@NotEmpty
private String defaultName = "Workflow Designer";
+
+ @NotEmpty
+ private String msbServerAddr;
@JsonProperty
public String getTemplate() {
@@ -44,5 +47,15 @@ public class WorkflowDesignerConfiguration extends Configuration {
public void setDefaultName(String name) {
this.defaultName = name;
}
+
+ @JsonProperty
+ public String getMsbServerAddr() {
+ return msbServerAddr;
+ }
+
+ @JsonProperty
+ public void setMsbServerAddr(String msbServerAddr) {
+ this.msbServerAddr = msbServerAddr;
+ }
}
diff --git a/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java
new file mode 100644
index 00000000..a3cae9ca
--- /dev/null
+++ b/sdc-workflow-designer-server/src/main/java/org/onap/sdc/workflowdesigner/config/AppConfig.java
@@ -0,0 +1,34 @@
+/**
+ * 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;
+
+/**
+ *
+ */
+public class AppConfig {
+ private static String msbServerAddr;
+
+ private AppConfig() {}
+
+
+ public static String getMsbServerAddr() {
+ return msbServerAddr;
+ }
+
+ public static void setMsbServerAddr(String msbServerAddr) {
+ AppConfig.msbServerAddr = msbServerAddr;
+ }
+}