From 7b25afd7fbb945686f5444e05e5e15716052b027 Mon Sep 17 00:00:00 2001 From: "Singal, Kapil (ks220y)" Date: Mon, 26 Apr 2021 13:41:57 -0400 Subject: Moving Netconf-adaptor from APPC to CCSDK SLI Issue-ID: CCSDK-3198 Signed-off-by: Singal, Kapil (ks220y) Change-Id: I638d57729d100211325f4e3121970d6737b9a50c --- .../ansible-adaptor/ansible-adaptor-bundle/pom.xml | 31 +++++++++++++--------- .../adaptors/ansible/impl/AnsibleAdaptorImpl.java | 10 +++---- .../impl/AnsibleAdaptorPropertiesProviderImpl.java | 10 +++---- 3 files changed, 28 insertions(+), 23 deletions(-) (limited to 'adaptors/ansible-adaptor/ansible-adaptor-bundle') diff --git a/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml b/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml index be24ed12d..87cc609ee 100644 --- a/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml +++ b/adaptors/ansible-adaptor/ansible-adaptor-bundle/pom.xml @@ -1,18 +1,23 @@ - + 4.0.0 diff --git a/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorImpl.java b/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorImpl.java index 790b10f92..8c9c14e54 100644 --- a/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorImpl.java +++ b/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorImpl.java @@ -56,7 +56,7 @@ public class AnsibleAdaptorImpl implements AnsibleAdaptor { * Adaptor Name */ private static final String Adaptor_NAME = "Ansible Adaptor"; - private static final String APPC_EXCEPTION_CAUGHT = "APPCException caught"; + private static final String SVC_LOGIC_EXCEPTION_CAUGHT = "SvcLogicException caught"; /** * The logger to be used @@ -254,7 +254,7 @@ public class AnsibleAdaptorImpl implements AnsibleAdaptor { ctx.setAttribute("AnsibleTimeout", timeout); logger.info("Updated Payload = {} timeout = {}", payload, timeout); } catch (SvcLogicException e) { - logger.error(APPC_EXCEPTION_CAUGHT, e); + logger.error(SVC_LOGIC_EXCEPTION_CAUGHT, e); doFailure(ctx, AnsibleResultCodes.INVALID_PAYLOAD.getValue(), "Error constructing request for execution of playbook due to missing mandatory parameters. Reason = " + e.getMessage()); @@ -302,7 +302,7 @@ public class AnsibleAdaptorImpl implements AnsibleAdaptor { doFailure(ctx, code, "Ansible Test result is null"); } } catch (SvcLogicException e) { - logger.error(APPC_EXCEPTION_CAUGHT, e); + logger.error(SVC_LOGIC_EXCEPTION_CAUGHT, e); doFailure(ctx, AnsibleResultCodes.UNKNOWN_EXCEPTION.getValue(), "Exception encountered when posting request for execution of playbook. Reason = " + e.getMessage()); } @@ -418,7 +418,7 @@ public class AnsibleAdaptorImpl implements AnsibleAdaptor { } logger.info("Got uri {}", reqUri); } catch (SvcLogicException e) { - logger.error(APPC_EXCEPTION_CAUGHT, e); + logger.error(SVC_LOGIC_EXCEPTION_CAUGHT, e); doFailure(ctx, AnsibleResultCodes.INVALID_PAYLOAD.getValue(), "Error constructing request to retrieve result due to missing parameters. Reason = " + e.getMessage()); @@ -463,7 +463,7 @@ public class AnsibleAdaptorImpl implements AnsibleAdaptor { } logger.info("Request response = " + message); } catch (SvcLogicException e) { - logger.error(APPC_EXCEPTION_CAUGHT, e); + logger.error(SVC_LOGIC_EXCEPTION_CAUGHT, e); ctx.setAttribute(RESULTS_ATTRIBUTE_NAME, results); ctx.setAttribute(OUTPUT_ATTRIBUTE_NAME, finalResponse); doFailure(ctx, AnsibleResultCodes.UNKNOWN_EXCEPTION.getValue(), diff --git a/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorPropertiesProviderImpl.java b/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorPropertiesProviderImpl.java index d33fdd855..1ee032a4f 100644 --- a/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorPropertiesProviderImpl.java +++ b/adaptors/ansible-adaptor/ansible-adaptor-bundle/src/main/java/org/onap/ccsdk/sli/adaptors/ansible/impl/AnsibleAdaptorPropertiesProviderImpl.java @@ -63,7 +63,7 @@ public class AnsibleAdaptorPropertiesProviderImpl implements AnsibleAdaptorPrope /** * The name of the properties file for database configuration */ - private static final String ANSIBLE_Adaptor_PROPERTIES = "ansible-adaptor.properties"; + private static final String ANSIBLE_ADAPTOR_PROPERTIES = "ansible-adaptor.properties"; /** * A prioritized list of strategies for resolving sql-resource properties files. @@ -102,7 +102,7 @@ public class AnsibleAdaptorPropertiesProviderImpl implements AnsibleAdaptorPrope } } else { // Try to read properties as resource - InputStream propStr = getClass().getResourceAsStream("/" + ANSIBLE_Adaptor_PROPERTIES); + InputStream propStr = getClass().getResourceAsStream("/" + ANSIBLE_ADAPTOR_PROPERTIES); if (propStr != null) { properties = new EnvProperties(); try { @@ -115,7 +115,7 @@ public class AnsibleAdaptorPropertiesProviderImpl implements AnsibleAdaptorPrope } if (properties == null) { reportFailure(new ConfigurationException( - "Missing configuration properties resource(3): " + ANSIBLE_Adaptor_PROPERTIES)); + "Missing configuration properties resource(3): " + ANSIBLE_ADAPTOR_PROPERTIES)); LOG.info("Defaulting org.onap.appc.adaptor.ansible.clientType to TRUST_ALL"); properties = new Properties(); properties.setProperty("org.onap.appc.adaptor.ansible.clientType", "TRUST_ALL"); @@ -137,7 +137,7 @@ public class AnsibleAdaptorPropertiesProviderImpl implements AnsibleAdaptorPrope } if (properties == null) { reportFailure(new ConfigurationException( - "Missing configuration properties resource(3): " + ANSIBLE_Adaptor_PROPERTIES)); + "Missing configuration properties resource(3): " + ANSIBLE_ADAPTOR_PROPERTIES)); LOG.info("Defaulting org.onap.appc.adaptor.ansible.clientType to TRUST_ALL"); properties = new Properties(); properties.setProperty("org.onap.appc.adaptor.ansible.clientType", "TRUST_ALL"); @@ -196,7 +196,7 @@ public class AnsibleAdaptorPropertiesProviderImpl implements AnsibleAdaptorPrope */ File determinePropertiesFile() { for (final PropertiesFileResolver propertiesFileResolver : ansibleAdaptorPropertiesFileResolvers) { - final Optional fileOptional = propertiesFileResolver.resolveFile(ANSIBLE_Adaptor_PROPERTIES); + final Optional fileOptional = propertiesFileResolver.resolveFile(ANSIBLE_ADAPTOR_PROPERTIES); if (fileOptional.isPresent()) { return reportSuccess(propertiesFileResolver.getSuccessfulResolutionMessage(), fileOptional); } -- cgit 1.2.3-korg