NdsBeisEsb/src/main/java/com/northgateps/nds/beis/esb/process/ValidateBeisRegistration.java
/**
     * Validates a submitted registration.
     * 
     * @param request
     * @return request - after validation
     * @throws NdsBusinessException 
     * @throws NdsApplicationException 
     */
Validates a submitted registration.

@param request
@return request - after validation
@throws NdsBusinessException
@throws NdsApplicationException
Validates a submitted registration . @param request @return request - after validation @throws NdsBusinessException @throws NdsApplicationException
public BeisRegistrationNdsRequest validate(final BeisRegistrationNdsRequest request)
            throws NdsBusinessException, NdsApplicationException {
        logger.info("Validating registration");
        List<ValidationViolation> violations = new ArrayList<ValidationViolation>();
        if (request.getRegistrationDetails() == null) {
            throw new NdsApplicationException("Registration details expected but found null");
        } 
        request.getRegistrationDetails().validate("beisRegistrationDetails", violations,
                new ValidationContext<BeisRegistrationEsbModel>(new BeisRegistrationEsbModel() {
                    @Override
                    public BeisRegistrationDetails getBeisRegistrationDetails() {
                        return request.getRegistrationDetails();
                    }
                }, ValidationDomain.COMPLETE, scriptsLoader, getModelAnnotationsProvider(), null));
        if (violations.size() > 0) {
            throw new NdsBusinessException(BeisRegistrationNdsResponse.class, violations);
        }
       return request;
    }
public BeisRegistrationNdsRequest validate ( final BeisRegistrationNdsRequest request ) throws NdsBusinessException , NdsApplicationException { logger . info ( "Validating registration" ) ; List < ValidationViolation > violations = new ArrayList < ValidationViolation > ( ) ; if ( request . getRegistrationDetails ( ) == null ) { throw new NdsApplicationException ( "Registration details expected but found null" ) ; } request . getRegistrationDetails ( ) . validate ( "beisRegistrationDetails" , violations , new ValidationContext < BeisRegistrationEsbModel > ( new BeisRegistrationEsbModel ( ) { @ Override public BeisRegistrationDetails getBeisRegistrationDetails ( ) { return request . getRegistrationDetails ( ) ; } } , ValidationDomain . COMPLETE , scriptsLoader , getModelAnnotationsProvider ( ) , null ) ) ; if ( violations . size ( ) > 0 ) { throw new NdsBusinessException ( BeisRegistrationNdsResponse . class , violations ) ; } return request ; }
Validates a submitted registration.
Validates a submitted registration .