From 5f08a74275ddf29ba623bbfa609485a9dbb34c24 Mon Sep 17 00:00:00 2001 From: Arthur Martella Date: Tue, 22 May 2018 16:22:54 -0400 Subject: APPC client changes topic for controllerType When controllerType is sdnc, it's still using the appc topic names. Trying this to switch topic based on controllerType. Patch 2 changed to match APPCClient in ATT code base. Change-Id: I72e7e84720f73ac30d3d28e3387af2d537d301ad Issue-ID: INT-475 Signed-off-by: Arthur Martella --- .../openecomp/mso/client/appc/ApplicationControllerClient.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'bpmn/MSOCommonBPMN') diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java index 3cd26be631..3515aa9218 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/openecomp/mso/client/appc/ApplicationControllerClient.java @@ -83,7 +83,7 @@ public class ApplicationControllerClient { /** * Creates an ApplicationControllerClient for the specified controller type. - * @param controllerType the controller type: "appc" or "sndnc". + * @param controllerType the controller type: "appc" or "sdnc". */ public ApplicationControllerClient(String controllerType) { this.controllerType = controllerType; @@ -110,7 +110,7 @@ public class ApplicationControllerClient { protected LifeCycleManagerStateful createAppCClient(String controllerType) { try { return AppcClientServiceFactoryProvider.getFactory(AppcLifeCycleManagerServiceFactory.class) - .createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties()); + .createLifeCycleManagerStateful(new ApplicationContext(), getLCMProperties(controllerType)); } catch (AppcClientException e) { auditLogger.log(Level.ERROR, "Error in getting LifeCycleManagerStateful: ", e, e.getMessage()); // This null value will cause NullPointerException when used later. @@ -135,6 +135,10 @@ public class ApplicationControllerClient { } protected Properties getLCMProperties() { + return getLCMProperties("appc"); + } + + protected Properties getLCMProperties(String controllerType) { Properties properties = new Properties(); Map globalProperties = PropertyConfiguration.getInstance() .getProperties("mso.bpmn.urn.properties"); @@ -145,6 +149,7 @@ public class ApplicationControllerClient { properties.put("topic.read.timeout", globalProperties.get("appc.client.topic.read.timeout")); properties.put("client.response.timeout", globalProperties.get("appc.client.response.timeout")); properties.put("poolMembers", globalProperties.get("appc.client.poolMembers")); + properties.put("client.controllerType", controllerType); properties.put("client.key", globalProperties.get("appc.client.key")); properties.put("client.secret", globalProperties.get("appc.client.secret")); properties.put("client.name", CLIENT_NAME); -- cgit 1.2.3-korg