diff options
author | Taka <tc012c@att.com> | 2017-12-20 13:07:21 -0500 |
---|---|---|
committer | Skip Wonnell <skip@att.com> | 2017-12-21 16:02:38 +0000 |
commit | 02fa7b3c5a6726902ff76bcce50a1b239969a8e2 (patch) | |
tree | 6fc6a4f99d9805d24eabafd554703d0140d9764b /appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java | |
parent | f602f93440893507068a2e4e76816bdcdb6a39ad (diff) |
Fix sonar issues for APPC
Change-Id: I386f6794215eb69b8547fa06193ad78f951b327b
Issue-ID: APPC-323
Signed-off-by: Taka <tc012c@att.com>
Diffstat (limited to 'appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java')
3 files changed, 23 insertions, 26 deletions
diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java index a4bbcbef8..6b7369cfb 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResult.java @@ -27,59 +27,59 @@ package org.onap.appc.adapter.ansible.model; /* Simple class to store code and message returned by POST/GET to an Ansible Server */ public class AnsibleResult{ - private int StatusCode; - private String StatusMessage; - private String Results; + private int statusCode; + private String statusMessage; + private String results; public AnsibleResult(){ - StatusCode = -1; - StatusMessage = "UNKNOWN"; - Results = "UNKNOWN"; + statusCode = -1; + statusMessage = "UNKNOWN"; + results = "UNKNOWN"; } // constructor public AnsibleResult(int code, String message, String result){ - StatusCode = code; - StatusMessage = message; - Results = result; + statusCode = code; + statusMessage = message; + results = result; } //************************************************* // Various set methods public void setStatusCode(int code){ - this.StatusCode = code; + this.statusCode = code; } public void setStatusMessage(String message){ - this.StatusMessage = message; + this.statusMessage = message; } public void setResults(String results){ - this.Results = results; + this.results = results; } void set(int code, String message, String results){ - this.StatusCode = code; - this.StatusMessage = message; - this.Results = results; + this.statusCode = code; + this.statusMessage = message; + this.results = results; } //********************************************* // Various get methods public int getStatusCode(){ - return this.StatusCode; + return this.statusCode; } public String getStatusMessage(){ - return this.StatusMessage; + return this.statusMessage; } public String getResults(){ - return this.Results; + return this.results; } diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java index 986ad3e6a..5d44f6dae 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleResultCodes.java @@ -53,9 +53,9 @@ public enum AnsibleResultCodes{ INITRESPONSE(0), FINALRESPONSE(1); - private final Set<Integer> InitCodes = new HashSet<Integer>(Arrays.asList(100, 101)); - private final Set<Integer> FinalCodes = new HashSet<Integer>(Arrays.asList(200, 500)); - private final ArrayList<Set<Integer>>CodeSets = new ArrayList<Set<Integer>>(Arrays.asList(InitCodes, FinalCodes)); + private final Set<Integer> initCodes = new HashSet<Integer>(Arrays.asList(100, 101)); + private final Set<Integer> finalCodes = new HashSet<Integer>(Arrays.asList(200, 500)); + private final ArrayList<Set<Integer>>codeSets = new ArrayList<Set<Integer>>(Arrays.asList(initCodes, finalCodes)); private final Set<String> MessageSet = new HashSet<String>(Arrays.asList("PENDING", "FINISHED", "TERMINATED")); @@ -72,7 +72,7 @@ public enum AnsibleResultCodes{ public boolean checkValidCode(int Type, int Code){ - Set<Integer>CodeSet = CodeSets.get(Type); + Set<Integer>CodeSet = codeSets.get(Type); if (CodeSet.contains(Code)){ return true; } @@ -83,7 +83,7 @@ public enum AnsibleResultCodes{ public String getValidCodes(int Type){ - Set<Integer>CodeSet = CodeSets.get(Type); + Set<Integer>CodeSet = codeSets.get(Type); Iterator iter = CodeSet.iterator(); String ValidCodes = "[ "; diff --git a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java index c430743ad..7b7d95580 100644 --- a/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java +++ b/appc-adapters/appc-ansible-adapter/appc-ansible-adapter-bundle/src/main/java/org/onap/appc/adapter/ansible/model/AnsibleServerEmulator.java @@ -35,12 +35,9 @@ package org.onap.appc.adapter.ansible.model; import java.util.*; import java.util.regex.Pattern; import java.util.regex.Matcher; -import com.google.common.base.Strings; import org.json.JSONObject; -import org.json.JSONArray; import org.json.JSONException; -import org.onap.appc.exceptions.APPCException; import org.onap.appc.adapter.ansible.model.AnsibleResult; public class AnsibleServerEmulator { |