public void addValidationWarning( String message ) { ValidationMessage e = new ValidationMessage( String.valueOf( key++ ), message ); addValidationWarning( e ); }
public ValidationResponse validateHttpProxySettings( ApplicationValidationContext ctx, CHttpProxySettings settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } if ( settings.getPort() < 80 ) { settings.setPort( 8082 ); response.addValidationWarning( "The HTTP Proxy port is below 80? Settings defaulted." ); response.setModified( true ); } if ( !CHttpProxySettings.PROXY_POLICY_PASS_THRU.equals( settings.getProxyPolicy() ) && !CHttpProxySettings.PROXY_POLICY_STRICT.equals( settings.getProxyPolicy() ) ) { response.addValidationError( "The HTTP Proxy policy settings is invalid: '" + settings.getProxyPolicy() + "'. Valid policies are '" + CHttpProxySettings.PROXY_POLICY_STRICT + "' and '" + CHttpProxySettings.PROXY_POLICY_PASS_THRU + "'." ); } return response; }
public ValidationResponse validateRepositoryMirrors( ApplicationValidationContext ctx, List<CMirror> mirrors ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } for ( CMirror mirror : mirrors ) { if ( StringUtils.isEmpty( mirror.getId() ) ) { String newId = generateId(); mirror.setId( newId ); response .addValidationWarning( "Fixed wrong mirror ID from '" + mirror.getId() + "' to '" + newId + "'" ); response.setModified( true ); } if ( StringUtils.isEmpty( mirror.getId() ) ) { response.addValidationError( "The Mirror may have no empty/null ID!" ); } if ( StringUtils.isEmpty( mirror.getUrl() ) ) { response.addValidationError( "The Mirror may have no empty/null URL!" ); } } return response; }
response.addValidationWarning( "Fixed wrong route ID from '" + item.getId() + "' to '" + newId + "'" ); .addValidationWarning( "Fixed route without groupId set, set to ALL_GROUPS to keep backward comp, ID='" + item.getId() + "'." );
response.addValidationWarning( "Fixed wrong route ID from '" + item.getId() + "' to '" + newId + "'" ); response.addValidationWarning( "Fixed route without groupId set, set to ALL_GROUPS to keep backward comp, ID='" + item.getId() + "'." );
response.addValidationWarning( new ValidationMessage( "id", "Repository with ID='" + cfg.getId() + "' has no name, defaulted it's name to it's ID." ) ); response.addValidationWarning( new ValidationMessage( "indexable", "Indexing isn't supported for \"" + cfg.getProviderHint() + "\" repositories, only Maven2 repositories are indexable!" ) );
response.addValidationWarning( new ValidationMessage( "id", "Repository with ID='" + repo.getId() + "' has no name, defaulted to it's ID." ) );
/** * 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 validationResponse */ public void append( ValidationResponse validationResponse ) { for ( ValidationMessage msg : validationResponse.getValidationErrors() ) { if ( getValidationError( msg.getKey() ) != null ) { msg.setKey( msg.getKey() + "(" + key++ + ")" ); } addValidationError( msg ); } for ( ValidationMessage msg : validationResponse.getValidationWarnings() ) { if ( getValidationWarning( msg.getKey() ) != null ) { msg.setKey( msg.getKey() + "(" + key++ + ")" ); } addValidationWarning( msg ); } setValid( isValid() && validationResponse.isValid() ); setModified( isModified() || validationResponse.isModified() ); }
.addValidationWarning( "Global connection settings block, which is mandatory, was missing. Reset with defaults." ); response.addValidationWarning( "The HTTP Proxy section was missing from configuration, defaulted it." ); response.addValidationWarning( "The routing section was missing from configuration, defaulted it." );