package org.onap.aai.esr.externalservice.aai;
import org.glassfish.jersey.client.ClientConfig;
+import org.onap.aai.esr.entity.aai.EsrThirdpartySdncDetail;
import org.onap.aai.esr.entity.aai.EsrVnfmDetail;
import com.eclipsesource.jaxrs.consumer.ConsumerFactory;
public class ExternalSystemProxy {
- private static IExternalSystem adapterServiceproxy;
+ private static IExternalSystem externalSystemproxy;
private static String transactionId = "9999";
private static String fromAppId = "esr-server";
private static String authorization = AaiCommon.getAuthenticationCredentials();
static {
ClientConfig config = new ClientConfig();
- adapterServiceproxy = ConsumerFactory.createConsumer(AaiAdapterConfig.getExternalSystemAddr(),
+ externalSystemproxy = ConsumerFactory.createConsumer(AaiAdapterConfig.getExternalSystemAddr(),
config, IExternalSystem.class);
}
public static void registerVnfm(String vnfmId, EsrVnfmDetail esrVnfmDetail) throws Exception {
- ClientConfig config = new ClientConfig(new RegisterVnfmProvider());
+ ClientConfig config = new ClientConfig(new VnfmRegisterProvider());
IExternalSystem registerVnfmServiceproxy = ConsumerFactory
.createConsumer(AaiAdapterConfig.getExternalSystemAddr(), config, IExternalSystem.class);
registerVnfmServiceproxy.registerVNFM(transactionId, fromAppId, authorization, vnfmId,
esrVnfmDetail);
}
+ public static String queryVnfmDetail(String vnfmId) throws Exception {
+ return externalSystemproxy.queryVNFMDetail(transactionId, fromAppId, authorization, vnfmId);
+ }
+
+ public static String queryVnfmList() throws Exception {
+ return externalSystemproxy.queryVNFMList(transactionId, fromAppId, authorization);
+ }
+
+ public static void deleteVnfm(String vnfmId, String resourceVersion) throws Exception {
+ externalSystemproxy.deleteVNFM(transactionId, fromAppId, authorization, vnfmId, resourceVersion);
+ }
+ public static void registerSdnc(String thirdpartySdncId, EsrThirdpartySdncDetail esrSdncDetail) throws Exception {
+ ClientConfig config = new ClientConfig(new ThirdpartySdncRegisterProvider());
+ IExternalSystem registerVnfmServiceproxy = ConsumerFactory
+ .createConsumer(AaiAdapterConfig.getExternalSystemAddr(), config, IExternalSystem.class);
+ registerVnfmServiceproxy.registerThirdpartySdnc(transactionId, fromAppId, authorization, thirdpartySdncId,
+ esrSdncDetail);
+ }
+
+ public static String queryThirdpartySdncDetail(String thirdpartySdncId) throws Exception{
+ return externalSystemproxy.queryThirdpartySdncDetail(transactionId, fromAppId, authorization, thirdpartySdncId);
+ }
}