import lombok.Getter;
import org.onap.policy.models.pdp.concepts.PdpMessage;
import org.onap.policy.pap.main.comm.msgdata.Request;
+import org.onap.policy.pap.main.notification.PolicyNotifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@Getter
private final String pdpName;
+ /**
+ * Notifier for policy update completions.
+ */
+ @Getter
+ private final PolicyNotifier notifier;
+
/**
* Index of request currently being published.
*/
*
* @param pdpName name of the PDP with which the requests are associated
*/
- public PdpRequests(String pdpName) {
+ public PdpRequests(String pdpName, PolicyNotifier notifier) {
this.pdpName = pdpName;
+ this.notifier = notifier;
}
/**
*/
public void addSingleton(Request request) {
+ request.setNotifier(notifier);
+
if (request.getMessage().getName() == null) {
throw new IllegalArgumentException("unexpected broadcast for " + pdpName);
}
singletons[priority] = request;
// stop publishing anything of a lower priority
- QueueToken<PdpMessage> token = stopPublishingLowerPriority(priority);
+ final QueueToken<PdpMessage> token = stopPublishingLowerPriority(priority);
// start publishing if nothing of higher priority
if (higherPrioritySingleton(priority)) {