aboutsummaryrefslogtreecommitdiffstats
path: root/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java
diff options
context:
space:
mode:
authorRavindra Bakkamanthala <rb7147@att.com>2017-05-23 14:56:12 -0400
committerRavindra Bakkamanthala <rb7147@att.com>2017-05-23 16:49:56 -0400
commit87c95be02a8a4d77e165dede90777e811b59dcae (patch)
tree4712199fc3520b530dda0c4d3b074c327df547f2 /ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java
parent7e547eaa55920dfbc9691eab33bb728395b50cf2 (diff)
Commit includes ControlLoopPolicy API and bugfixes
Change-Id: I3e18bb8b4c31a0d908bb0cff4c85e2a3fb450a63 Signed-off-by: Ravindra Bakkamanthala <rb7147@att.com>
Diffstat (limited to 'ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java')
-rw-r--r--ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java20
1 files changed, 13 insertions, 7 deletions
diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java
index 736069d00..5fc4370e1 100644
--- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java
+++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/MicroServiceConfigPolicy.java
@@ -76,8 +76,8 @@ public class MicroServiceConfigPolicy extends Policy {
private static String papDbUrl = null;
private static String papDbUser = null;
private static String papDbPassword = null;
- private static Map<String, String> mapAttribute = new HashMap<String,String>();
- private static Map<String, String> matchMap = new HashMap<String,String>();
+ private static Map<String, String> mapAttribute = new HashMap<>();
+ private static Map<String, String> matchMap = new HashMap<>();
public MicroServiceConfigPolicy() {
super();
@@ -105,7 +105,7 @@ public class MicroServiceConfigPolicy extends Policy {
@Override
public Map<String, String> savePolicies() throws Exception {
- Map<String, String> successMap = new HashMap<String,String>();
+ Map<String, String> successMap = new HashMap<>();
if(isPolicyExists()){
successMap.put("EXISTS", "This Policy already exist on the PAP");
return successMap;
@@ -188,7 +188,7 @@ public class MicroServiceConfigPolicy extends Policy {
matching = getValueFromDictionary(policyAdapter.getServiceType() + "-v" + jsonVersion);
}
- matchMap = new HashMap<String,String>();
+ matchMap = new HashMap<>();
if (matching != null && !matching.isEmpty()){
matchMap = Splitter.on(",").withKeyValueSeparator("=").split(matching);
if(policyAdapter.getJsonBody() != null){
@@ -372,9 +372,15 @@ public class MicroServiceConfigPolicy extends Policy {
PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e, "MicroServiceModels", "Exception querying MicroServiceModels");
} finally {
try{
- if (con!=null) con.close();
- if (rs!=null) rs.close();
- if (st!=null) st.close();
+ if (con!=null){
+ con.close();
+ }
+ if (rs!=null){
+ rs.close();
+ }
+ if (st!=null){
+ st.close();
+ }
} catch (Exception ex){
LOGGER.error("Exception Occured While Closing the Database Connection"+ex);
}