Code Review
/
policy
/
xacml-pdp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix xacml pdp registration issue
[policy/xacml-pdp.git]
/
main
/
src
/
main
/
java
/
org
/
onap
/
policy
/
pdpx
/
main
/
comm
/
XacmlPdpHearbeatPublisher.java
diff --git
a/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisher.java
b/main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisher.java
index
0dc8bf5
..
8ffccbe
100644
(file)
--- a/
main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisher.java
+++ b/
main/src/main/java/org/onap/policy/pdpx/main/comm/XacmlPdpHearbeatPublisher.java
@@
-23,8
+23,6
@@
package org.onap.policy.pdpx.main.comm;
import java.util.Timer;
import java.util.TimerTask;
import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
import java.util.Timer;
import java.util.TimerTask;
import org.onap.policy.common.endpoints.event.comm.client.TopicSinkClient;
-import org.onap.policy.models.pdp.concepts.PdpStateChange;
-import org.onap.policy.models.pdp.enums.PdpState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@
-34,11
+32,8
@@
public class XacmlPdpHearbeatPublisher extends TimerTask {
private Timer timer;
private XacmlPdpMessage heartbeatMessage;
private Timer timer;
private XacmlPdpMessage heartbeatMessage;
- private Object message;
private static TopicSinkClient topicSinkClient;
private static volatile boolean alive = false;
private static TopicSinkClient topicSinkClient;
private static volatile boolean alive = false;
- public static PdpState pdpState;
-
/**
* Constructor for instantiating XacmlPdpPublisher.
/**
* Constructor for instantiating XacmlPdpPublisher.
@@
-46,11
+41,9
@@
public class XacmlPdpHearbeatPublisher extends TimerTask {
* @param message of the PDP
* @param topicSinkClient used to send heartbeat message
*/
* @param message of the PDP
* @param topicSinkClient used to send heartbeat message
*/
- public XacmlPdpHearbeatPublisher(TopicSinkClient topicSinkClient, PdpStateChange message) {
- this.message = message;
- this.pdpState = message.getState();
+ public XacmlPdpHearbeatPublisher(TopicSinkClient topicSinkClient, XacmlPdpMessage message ) {
this.topicSinkClient = topicSinkClient;
this.topicSinkClient = topicSinkClient;
- this.heartbeatMessage =
new XacmlPdpMessage()
;
+ this.heartbeatMessage =
message
;
timer = new Timer(false);
timer.scheduleAtFixedRate(this, 0, 60000); // time interval temp hard coded now but will be parameterized
setAlive(true);
timer = new Timer(false);
timer.scheduleAtFixedRate(this, 0, 60000); // time interval temp hard coded now but will be parameterized
setAlive(true);
@@
-58,7
+51,7
@@
public class XacmlPdpHearbeatPublisher extends TimerTask {
@Override
public void run() {
@Override
public void run() {
- topicSinkClient.send(heartbeatMessage.format
HeartbeatMessage((PdpStateChange) message
));
+ topicSinkClient.send(heartbeatMessage.format
PdpStatusMessage(
));
LOGGER.info("Sending Xacml PDP heartbeat to the PAP");
}
LOGGER.info("Sending Xacml PDP heartbeat to the PAP");
}
@@
-71,11
+64,6
@@
public class XacmlPdpHearbeatPublisher extends TimerTask {
setAlive(false);
}
setAlive(false);
}
- public void updateInternalState(PdpState state) {
- ((PdpStateChange) this.message).setState(state);
- this.pdpState = state;
- }
-
public static boolean isAlive() {
return alive;
}
public static boolean isAlive() {
return alive;
}