NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/process/ValidateSaveRegisteredAccountDetails.java
/**
     * Validates submitted save registered user details.
     * 
     * @param request
     * @return request - after validation
     * @throws NdsApplicationException
     * @throws NdsBusinessException
     */
Validates submitted save registered user details.

@param request
@return request - after validation
@throws NdsApplicationException
@throws NdsBusinessException
Validates submitted save registered user details . @param request @return request - after validation @throws NdsApplicationException @throws NdsBusinessException
public SaveRegisteredAccountDetailsNdsRequest validate(final SaveRegisteredAccountDetailsNdsRequest request)
            throws NdsApplicationException, NdsBusinessException {
        List<ValidationViolation> violations = new ArrayList<ValidationViolation>();
        logger.info("Validating save registered user details");
        if (request.getTenant() == null) {
            throw new NdsApplicationException("Expected tenant but it was null");
        }
        if (request.getRegisteredAccountDetails() == null) {
            throw new NdsApplicationException("Expected account details but it was null");
        }
        if (request.getRegisteredAccountDetails().getUpdateUserDetails() == null) {
            throw new NdsApplicationException("Expected update user details but it was null");
        }
        if (request.getRegisteredAccountDetails().getUpdateUserDetails().getUsername() == null) {
            throw new NdsApplicationException("Expected username but it was null");
        }
        request.getRegisteredAccountDetails().validate("registeredAccountDetails", violations,
                new ValidationContext<SaveRegisteredAccountDetailsEsbModel>(new SaveRegisteredAccountDetailsEsbModel() {
                    @Override
                    public UpdateBeisRegistrationDetails getRegisteredAccountDetails() {
                        return request.getRegisteredAccountDetails();
                    }
                }, ValidationDomain.COMPLETE, scriptsLoader, getModelAnnotationsProvider(), null));
        if (violations.size() > 0) {
            throw new NdsBusinessException(SaveRegisteredAccountDetailsNdsResponse.class, violations);
        }
       return request;
    }
public SaveRegisteredAccountDetailsNdsRequest validate ( final SaveRegisteredAccountDetailsNdsRequest request ) throws NdsApplicationException , NdsBusinessException { List < ValidationViolation > violations = new ArrayList < ValidationViolation > ( ) ; logger . info ( "Validating save registered user details" ) ; if ( request . getTenant ( ) == null ) { throw new NdsApplicationException ( "Expected tenant but it was null" ) ; } if ( request . getRegisteredAccountDetails ( ) == null ) { throw new NdsApplicationException ( "Expected account details but it was null" ) ; } if ( request . getRegisteredAccountDetails ( ) . getUpdateUserDetails ( ) == null ) { throw new NdsApplicationException ( "Expected update user details but it was null" ) ; } if ( request . getRegisteredAccountDetails ( ) . getUpdateUserDetails ( ) . getUsername ( ) == null ) { throw new NdsApplicationException ( "Expected username but it was null" ) ; } request . getRegisteredAccountDetails ( ) . validate ( "registeredAccountDetails" , violations , new ValidationContext < SaveRegisteredAccountDetailsEsbModel > ( new SaveRegisteredAccountDetailsEsbModel ( ) { @ Override public UpdateBeisRegistrationDetails getRegisteredAccountDetails ( ) { return request . getRegisteredAccountDetails ( ) ; } } , ValidationDomain . COMPLETE , scriptsLoader , getModelAnnotationsProvider ( ) , null ) ) ; if ( violations . size ( ) > 0 ) { throw new NdsBusinessException ( SaveRegisteredAccountDetailsNdsResponse . class , violations ) ; } return request ; }
Validates submitted save registered user details.
Validates submitted save registered user details .