main/src/main/java/org/onap/policy/pap/main/rest/depundep/PdpGroupDeployProvider.java
/**
     * Creates or updates PDP groups. This is the method that does the actual work.
     *
     * @param data session data
     * @param groups PDP group configurations
     * @throws PfModelException if an error occurred
     */
Creates or updates PDP groups. This is the method that does the actual work.
@param data session data
@param groups PDP group configurations
@throws PfModelException if an error occurred
Creates or updates PDP groups . This is the method that does the actual work . @param data session data @param groups PDP group configurations @throws PfModelException if an error occurred
private void createOrUpdate(SessionData data, PdpGroups groups) throws PfModelException {
        BeanValidationResult result = new BeanValidationResult("groups", groups);
        for (PdpGroup group : groups.getGroups()) {
            PdpGroup dbgroup = data.getGroup(group.getName());
            if (dbgroup == null) {
                result.addResult(addGroup(data, group));
            } else {
                result.addResult(updateGroup(data, dbgroup, group));
            }
        }
        if (!result.isValid()) {
            throw new PfModelException(Status.BAD_REQUEST, result.getResult().trim());
        }
    }
private void createOrUpdate ( SessionData data , PdpGroups groups ) throws PfModelException { BeanValidationResult result = new BeanValidationResult ( "groups" , groups ) ; for ( PdpGroup group : groups . getGroups ( ) ) { PdpGroup dbgroup = data . getGroup ( group . getName ( ) ) ; if ( dbgroup == null ) { result . addResult ( addGroup ( data , group ) ) ; } else { result . addResult ( updateGroup ( data , dbgroup , group ) ) ; } } if ( ! result . isValid ( ) ) { throw new PfModelException ( Status . BAD_REQUEST , result . getResult ( ) . trim ( ) ) ; } }
Creates or updates PDP groups.
Creates or updates PDP groups .