package org.onap.vnfsdk.marketplace.common;
public class CommonConstant {
- // Address
- public static final String DEFAULT_MSB_ADDRESS = "http://127.0.0.1:8080";
// Package Status
public static final String PACKAGE_STATUS_DELETING = "deleting";
}
}
- public static class LifeCycleTest
- {
- public static final String LIFECYCLE_TEST_URL = "/openoapi/nslcm/v1/vnfpackage";
- public static final String LIFECYCLE_TEST_OPERTYPE_ID = "lifecycletest";
- public static final String LIFECYCLE_TEST_EXEC = "lifecycleTestexec";
- private LifeCycleTest() {
- }
- }
-
public static class HttpContext {
public static final String CONTENT_TYPE = "Content-Type";
}
}
+ public static class LifeCycleTest
+ {
+ public static final String LIFECYCLE_TEST_URL = "/openoapi/nslcm/v1/vnfpackage";
+ public static final String LIFECYCLE_TEST_OPERTYPE_ID = "lifecycletest";
+ public static final String LIFECYCLE_TEST_EXEC = "lifecycleTestexec";
+ private LifeCycleTest() {
+ }
+ }
+
public static class MethodType {
public static final String POST = "post";
* limitations under the License.
*/
package org.onap.vnfsdk.marketplace.common;
+import java.net.InetAddress;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class HttpServerPathConfig {
+ public static final Logger logger = LoggerFactory.getLogger(FileUtil.class);
+
protected static String httpServerPath;
private HttpServerPathConfig() {
static
{
- MsbAddrConfig.setMsbAddress(CommonConstant.DEFAULT_MSB_ADDRESS);
- HttpServerAddrConfig.setHttpServerAddress(CommonConstant.DEFAULT_MSB_ADDRESS);
- HttpServerPathConfig.setHttpServerPath("../tomcat/webapps/ROOT/");
+ try {
+ InetAddress address = InetAddress.getByName("localhost");
+ String msbAddress = "http://" + address.getHostAddress() + ":8080";
+ MsbAddrConfig.setMsbAddress(msbAddress);
+ HttpServerAddrConfig.setHttpServerAddress(msbAddress);
+ HttpServerPathConfig.setHttpServerPath("../tomcat/webapps/ROOT/");
+ } catch (Exception e) {
+ logger.info("error while config htttp server", e);
+ }
}
public static String getHttpServerPath() {