summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-08-25 21:29:04 +0000
committerJim Hahn <jrh3@att.com>2021-08-25 21:29:04 +0000
commitb776d1adf9186cf0665e6be2ae50a704ea63a0cc (patch)
treeffc40a715dcd892d2377fdd5606ce905ff9f0161
parentead43f520102bc6201aadb770b5f289c9dc4691c (diff)
Revert "Synchronize updates to xacml-pdp state"
This reverts commit ead43f520102bc6201aadb770b5f289c9dc4691c. Reason for revert: Causing lock-ups in honolulu builds Issue-ID: POLICY-3531 Change-Id: Ia18ac9306ba406f59b3e939a3d4aafefe14407e6 Signed-off-by: Jim Hahn <jrh3@att.com>
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java16
-rw-r--r--main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java2
2 files changed, 6 insertions, 12 deletions
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java b/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java
index b040eb71..db83b716 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/XacmlState.java
@@ -33,15 +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 {
- private static final Logger LOGGER = LoggerFactory.getLogger(XacmlState.class);
-
/**
* The application manager.
*/
@@ -73,7 +69,7 @@ public class XacmlState {
* @return {@code true} if this PDP should handle the message, {@code false} otherwise
*/
public boolean shouldHandle(PdpMessage message) {
- return message.appliesTo(status.getName(), status.getPdpGroup(), status.getPdpType());
+ return message.appliesTo(status.getName(), status.getPdpGroup(), status.getPdpSubgroup());
}
/**
@@ -81,7 +77,7 @@ public class XacmlState {
*
* @return a new heart beat message
*/
- public synchronized PdpStatus genHeartbeat() {
+ public PdpStatus genHeartbeat() {
// first, update status fields
status.setHealthy(XacmlPdpActivator.getCurrent().isAlive() ? PdpHealthStatus.HEALTHY
: PdpHealthStatus.NOT_HEALTHY);
@@ -95,8 +91,7 @@ public class XacmlState {
* @param message message from which to update the internal state
* @return a response to the message
*/
- public synchronized PdpStatus updateInternalState(PdpStateChange message) {
- LOGGER.info("set state of {} to {}", this, message.getState());
+ public PdpStatus updateInternalState(PdpStateChange message) {
status.setState(message.getState());
/*
@@ -120,7 +115,7 @@ public class XacmlState {
* @param message message from which to update the internal state
* @return a response to the message
*/
- public synchronized PdpStatus updateInternalState(PdpUpdate message, String errMessage) {
+ public PdpStatus updateInternalState(PdpUpdate message, String errMessage) {
status.setPdpSubgroup(message.getPdpSubgroup());
status.setPolicies(appManager.getToscaPolicyIdentifiers());
@@ -132,8 +127,7 @@ public class XacmlState {
*
* @return the current PdpStatus with Terminated state
*/
- public synchronized PdpStatus terminatePdpMessage() {
- LOGGER.info("set state of {} to {}", this, PdpState.TERMINATED);
+ public PdpStatus terminatePdpMessage() {
status.setState(PdpState.TERMINATED);
return new PdpStatus(status);
}
diff --git a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
index c4c24f9f..4882760e 100644
--- a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
+++ b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpUpdatePublisher.java
@@ -61,7 +61,7 @@ public class XacmlPdpUpdatePublisher {
*
* @param message Incoming message
*/
- public synchronized void handlePdpUpdate(PdpUpdate message) {
+ public void handlePdpUpdate(PdpUpdate message) {
Set<ToscaPolicy> incomingPolicies =
new HashSet<>(message.getPolicies() == null ? Collections.emptyList() : message.getPolicies());