summaryrefslogtreecommitdiffstats
path: root/POLICY-SDK-APP/src/main/java
diff options
context:
space:
mode:
authorrb7147 <rb7147@att.com>2017-07-27 14:50:16 -0400
committerrb7147 <rb7147@att.com>2017-07-27 15:29:03 -0400
commit4ca818fdfb9b807562166800a086b413593d6894 (patch)
tree6ad8e39d1e501e03eb68aaa2d2a57f8145c24b10 /POLICY-SDK-APP/src/main/java
parentd80880b097d08f9ab9dda54355216890a4b345dc (diff)
[POLICY-122] Policy GUI Fixes
Added few Policy GUI fixes for Export dictionary feature Added fix for Dashboard policy activitiy table. Change-Id: Ic4e3ef75f9cd26ab53d095c1dff8e29132304ed5 Signed-off-by: rb7147 <rb7147@att.com>
Diffstat (limited to 'POLICY-SDK-APP/src/main/java')
-rw-r--r--POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/DashboardController.java53
1 files changed, 24 insertions, 29 deletions
diff --git a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/DashboardController.java b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/DashboardController.java
index 089470671..230bbe611 100644
--- a/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/DashboardController.java
+++ b/POLICY-SDK-APP/src/main/java/org/openecomp/policy/controller/DashboardController.java
@@ -226,7 +226,7 @@ public class DashboardController extends RestrictedBaseController{
for (PDPGroup group : this.pdpConatiner.getGroups()){
for (PDP pdp : group.getPdps()){
naCount = -1;
- if (pdp.getStatus().getStatus().toString() == "UP_TO_DATE" && ((EcompPDP) pdp).getJmxPort() != 0){
+ if ("UP_TO_DATE".equals(pdp.getStatus().getStatus().toString()) && ((EcompPDP) pdp).getJmxPort() != 0){
String pdpIpAddress = parseIPSystem(pdp.getId());
int port = ((EcompPDP) pdp).getJmxPort();
if (port != 0){
@@ -321,7 +321,6 @@ public class DashboardController extends RestrictedBaseController{
*/
private void addPolicyToTable() {
policyActivityData = new ArrayList<>();
- int i = 1;
String policyID = null;
int policyFireCount = 0;
Map<String, String> policyMap = new HashMap<>();
@@ -338,46 +337,42 @@ public class DashboardController extends RestrictedBaseController{
}
for (PDP pdp : group.getPdps()){
- // Add rows to the Policy Table
+ // Add rows to the Policy Table
policyList = null;
- if (pdp.getStatus().getStatus().toString() == "UP_TO_DATE" && ((EcompPDP) pdp).getJmxPort() != 0){
+ if ("UP_TO_DATE".equals(pdp.getStatus().getStatus().toString()) && ((EcompPDP) pdp).getJmxPort() != 0){
String pdpIpAddress = parseIPSystem(pdp.getId());
policyList = getPolicy(pdpIpAddress, ((EcompPDP) pdp).getJmxPort(), "policyCount");
}
if (policyList != null && policyList.toString().length() > 3){
- String[] splitPolicy = policyList.toString().split(",");
- for (String policyKeyValue : splitPolicy){
- policyID = urnPolicyID(policyKeyValue);
- policyFireCount = countPolicyID(policyKeyValue);
- if (policyID != null ){
- if (policyMap.containsKey(policyID)){
- JSONObject object = new JSONObject();
- object.put("policyId", policyMap.get(policyID));
- object.put("fireCount", policyFireCount);
- object.put("system", pdp.getId());
- policyActivityData.add(i, object);
- i++;
- }
+ String[] splitPolicy = policyList.toString().split(",");
+ for (String policyKeyValue : splitPolicy){
+ policyID = urnPolicyID(policyKeyValue);
+ policyFireCount = countPolicyID(policyKeyValue);
+ if (policyID != null ){
+ if (policyMap.containsKey(policyID)){
+ JSONObject object = new JSONObject();
+ object.put("policyId", policyMap.get(policyID));
+ object.put("fireCount", policyFireCount);
+ object.put("system", pdp.getId());
+ policyActivityData.add(object);
}
}
+ }
}else {
if (policyList != null){
JSONObject object = new JSONObject();
object.put("policyId", "Unable to retrieve policy information");
object.put("fireCount", "NA");
object.put("system", pdp.getId());
- policyActivityData.add(i, object);
- i++;
+ policyActivityData.add(object);
}else{
JSONObject object = new JSONObject();
object.put("policyId", "Unable to access PDP JMX Server");
object.put("fireCount", "NA");
object.put("system", pdp.getId());
- policyActivityData.add(i, object);
- i++;
+ policyActivityData.add(object);
}
}
-
}
}
}
@@ -399,20 +394,20 @@ public class DashboardController extends RestrictedBaseController{
policyLogger.debug("policyMap value retreived: " + o);
return o;
} catch (MalformedURLException e) {
- policyLogger.error("MalformedURLException for JMX connection");
+ policyLogger.error("MalformedURLException for JMX connection" , e);
} catch (IOException e) {
- policyLogger.error("AttributeNotFoundException for policyMap" );
+ policyLogger.error("AttributeNotFoundException for policyMap" , e);
} catch (AttributeNotFoundException e) {
- policyLogger.error("AttributeNotFoundException for JMX connection");
+ policyLogger.error("AttributeNotFoundException for JMX connection", e);
} catch (InstanceNotFoundException e) {
- policyLogger.error("InstanceNotFoundException " + host + " for JMX connection");
+ policyLogger.error("InstanceNotFoundException " + host + " for JMX connection", e);
} catch (MalformedObjectNameException e) {
- policyLogger.error("MalformedObjectNameException for JMX connection");
+ policyLogger.error("MalformedObjectNameException for JMX connection", e);
} catch (MBeanException e) {
- policyLogger.error("MBeanException for JMX connection");
+ policyLogger.error("MBeanException for JMX connection", e);
policyLogger.error("Exception Occured"+e);
} catch (ReflectionException e) {
- policyLogger.error("ReflectionException for JMX connection");
+ policyLogger.error("ReflectionException for JMX connection", e);
}
return null;