import org.onap.policy.pap.main.comm.msgdata.RequestListener;
import org.onap.policy.pap.main.comm.msgdata.StateChangeReq;
import org.onap.policy.pap.main.comm.msgdata.UpdateReq;
+import org.onap.policy.pap.main.notification.PolicyNotifier;
import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams;
import org.onap.policy.pap.main.parameters.RequestParams;
import org.slf4j.Logger;
*/
private final PolicyModelsProviderFactoryWrapper daoFactory;
+ /**
+ * Used to notify when policy updates completes.
+ */
+ private final PolicyNotifier policyNotifier;
+
/**
* Constructs the object.
this.params = params;
this.modifyLock = params.getModifyLock();
this.daoFactory = params.getDaoFactory();
+ this.policyNotifier = params.getPolicyNotifier();
}
/**
.setMaxRetryCount(params.getParams().getUpdateParameters().getMaxRetryCount())
.setTimers(params.getUpdateTimers())
.setModifyLock(params.getModifyLock())
- .setPublisher(params.getPublisher())
+ .setPdpPublisher(params.getPdpPublisher())
.setResponseDispatcher(params.getResponseDispatcher());
// @formatter:on
.setMaxRetryCount(params.getParams().getStateChangeParameters().getMaxRetryCount())
.setTimers(params.getStateChangeTimers())
.setModifyLock(params.getModifyLock())
- .setPublisher(params.getPublisher())
+ .setPdpPublisher(params.getPdpPublisher())
.setResponseDispatcher(params.getResponseDispatcher());
// @formatter:on
* @return a new set of requests
*/
protected PdpRequests makePdpRequests(String pdpName) {
- return new PdpRequests(pdpName);
+ return new PdpRequests(pdpName, policyNotifier);
}
/**
*/
private void disablePdp(PdpRequests requests) {
+ policyNotifier.removePdp(requests.getPdpName());
+
// remove the requests from the map
if (!pdp2requests.remove(requests.getPdpName(), requests)) {
// don't have the info we need to disable it