public void addValidationError( String message ) { ValidationMessage e = new ValidationMessage( String.valueOf( key++ ), message ); addValidationError( e ); }
public void addValidationError(String message, Throwable t) { ValidationMessage e = new ValidationMessage(String.valueOf(key++), message, t); addValidationError(e); }
protected ValidationResponse mergeValidationResponse(ValidationResponse source, ValidationResponse dest) { for (ValidationMessage message : source.getValidationErrors()) { dest.addValidationError(message); } for (ValidationMessage message : source.getValidationWarnings()) { dest.addValidationError(message); } return dest; } }
public void addValidationError( String message, Throwable t ) { ValidationMessage e = new ValidationMessage( String.valueOf( key++ ), message, t ); addValidationError( e ); }
protected ValidationResponse mergeValidationResponse(ValidationResponse source, ValidationResponse dest) { for ( ValidationMessage message : source.getValidationErrors() ) { dest.addValidationError( message ); } for ( ValidationMessage message : source.getValidationWarnings() ) { dest.addValidationError( message ); } return dest; } }
public void addValidationError(String message) { ValidationMessage e = new ValidationMessage(String.valueOf(key++), message); addValidationError(e); }
public ValidationResponse validateUserRoleMapping(ValidationContext ctx, CUserRoleMapping userRoleMapping) { ValidationResponse response = new ValidationResponse(); if (StringUtils.isEmpty(userRoleMapping.getUserId())) { ValidationMessage msg = new ValidationMessage("userId", "UserId cannot be empty."); response.addValidationError(msg); } if (userRoleMapping == null || userRoleMapping.getRoles().size() == 0) { ValidationMessage msg = new ValidationMessage("roles", "Roles cannot be empty."); response.addValidationError(msg); } return response; }
public ValidationResponse validateUserRoleMapping( ValidationContext ctx, CUserRoleMapping userRoleMapping ) { ValidationResponse response = new ValidationResponse(); if ( StringUtils.isEmpty( userRoleMapping.getUserId() ) ) { ValidationMessage msg = new ValidationMessage( "userId", "UserId cannot be empty." ); response.addValidationError( msg ); } if ( userRoleMapping == null || userRoleMapping.getRoles().size() == 0 ) { ValidationMessage msg = new ValidationMessage( "roles", "Roles cannot be empty." ); response.addValidationError( msg ); } return response; }
response.addValidationError(msg); response.addValidationError(msg); response.addValidationError(msg); response.addValidationError(msg); response.addValidationError(msg); "systemUsername", "Username cannot be empty unless the 'Authorization Scheme' is 'Anonymous Authentication'."); response.addValidationError(msg); "systemPassword", "Password cannot be empty unless the 'Authorization Scheme' is 'Anonymous Authentication'."); response.addValidationError(msg);
response.addValidationError( msg ); response.addValidationError( msg ); "userRealNameAttribute", "User Real Name Attribute cannot be empty." ); response.addValidationError( msg ); "emailAddressAttribute", "Email Address Attribute cannot be empty." ); response.addValidationError( msg ); "groupIdAttribute", "Group ID Attribute cannot be empty when Use LDAP Groups as Roles is true." ); response.addValidationError( msg ); "groupMemberAttribute", "Group Member Attribute cannot be empty when Use LDAP Groups as Roles is true." ); response.addValidationError( msg ); "groupMemberFormat", "Group Member Format cannot be empty when Use LDAP Groups as Roles is true." ); response.addValidationError( msg ); "groupObjectClass", "Group Object Class cannot be empty when Use LDAP Groups as Roles is true." ); response.addValidationError( msg );
response.addValidationError(msg); response.addValidationError(msg); "userRealNameAttribute", "User Real Name Attribute cannot be empty."); response.addValidationError(msg); "emailAddressAttribute", "Email Address Attribute cannot be empty."); response.addValidationError(msg); "groupIdAttribute", "Group ID Attribute cannot be empty when Use LDAP Groups as Roles is true."); response.addValidationError(msg); "groupMemberAttribute", "Group Member Attribute cannot be empty when Use LDAP Groups as Roles is true."); response.addValidationError(msg); "groupMemberFormat", "Group Member Format cannot be empty when Use LDAP Groups as Roles is true."); response.addValidationError(msg); "groupObjectClass", "Group Object Class cannot be empty when Use LDAP Groups as Roles is true."); response.addValidationError(msg);
response.addValidationError( msg ); response.addValidationError( msg ); response.addValidationError( msg ); response.addValidationError( msg ); response.addValidationError( msg ); "systemUsername", "Username cannot be empty unless the 'Authorization Scheme' is 'Anonymous Authentication'." ); response.addValidationError( msg ); "systemPassword", "Password cannot be empty unless the 'Authorization Scheme' is 'Anonymous Authentication'." ); response.addValidationError( msg );
@Override public ValidationResponse validateModel(ValidationRequest request) { ValidationResponse response = new ValidationResponse(); Configuration configuration = (Configuration) request.getConfiguration(); if (configuration == null) { ValidationMessage msg = new ValidationMessage("*", "Configuration is missing."); response.addValidationError(msg); } else { if (configuration.getConnectionInfo() != null) { ValidationResponse vr = this.validateConnectionInfo(null, configuration.getConnectionInfo()); this.mergeValidationResponse(vr, response); } else { ValidationMessage msg = new ValidationMessage("*", "Connection Configuration is missing."); response.addValidationError(msg); } if (configuration.getUserAndGroupConfig() != null) { ValidationResponse vr = this.validateUserAndGroupAuthConfiguration(null, configuration.getUserAndGroupConfig()); this.mergeValidationResponse(vr, response); } else { ValidationMessage msg = new ValidationMessage("*", "User And Group Configuration is missing."); response.addValidationError(msg); } } return response; }
response.addValidationError( msg ); response.addValidationError( msg ); response.addValidationError( msg );
/** * A method to append a validation response to this validation response. The errors list and warnings list are * simply appended, and the isValid is logically AND-ed and isModified is logically OR-ed. */ public void append(ValidationResponse response) { for (ValidationMessage msg : response.getValidationErrors()) { if (getValidationError(msg.getKey()) != null) { msg.setKey(msg.getKey() + "(" + key++ + ")"); } addValidationError(msg); } for (ValidationMessage msg : response.getValidationWarnings()) { if (getValidationWarning(msg.getKey()) != null) { msg.setKey(msg.getKey() + "(" + key++ + ")"); } addValidationWarning(msg); } setValid(isValid() && response.isValid()); setModified(isModified() || response.isModified()); }
/** * A method to append a validation response to this validation response. The errors list and warnings list are * simply appended, and the isValid is logically AND-ed and isModified is logically OR-ed. * * @param response */ public void append( ValidationResponse response ) { for ( ValidationMessage msg : response.getValidationErrors() ) { if ( getValidationError( msg.getKey() ) != null ) { msg.setKey( msg.getKey() + "(" + key++ + ")" ); } addValidationError( msg ); } for ( ValidationMessage msg : response.getValidationWarnings() ) { if ( getValidationWarning( msg.getKey() ) != null ) { msg.setKey( msg.getKey() + "(" + key++ + ")" ); } addValidationWarning( msg ); } setValid( isValid() && response.isValid() ); setModified( isModified() || response.isModified() ); }