From: lizi00164331 Date: Thu, 21 Sep 2017 11:42:48 +0000 (+0800) Subject: Clean the config files. X-Git-Tag: v1.0.0~37 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=aai%2Fesr-server.git;a=commitdiff_plain;h=d7cc6171ecddd8450ed0466fe528518738f3dd08 Clean the config files. Change-Id: I8465d6cc84a2e24e26c9904f949d560fd7399216 Issue-ID: AAI-362 Signed-off-by: lizi00164331 --- diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java index 93459c7..5e8c2a1 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysApp.java @@ -16,9 +16,8 @@ package org.onap.aai.esr; -import org.onap.aai.esr.externalservice.aai.AaiAdapterConfig; +import org.onap.aai.esr.common.MsbConfig; import org.onap.aai.esr.externalservice.msb.MsbHelper; -import org.onap.aai.esr.externalservice.msb.MsbInfoConfig; import org.onap.aai.esr.resource.EmsManager; import org.onap.aai.esr.resource.ThirdpatySdncManager; import org.onap.aai.esr.resource.VimManager; @@ -46,10 +45,9 @@ public class ExtsysApp extends Application { @Override public void run(ExtsysAppConfiguration configuration, Environment environment) { LOGGER.info("Start to initialize esr."); - AaiAdapterConfig.setCloudInfrastructureAddr(configuration.getCloudInfrastructureAddr()); - AaiAdapterConfig.setExternalSystemAddr(configuration.getExternalSystemAddr()); - MsbInfoConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp()); - MsbInfoConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort()); + MsbConfig.setMsbServerAddr(configuration.getMsbServerAddr()); + MsbConfig.setMsbDiscoveryIp(configuration.getMsbDiscoveryIp()); + MsbConfig.setMsbDiscoveryPort(configuration.getMsbDiscoveryPort()); environment.jersey().register(new EmsManager()); environment.jersey().register(new ThirdpatySdncManager()); environment.jersey().register(new VimManager()); diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java index 39fc2a6..f0b6097 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/ExtsysAppConfiguration.java @@ -44,15 +44,6 @@ public class ExtsysAppConfiguration extends Configuration { @NotEmpty private String msbServerAddr; - @NotEmpty - private String cloudInfrastructureAddr; - - @NotEmpty - private String externalSystemAddr; - - @NotEmpty - private String multiCloudAddr; - @Valid private String serviceIp; @@ -125,38 +116,4 @@ public class ExtsysAppConfiguration extends Configuration { return msbDiscoveryPort; } - @JsonProperty - public String getCloudInfrastructureAddr() { - return cloudInfrastructureAddr; - } - - @JsonProperty - public void setCloudInfrastructureAddr(String cloudInfrastructureAddr) { - this.cloudInfrastructureAddr = cloudInfrastructureAddr; - } - - @JsonProperty - public String getExternalSystemAddr() { - return externalSystemAddr; - } - - @JsonProperty - public void setExternalSystemAddr(String externalSystemAddr) { - this.externalSystemAddr = externalSystemAddr; - } - - @JsonProperty - public void setMsbDiscoveryIp(String msbDiscoveryIp) { - this.msbDiscoveryIp = msbDiscoveryIp; - } - - @JsonProperty - public String getMultiCloudAddr() { - return multiCloudAddr; - } - - @JsonProperty - public void setMultiCloudAddr(String multiCloudAddr) { - this.multiCloudAddr = multiCloudAddr; - } } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/AaiAdapterConfig.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/AaiAdapterConfig.java deleted file mode 100644 index 4c8a786..0000000 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/AaiAdapterConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2017 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.aai.esr.externalservice.aai; - -public class AaiAdapterConfig { - - protected static String cloudInfrastructureAddr; - - protected static String externalSystemAddr; - - public static void setCloudInfrastructureAddr(String address){ - cloudInfrastructureAddr = address; - } - - public static String getCloudInfrastructureAddr(){ - return cloudInfrastructureAddr; - } - - public static String getExternalSystemAddr() { - return externalSystemAddr; - } - - public static void setExternalSystemAddr(String externalSystemAddr) { - AaiAdapterConfig.externalSystemAddr = externalSystemAddr; - } -} diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/CloudRegionProxy.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/CloudRegionProxy.java index 89b8ab2..aeda6cf 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/CloudRegionProxy.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/CloudRegionProxy.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.externalservice.aai; import org.glassfish.jersey.client.ClientConfig; +import org.onap.aai.esr.common.MsbConfig; import org.onap.aai.esr.entity.aai.CloudRegionDetail; import com.eclipsesource.jaxrs.consumer.ConsumerFactory; @@ -29,7 +30,7 @@ public class CloudRegionProxy { private static String authorization = AaiCommon.getAuthenticationCredentials(); static { ClientConfig config = new ClientConfig(); - adapterServiceproxy = ConsumerFactory.createConsumer(AaiAdapterConfig.getCloudInfrastructureAddr(), + adapterServiceproxy = ConsumerFactory.createConsumer(MsbConfig.getCloudInfrastructureAddr(), config, ICloudRegion.class); } @@ -37,7 +38,7 @@ public class CloudRegionProxy { CloudRegionDetail cloudRegion) throws Exception { ClientConfig config = new ClientConfig(new VimRegisterProvider()); ICloudRegion registerVimServiceproxy = ConsumerFactory - .createConsumer(AaiAdapterConfig.getCloudInfrastructureAddr(), config, ICloudRegion.class); + .createConsumer(MsbConfig.getCloudInfrastructureAddr(), config, ICloudRegion.class); registerVimServiceproxy.registerVIMService(transactionId, fromAppId, authorization, cloudOwner, cloudRegionId, cloudRegion); } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java index 046a25b..c8033ad 100644 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java +++ b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/aai/ExternalSystemProxy.java @@ -16,6 +16,7 @@ package org.onap.aai.esr.externalservice.aai; import org.glassfish.jersey.client.ClientConfig; +import org.onap.aai.esr.common.MsbConfig; import org.onap.aai.esr.entity.aai.EsrEmsDetail; import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail; import org.onap.aai.esr.entity.aai.EsrVnfmDetail; @@ -31,14 +32,14 @@ public class ExternalSystemProxy { private static String authorization = AaiCommon.getAuthenticationCredentials(); static { ClientConfig config = new ClientConfig(); - externalSystemproxy = ConsumerFactory.createConsumer(AaiAdapterConfig.getExternalSystemAddr(), + externalSystemproxy = ConsumerFactory.createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class); } public static void registerVnfm(String vnfmId, EsrVnfmDetail esrVnfmDetail) throws Exception { ClientConfig config = new ClientConfig(new VnfmRegisterProvider()); IExternalSystem registerVnfmServiceproxy = ConsumerFactory - .createConsumer(AaiAdapterConfig.getExternalSystemAddr(), config, IExternalSystem.class); + .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class); registerVnfmServiceproxy.registerVNFM(transactionId, fromAppId, authorization, vnfmId, esrVnfmDetail); } @@ -58,7 +59,7 @@ public class ExternalSystemProxy { public static void registerSdnc(String thirdpartySdncId, EsrThirdpartySdncDetail esrSdncDetail) throws Exception { ClientConfig config = new ClientConfig(new ThirdpartySdncRegisterProvider()); IExternalSystem registerSdncServiceproxy = ConsumerFactory - .createConsumer(AaiAdapterConfig.getExternalSystemAddr(), config, IExternalSystem.class); + .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class); registerSdncServiceproxy.registerThirdpartySdnc(transactionId, fromAppId, authorization, thirdpartySdncId, esrSdncDetail); } @@ -78,7 +79,7 @@ public class ExternalSystemProxy { public static void registerEms(String emsId, EsrEmsDetail emsDetail) throws Exception { ClientConfig config = new ClientConfig(new EmsRegisterProvider()); IExternalSystem registerEmsServiceproxy = ConsumerFactory - .createConsumer(AaiAdapterConfig.getExternalSystemAddr(), config, IExternalSystem.class); + .createConsumer(MsbConfig.getExternalSystemAddr(), config, IExternalSystem.class); registerEmsServiceproxy.registerEMS(transactionId, fromAppId, authorization, emsId, emsDetail); } diff --git a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/msb/MsbInfoConfig.java b/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/msb/MsbInfoConfig.java deleted file mode 100644 index fca641f..0000000 --- a/esr-mgr/src/main/java/org/onap/aai/esr/externalservice/msb/MsbInfoConfig.java +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Copyright 2017 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.aai.esr.externalservice.msb; - -public class MsbInfoConfig { - - protected static String msbDiscoveryIp; - - protected static String msbDiscoveryPort; - - public static String getMsbDiscoveryIp() { - return msbDiscoveryIp; - } - - public static void setMsbDiscoveryIp(String msbDiscoveryIp) { - MsbInfoConfig.msbDiscoveryIp = msbDiscoveryIp; - } - - public static String getMsbDiscoveryPort() { - return msbDiscoveryPort; - } - - public static void setMsbDiscoveryPort(String msbDiscoveryPort) { - MsbInfoConfig.msbDiscoveryPort = msbDiscoveryPort; - } -} diff --git a/standalone/src/main/assembly/conf/extsys.yml b/standalone/src/main/assembly/conf/extsys.yml index abcddd8..c06c70f 100644 --- a/standalone/src/main/assembly/conf/extsys.yml +++ b/standalone/src/main/assembly/conf/extsys.yml @@ -21,10 +21,7 @@ template: Hello, %s! serviceIp: msbDiscoveryIp: 127.0.0.1 msbDiscoveryPort: 10081 -msbServerAddr: http://127.0.0.1:10081 -cloudInfrastructureAddr: http://127.0.0.1/api/aai-cloudInfrastructure/v11 -externalSystemAddr: http://127.0.0.1/api/aai-externalSystem/v11 -multiCloudAddr: http://10.74.148.80/api/multicloud/v0 +msbServerAddr: http://10.74.148.80:80 registByHand: true # use the simple server factory if you only want to run on a single port