Get msbServerAddr from application config file.
Issue-ID: SDC-1128
Change-Id: Id260f8f94598ec3f3e4824b4c5e1a085d9a248fd
Signed-off-by: YuanHu <yuan.hu1@zte.com.cn>
defaultName: ${DW_DEFAULT_NAME:-Stranger}
+msbServerAddr: http://127.0.0.1:80
+
# use the simple server factory if you only want to run on a single port
server:
type: simple
/**
- * 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,
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;
@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());
/**
- * 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,
@NotEmpty
private String defaultName = "Workflow Designer";
+
+ @NotEmpty
+ private String msbServerAddr;
@JsonProperty
public String getTemplate() {
public void setDefaultName(String name) {
this.defaultName = name;
}
+
+ @JsonProperty
+ public String getMsbServerAddr() {
+ return msbServerAddr;
+ }
+
+ @JsonProperty
+ public void setMsbServerAddr(String msbServerAddr) {
+ this.msbServerAddr = msbServerAddr;
+ }
}
--- /dev/null
+/**
+ * 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;
+ }
+}