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;
@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());
@NotEmpty
private String msbServerAddr;
- @NotEmpty
- private String cloudInfrastructureAddr;
-
- @NotEmpty
- private String externalSystemAddr;
-
- @NotEmpty
- private String multiCloudAddr;
-
@Valid
private String serviceIp;
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;
- }
}
+++ /dev/null
-/**
- * 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;
- }
-}
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;
private static String authorization = AaiCommon.getAuthenticationCredentials();
static {
ClientConfig config = new ClientConfig();
- adapterServiceproxy = ConsumerFactory.createConsumer(AaiAdapterConfig.getCloudInfrastructureAddr(),
+ adapterServiceproxy = ConsumerFactory.createConsumer(MsbConfig.getCloudInfrastructureAddr(),
config, ICloudRegion.class);
}
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);
}
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;
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);
}
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);
}
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);
}
+++ /dev/null
-/**
- * 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;
- }
-}
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