main/src/main/java/org/onap/policy/pap/main/rest/depundep/PdpGroupDeployProvider.java
/**
     * Adds a new group.
     *
     * @param data session data
     * @param group the group to be added
     * @return the validation result
     * @throws PfModelException if an error occurred
     */
Adds a new group.
@param data session data
@param group the group to be added
@return the validation result
@throws PfModelException if an error occurred
Adds a new group . @param data session data @param group the group to be added @return the validation result @throws PfModelException if an error occurred
private ValidationResult addGroup(SessionData data, PdpGroup group) throws PfModelException {
        BeanValidationResult result = new BeanValidationResult(group.getName(), group);
        validateGroupOnly(group, result);
        if (!result.isValid()) {
            return result;
        }
        if (group.getPdpGroupState() == null) {
            group.setPdpGroupState(PdpState.ACTIVE);
        }
        for (PdpSubGroup subgrp : group.getPdpSubgroups()) {
            result.addResult(addSubGroup(data, subgrp));
        }
        if (result.isValid()) {
            data.create(group);
        }
        return result;
    }
private ValidationResult addGroup ( SessionData data , PdpGroup group ) throws PfModelException { BeanValidationResult result = new BeanValidationResult ( group . getName ( ) , group ) ; validateGroupOnly ( group , result ) ; if ( ! result . isValid ( ) ) { return result ; } if ( group . getPdpGroupState ( ) == null ) { group . setPdpGroupState ( PdpState . ACTIVE ) ; } for ( PdpSubGroup subgrp : group . getPdpSubgroups ( ) ) { result . addResult ( addSubGroup ( data , subgrp ) ) ; } if ( result . isValid ( ) ) { data . create ( group ) ; } return result ; }
Adds a new group.
Adds a new group .
// default to active