summaryrefslogtreecommitdiffstats
path: root/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr
diff options
context:
space:
mode:
Diffstat (limited to 'wso2bpel-ext/wso2bpel-core/wso2bpel-mgr')
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java110
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java57
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java33
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java37
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java46
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java23
-rw-r--r--wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java18
7 files changed, 130 insertions, 194 deletions
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java
index c7d5f0e..10ef924 100644
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java
+++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/Wso2BpelConfiguration.java
@@ -29,7 +29,34 @@ public class Wso2BpelConfiguration extends Configuration {
private String apiDescription = "Wso2bps REST API";
@NotNull
private DataSourceFactory database = new DataSourceFactory();
+
+ @NotEmpty
+ private String msbServerAddr;
+
+ @NotEmpty
+ private String wso2Host;
+ @NotEmpty
+ private String wso2HostPort;
+
+ @NotEmpty
+ private String wso2AuthUserName;
+
+ @NotEmpty
+ private String wso2AuthPassword;
+
+ @NotEmpty
+ private String wso2Path;
+
+ @NotEmpty
+ private String wso2UploadFilePath;
+
+ @NotEmpty
+ private String wso2SslJksFile;
+
+ @NotEmpty
+ private String wso2SslJksPassword;
+
@JsonProperty
public String getTemplate() {
return template;
@@ -39,9 +66,6 @@ public class Wso2BpelConfiguration extends Configuration {
public String getApiDescription() {
return apiDescription;
}
-
- @NotEmpty
- private String msbServerAddr;
@JsonProperty("database")
public DataSourceFactory getDataSourceFactory() {
@@ -67,5 +91,85 @@ public class Wso2BpelConfiguration extends Configuration {
public void setMsbServerAddr(String msbServerAddr) {
this.msbServerAddr = msbServerAddr;
}
+
+ @JsonProperty
+ public String getWso2Host() {
+ return wso2Host;
+ }
+
+ @JsonProperty
+ public void setWso2Host(String wso2Host) {
+ this.wso2Host = wso2Host;
+ }
+
+ @JsonProperty
+ public String getWso2HostPort() {
+ return wso2HostPort;
+ }
+
+ @JsonProperty
+ public void setWso2HostPort(String wso2HostPort) {
+ this.wso2HostPort = wso2HostPort;
+ }
+
+ @JsonProperty
+ public String getWso2AuthUserName() {
+ return wso2AuthUserName;
+ }
+
+ @JsonProperty
+ public void setWso2AuthUserName(String wso2AuthUserName) {
+ this.wso2AuthUserName = wso2AuthUserName;
+ }
+
+ @JsonProperty
+ public String getWso2AuthPassword() {
+ return wso2AuthPassword;
+ }
+
+ @JsonProperty
+ public void setWso2AuthPassword(String wso2AuthPassword) {
+ this.wso2AuthPassword = wso2AuthPassword;
+ }
+
+ @JsonProperty
+ public String getWso2Path() {
+ return wso2Path;
+ }
+
+ @JsonProperty
+ public void setWso2Path(String wso2Path) {
+ this.wso2Path = wso2Path;
+ }
+
+ @JsonProperty
+ public String getWso2UploadFilePath() {
+ return wso2UploadFilePath;
+ }
+
+ @JsonProperty
+ public void setWso2UploadFilePath(String wso2UploadFilePath) {
+ this.wso2UploadFilePath = wso2UploadFilePath;
+ }
+
+ @JsonProperty
+ public String getWso2SslJksFile() {
+ return wso2SslJksFile;
+ }
+
+ @JsonProperty
+ public void setWso2SslJksFile(String wso2SslJksFile) {
+ this.wso2SslJksFile = wso2SslJksFile;
+ }
+
+ @JsonProperty
+ public String getWso2SslJksPassword() {
+ return wso2SslJksPassword;
+ }
+
+ @JsonProperty
+ public void setWso2SslJksPassword(String wso2SslJksPassword) {
+ this.wso2SslJksPassword = wso2SslJksPassword;
+ }
}
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java
deleted file mode 100644
index e5bd4bd..0000000
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/AbstractBpsProperties.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/**
- * Copyright 2016 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.openo.carbon.bpel.config;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.util.Properties;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.log4j.Logger;
-
-public abstract class AbstractBpsProperties {
- private static final Logger dmsg = Logger.getLogger(AbstractBpsProperties.class.getName());
- private Properties properties;
-
- protected AbstractBpsProperties() {
- properties = new Properties();
- /*
- * URL commonConfigURL = AbstractBpsProperties.class.getResource(getConfigName()); if
- * (commonConfigURL != null) { try { properties.load(new FileInputStream(new
- * File(commonConfigURL.getFile()))); } catch (IOException e) { dmsg.error(e.getMessage(), e); }
- * }
- */
-
- File propertyFile = new File(getConfigName());
- try {
- if (propertyFile != null) {
- properties.load(this.getClass().getResourceAsStream("/" + propertyFile.getName()));
- }
- } catch (FileNotFoundException e) {
- dmsg.error(e.getMessage(), e);
- } catch (Exception e) {
- dmsg.error(e.getMessage(), e);
- }
-
- }
-
- protected abstract String getConfigName();
-
- public String getProperty(String propertyName) {
- String value = properties.getProperty(propertyName);
- return StringUtils.trimToEmpty(value);
- }
-}
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java
deleted file mode 100644
index f53ea8c..0000000
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsCommonProperties.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * Copyright 2016 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.openo.carbon.bpel.config;
-
-public class BpsCommonProperties extends AbstractBpsProperties {
- private static BpsCommonProperties instance;
-
- public static BpsCommonProperties getInstance() {
- if (instance == null) {
- instance = new BpsCommonProperties();
- }
- return instance;
- }
-
- @Override
- protected String getConfigName() {
- return "config.properties";
- }
-
-}
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java
deleted file mode 100644
index 7855a86..0000000
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/BpsExtraProperties.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright 2016 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.openo.carbon.bpel.config;
-
-public class BpsExtraProperties extends AbstractBpsProperties {
- private static BpsExtraProperties instance = null;
-
- public static synchronized BpsExtraProperties getInstance() {
- if (instance == null) {
- instance = new BpsExtraProperties();
- }
- return instance;
- }
-
- @Override
- protected String getConfigName() {
- /*
- * String[] paths = null; URL url = BpsExtraProperties.class.getResource(""); if (url != null) {
- * paths = url.getPath().split("jar!"); } if (paths == null || paths.length <= 1) { return null;
- * }
- */
- return "wso2-config.properties";
- }
-}
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java
deleted file mode 100644
index 6f89a32..0000000
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/config/ConfigManager.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Copyright 2016 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.openo.carbon.bpel.config;
-
-import org.apache.commons.lang3.StringUtils;
-
-public class ConfigManager {
- private static BpsExtraProperties extraProperties;
- private static BpsCommonProperties commonProperties;
- private static ConfigManager instance = null;
-
- private ConfigManager() {
- commonProperties = BpsCommonProperties.getInstance();
- extraProperties = BpsExtraProperties.getInstance();
- }
-
- public static synchronized ConfigManager getInstance() {
- if (instance == null) {
- instance = new ConfigManager();
- }
- return instance;
- }
-
- public String getProperty(String key) {
- String value = extraProperties.getProperty(key);
- value = StringUtils.trimToEmpty(value);
- if (StringUtils.isBlank(value)) {
- return commonProperties.getProperty(key);
- }
- return value;
- }
-
-}
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java
index ee819de..efffe67 100644
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java
+++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsPackage.java
@@ -67,7 +67,7 @@ import org.glassfish.jersey.media.multipart.FormDataParam;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.glassfish.jersey.media.multipart.file.FileDataBodyPart;
import org.wso2.carbon.bpel.stub.upload.types.UploadedFileItem;
-import org.openo.carbon.bpel.config.ConfigManager;
+import org.openo.carbon.bpel.common.Config;
import org.openo.carbon.bpel.util.JsonUtil;
import org.openo.carbon.bpel.util.Xml2JsonUtil;
@@ -78,7 +78,7 @@ import com.fasterxml.jackson.databind.JsonMappingException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-@Path("/openoapi/wso2bpel/v1")
+@Path("/")
@Api(tags = {"wso2 bpel api"})
public class BpsPackage {
@@ -101,16 +101,13 @@ public class BpsPackage {
private synchronized String getConfig(String key) {
if (configMap == null) {
configMap = new HashMap<String, String>();
- String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path");
- String jksFile = ConfigManager.getInstance().getProperty("wso2.ssl.jks.file");
- String trustStorePassword =
- ConfigManager.getInstance().getProperty("wso2.ssl.trustStorePassword");
- String httpUsername =
- ConfigManager.getInstance().getProperty("wso2.http.authenticator.username");
- String httpPassword =
- ConfigManager.getInstance().getProperty("wso2.http.authenticator.password");
- String host = ConfigManager.getInstance().getProperty("wso2.host");
- String port = ConfigManager.getInstance().getProperty("wso2.http.port");
+ String uploadFilePath = Config.getConfigration().getWso2UploadFilePath();
+ String jksFile = Config.getConfigration().getWso2SslJksFile();
+ String trustStorePassword = Config.getConfigration().getWso2SslJksPassword();
+ String httpUsername = Config.getConfigration().getWso2AuthUserName();
+ String httpPassword = Config.getConfigration().getWso2AuthPassword();
+ String host = Config.getConfigration().getWso2Host();
+ String port = Config.getConfigration().getWso2HostPort();
configMap.put("uploadFilePath", uploadFilePath);
configMap.put("jksFile", jksFile);
configMap.put("trustStorePassword", trustStorePassword);
@@ -122,7 +119,7 @@ public class BpsPackage {
if (configMap.containsKey(key)) {
return configMap.get(key);
} else {
- return ConfigManager.getInstance().getProperty(key);
+ return "";
}
}
diff --git a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java
index c86a01e..148e309 100644
--- a/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java
+++ b/wso2bpel-ext/wso2bpel-core/wso2bpel-mgr/src/main/java/org/openo/carbon/bpel/resources/BpsProcess.java
@@ -63,7 +63,7 @@ import org.apache.axis2.transport.http.HttpTransportProperties.Authenticator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
-import org.openo.carbon.bpel.config.ConfigManager;
+import org.openo.carbon.bpel.common.Config;
import org.openo.carbon.bpel.util.JsonUtil;
import org.openo.carbon.bpel.util.SoapUtil;
import org.openo.carbon.bpel.util.Xml2JsonUtil;
@@ -79,7 +79,7 @@ import com.fasterxml.jackson.databind.JsonNode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
-@Path("/openoapi/wso2bpel/v1")
+@Path("/")
@Api(tags = {"wso2 bpel api"})
public class BpsProcess {
@@ -100,7 +100,8 @@ public class BpsProcess {
private synchronized String getConfig(String key) {
if (configMap == null) {
configMap = new HashMap<String, String>();
- String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path");
+ //Config.getConfigration().getMsbServerAddr();
+ /* String uploadFilePath = ConfigManager.getInstance().getProperty("wso2.uploadfile.path");
String jksFile = ConfigManager.getInstance().getProperty("wso2.ssl.jks.file");
String trustStorePassword =
ConfigManager.getInstance().getProperty("wso2.ssl.trustStorePassword");
@@ -109,7 +110,14 @@ public class BpsProcess {
String httpPassword =
ConfigManager.getInstance().getProperty("wso2.http.authenticator.password");
String host = ConfigManager.getInstance().getProperty("wso2.host");
- String port = ConfigManager.getInstance().getProperty("wso2.http.port");
+ String port = ConfigManager.getInstance().getProperty("wso2.http.port");*/
+ String uploadFilePath = Config.getConfigration().getWso2UploadFilePath();
+ String jksFile = Config.getConfigration().getWso2SslJksFile();
+ String trustStorePassword = Config.getConfigration().getWso2SslJksPassword();
+ String httpUsername = Config.getConfigration().getWso2AuthUserName();
+ String httpPassword = Config.getConfigration().getWso2AuthPassword();
+ String host = Config.getConfigration().getWso2Host();
+ String port = Config.getConfigration().getWso2HostPort();
configMap.put("uploadFilePath", uploadFilePath);
configMap.put("jksFile", jksFile);
configMap.put("trustStorePassword", trustStorePassword);
@@ -121,7 +129,7 @@ public class BpsProcess {
if (configMap.containsKey(key)) {
return configMap.get(key);
} else {
- return ConfigManager.getInstance().getProperty(key);
+ return "";
}
}