main/src/main/java/org/onap/policy/pap/main/comm/PdpModifyRequestMap.java
/**
     * Removes a PDP from all active groups.
     *
     * @param pdpName name of the PDP to be removed
     * @return {@code true} if the PDP was removed from a group, {@code false} if it was
     *         not assigned to a group
     * @throws PfModelException if an error occurred
     */
Removes a PDP from all active groups.
@param pdpName name of the PDP to be removed
@return  true if the PDP was removed from a group,  false if it was
not assigned to a group
@throws PfModelException if an error occurred
Removes a PDP from all active groups . @param pdpName name of the PDP to be removed @return true if the PDP was removed from a group false if it was not assigned to a group @throws PfModelException if an error occurred
public boolean removeFromGroups(String pdpName) throws PfModelException {
        try (PolicyModelsProvider dao = daoFactory.create()) {
            PdpGroupFilter filter = PdpGroupFilter.builder().groupState(PdpState.ACTIVE).build();
            List<PdpGroup> groups = dao.getFilteredPdpGroups(filter);
            List<PdpGroup> updates = new ArrayList<>(1);
            for (PdpGroup group : groups) {
                if (removeFromGroup(pdpName, group)) {
                    updates.add(group);
                }
            }
            if (updates.isEmpty()) {
                return false;
            } else {
                dao.updatePdpGroups(updates);
                return true;
            }
        }
    }
public boolean removeFromGroups ( String pdpName ) throws PfModelException { try ( PolicyModelsProvider dao = daoFactory . create ( ) ) { PdpGroupFilter filter = PdpGroupFilter . builder ( ) . groupState ( PdpState . ACTIVE ) . build ( ) ; List < PdpGroup > groups = dao . getFilteredPdpGroups ( filter ) ; List < PdpGroup > updates = new ArrayList < > ( 1 ) ; for ( PdpGroup group : groups ) { if ( removeFromGroup ( pdpName , group ) ) { updates . add ( group ) ; } } if ( updates . isEmpty ( ) ) { return false ; } else { dao . updatePdpGroups ( updates ) ; return true ; } } }
Removes a PDP from all active groups.
Removes a PDP from all active groups .