Merge "Adding JUNITs for ONAP-PAP-REST"
[policy/engine.git] / ONAP-XACML / src / main / java / org / onap / policy / xacml / std / pap / StdPDP.java
index 20dbfae..8727b81 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-XACML
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -45,14 +45,16 @@ public class StdPDP extends StdPDPItemSetChangeNotifier implements OnapPDP, Comp
        
        private Integer jmxport = 0;
        
-       private PDPStatus status = new StdPDPStatus();
+       private transient PDPStatus status = new StdPDPStatus();
        
-       private Set<PDPPolicy> policies = new HashSet<>();
+       private transient Set<PDPPolicy> policies = new HashSet<>();
        
-       private Set<PDPPIPConfig> pipConfigs = new HashSet<>();
+       private transient Set<PDPPIPConfig> pipConfigs = new HashSet<>();
        
        public StdPDP() {
-               
+               //
+               // Default constructor
+               //
        }
        
        public StdPDP(String id, Integer  jmxport) {
@@ -89,7 +91,6 @@ public class StdPDP extends StdPDPItemSetChangeNotifier implements OnapPDP, Comp
                                } else if (key.toString().endsWith(".description")) {
                                        this.description = properties.getProperty(key.toString());
                                }else if (key.toString().endsWith(".jmxport")) {
-                                       //todo fix this hackjob
                                        if (properties.getProperty(key.toString()) != null && properties.getProperty(key.toString()).trim().length() > 0){
                                                logger.debug("initialize before: " + this.jmxport);
                                                this.jmxport = Integer.valueOf( properties.getProperty(key.toString()));
@@ -159,6 +160,8 @@ public class StdPDP extends StdPDPItemSetChangeNotifier implements OnapPDP, Comp
        public void setPipConfigs(Set<PDPPIPConfig> pipConfigs) {
                this.pipConfigs = pipConfigs;
        }
+       
+       @Override
        public void setJmxPort(Integer jmxport) {
                this.jmxport = jmxport;
        }
@@ -207,16 +210,13 @@ public class StdPDP extends StdPDPItemSetChangeNotifier implements OnapPDP, Comp
                if (o == null) {
                        return -1;
                }
-               if ( ! (o instanceof StdPDP)) {
-                       return -1;
-               }
-               if (((StdPDP)o).name == null) {
+               if (o.name == null) {
                        return -1;
                }
                if (name == null) {
                        return 1;
                }
-               return name.compareTo(((StdPDP)o).name);
+               return name.compareTo(o.name);
        }
        
 }