main/src/main/java/org/onap/policy/pap/main/comm/PdpModifyRequestMap.java
/**
         * Disables a PDP by removing it from its subgroup and then sending it a PASSIVE
         * request.
         *
         * @param requests the requests associated with the PDP to be disabled
         */
Disables a PDP by removing it from its subgroup and then sending it a PASSIVE
request.

@param requests the requests associated with the PDP to be disabled
Disables a PDP by removing it from its subgroup and then sending it a PASSIVE request . @param requests the requests associated with the PDP to be disabled
private void disablePdp(PdpRequests requests) {
            if (!pdp2requests.remove(requests.getPdpName(), requests)) {
                logger.warn("no requests with which to disable {}", requests.getPdpName());
                return;
            }
            logger.warn("disabling {}", requests.getPdpName());
            requests.stopPublishing();
            boolean removed = false;
            try {
                removed = removeFromGroups(requests.getPdpName());
            } catch (PfModelException e) {
                logger.info("unable to remove PDP {} from subgroup", requests.getPdpName(), e);
            }
            PdpStateChange change = new PdpStateChange();
            change.setName(requests.getPdpName());
            change.setState(PdpState.PASSIVE);
            if (removed) {
                PdpUpdate update = new PdpUpdate();
                update.setName(requests.getPdpName());
                update.setPolicies(Collections.emptyList());
                addRequest(update, change);
            } else {
                addRequest(change);
            }
        }
private void disablePdp ( PdpRequests requests ) { if ( ! pdp2requests . remove ( requests . getPdpName ( ) , requests ) ) { logger . warn ( "no requests with which to disable {}" , requests . getPdpName ( ) ) ; return ; } logger . warn ( "disabling {}" , requests . getPdpName ( ) ) ; requests . stopPublishing ( ) ; boolean removed = false ; try { removed = removeFromGroups ( requests . getPdpName ( ) ) ; } catch ( PfModelException e ) { logger . info ( "unable to remove PDP {} from subgroup" , requests . getPdpName ( ) , e ) ; } PdpStateChange change = new PdpStateChange ( ) ; change . setName ( requests . getPdpName ( ) ) ; change . setState ( PdpState . PASSIVE ) ; if ( removed ) { PdpUpdate update = new PdpUpdate ( ) ; update . setName ( requests . getPdpName ( ) ) ; update . setPolicies ( Collections . emptyList ( ) ) ; addRequest ( update , change ) ; } else { addRequest ( change ) ; } }
Disables a PDP by removing it from its subgroup and then sending it a PASSIVE
 request.
Disables a PDP by removing it from its subgroup and then sending it a PASSIVE request .
// remove the requests from the map // don't have the info we need to disable it // remove the PDP from all groups // send the state change // send an update, too