Leave xacml-pdp REST server always running
[policy/xacml-pdp.git] / main / src / main / java / org / onap / policy / pdpx / main / XacmlState.java
index 5ca75a6..db83b71 100644 (file)
@@ -33,16 +33,11 @@ import org.onap.policy.models.pdp.enums.PdpResponseStatus;
 import org.onap.policy.models.pdp.enums.PdpState;
 import org.onap.policy.pdpx.main.rest.XacmlPdpApplicationManager;
 import org.onap.policy.pdpx.main.startstop.XacmlPdpActivator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 /**
  * Current state of this XACML PDP.
  */
 public class XacmlState {
-    // The logger for this class
-    private static final Logger LOGGER = LoggerFactory.getLogger(XacmlState.class);
-
     /**
      * The application manager.
      */
@@ -107,9 +102,6 @@ public class XacmlState {
 
         PdpStatus status2 = makeResponse(message, "");
 
-        // start/stop rest controller based on state change
-        handleXacmlRestController();
-
         // these fields aren't needed in the response, so clear them out to avoid sending
         status2.setPolicies(null);
 
@@ -162,23 +154,4 @@ public class XacmlState {
         status2.setResponse(resp);
         return status2;
     }
-
-    /**
-     * Manages the Xacml-Pdp rest controller based on the Xacml-Pdp State.
-     * Current supported states:
-     * ACTIVE  - rest service is running and handling requests
-     * PASSIVE - rest service is not running
-     */
-    private void handleXacmlRestController() {
-        if (status.getState() == PdpState.ACTIVE) {
-            LOGGER.info("State change: {} - Starting rest controller", status.getState());
-            XacmlPdpActivator.getCurrent().startXacmlRestController();
-        } else if (status.getState() == PdpState.PASSIVE) {
-            LOGGER.info("State change: {} - Stopping rest controller", status.getState());
-            XacmlPdpActivator.getCurrent().stopXacmlRestController();
-        } else {
-            // unsupported state
-            LOGGER.warn("Unsupported state: {}", status.getState());
-        }
-    }
 }