public ValidationResponse validateRemoteConnectionSettings( ApplicationValidationContext ctx, CRemoteConnectionSettings settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } return response; }
public ValidationResponse validateRestApiSettings( ApplicationValidationContext ctx, CRestApiSettings settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } return response; }
public ValidationResponse validateRemoteNexusInstance( ApplicationValidationContext ctx, CRemoteNexusInstance settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } return response; }
public ValidationResponse validateSchedule( ApplicationValidationContext ctx, CScheduleConfig settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } return response; }
public ValidationResponse validateRemoteAuthentication( ApplicationValidationContext ctx, CRemoteAuthentication settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } return response; }
public ValidationResponse validateRouting( ApplicationValidationContext ctx, CRouting settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } return response; }
public void validateTime(String key, Date date) throws InvalidConfigurationException { if (date.before(new Date())) { ValidationResponse vr = new ApplicationValidationResponse(); ValidationMessage vm = new ValidationMessage(key, "Time cannot be in the past."); vr.addValidationError(vm); throw new InvalidConfigurationException(vr); } }
public void validateTime( String key, Date date ) throws InvalidConfigurationException { if ( date.before( new Date() ) ) { ValidationResponse vr = new ApplicationValidationResponse(); ValidationMessage vm = new ValidationMessage( key, "Time cannot be in the past." ); vr.addValidationError( vm ); throw new InvalidConfigurationException( vr ); } }
public void validateStartDate(String date) throws InvalidConfigurationException { Calendar cal = Calendar.getInstance(); Date startDate = new Date(Long.parseLong(date)); cal.setTime(startDate); Calendar nowCal = Calendar.getInstance(); nowCal.add(Calendar.DAY_OF_YEAR, -1); nowCal.set(Calendar.HOUR, 0); nowCal.set(Calendar.MINUTE, 0); nowCal.set(Calendar.SECOND, 0); nowCal.set(Calendar.MILLISECOND, 0); // This is checking just the year/month/day, time isn't of concern right now // basic check that the day timestamp is roughly in the correct range if (cal.before(nowCal)) { if (getLogger().isDebugEnabled()) { getLogger().debug("Validation error for startDate: " + startDate.toString()); } ValidationResponse vr = new ApplicationValidationResponse(); ValidationMessage vm = new ValidationMessage("startDate", "Date cannot be in the past."); vr.addValidationError(vm); throw new InvalidConfigurationException(vr); } }
public void validateStartDate( String date ) throws InvalidConfigurationException { Calendar cal = Calendar.getInstance(); Date startDate = new Date( Long.parseLong( date ) ); cal.setTime( startDate ); Calendar nowCal = Calendar.getInstance(); nowCal.add( Calendar.DAY_OF_YEAR, -1 ); nowCal.set( Calendar.HOUR, 0 ); nowCal.set( Calendar.MINUTE, 0 ); nowCal.set( Calendar.SECOND, 0 ); nowCal.set( Calendar.MILLISECOND, 0 ); // This is checking just the year/month/day, time isn't of concern right now // basic check that the day timestamp is roughly in the correct range if ( cal.before( nowCal ) ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Validation error for startDate: " + startDate.toString() ); } ValidationResponse vr = new ApplicationValidationResponse(); ValidationMessage vm = new ValidationMessage( "startDate", "Date cannot be in the past." ); vr.addValidationError( vm ); throw new InvalidConfigurationException( vr ); } }
public ValidationResponse validateScheduledTask( ApplicationValidationContext ctx, CScheduledTask settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } ApplicationValidationContext context = (ApplicationValidationContext) response.getContext(); response.append( validateSchedule( context, settings.getSchedule() ) ); return response; }
public ValidationResponse validateErrorReporting( ApplicationValidationContext ctx, CErrorReporting settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } if ( settings.isEnabled() ) { if ( StringUtils.isEmpty( settings.getJiraUrl() ) ) { ValidationMessage msg = new ValidationMessage( "jiraUrl", "JIRA URL is empty." ); response.addValidationError( msg ); } if ( StringUtils.isEmpty( settings.getJiraProject() ) ) { ValidationMessage msg = new ValidationMessage( "jiraProject", "JIRA Project is empty." ); response.addValidationError( msg ); } } return response; }
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; }
@Override public ValidationResponse doValidateChanges( Object changedConfiguration ) { CRepositoryGrouping settings = (CRepositoryGrouping) changedConfiguration; ValidationResponse response = new ApplicationValidationResponse(); ApplicationValidationContext context = (ApplicationValidationContext) response.getContext(); context.addExistingPathMappingIds(); if ( settings.getPathMappings() != null ) { for ( CPathMappingItem item : (List<CPathMappingItem>) settings.getPathMappings() ) { response.append( validateGroupsSettingPathMappingItem( context, item ) ); } } 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; }
public ValidationResponse validateSmtpConfiguration( ApplicationValidationContext ctx, CSmtpConfiguration settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } if ( StringUtils.isEmpty( settings.getHostname() ) ) { ValidationMessage msg = new ValidationMessage( "host", "SMTP Host is empty." ); response.addValidationError( msg ); } if ( settings.getPort() < 0 ) { ValidationMessage msg = new ValidationMessage( "port", "SMTP Port is inavlid. Enter a port greater than 0." ); response.addValidationError( msg ); } if ( StringUtils.isEmpty( settings.getSystemEmailAddress() ) ) { ValidationMessage msg = new ValidationMessage( "systemEmailAddress", "System Email Address is empty." ); response.addValidationError( msg ); } return response; }
public ValidationResponse validateRemoteHttpProxySettings( ApplicationValidationContext ctx, CRemoteHttpProxySettings settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } if ( settings.getProxyPort() < 1 || settings.getProxyPort() > 65535 ) { response.addValidationError( "The proxy port must be an integer between 1 and 65535!" ); } response.append( validateRemoteAuthentication( ctx, settings.getAuthentication() ) ); return response; }
public ValidationResponse validateRepositoryGrouping( ApplicationValidationContext ctx, CRepositoryGrouping settings ) { ValidationResponse response = new ApplicationValidationResponse(); if ( ctx != null ) { response.setContext( ctx ); } ApplicationValidationContext context = (ApplicationValidationContext) response.getContext(); context.addExistingPathMappingIds(); if ( settings.getPathMappings() != null ) { for ( CPathMappingItem item : settings.getPathMappings() ) { response.append( validateGroupsSettingPathMappingItem( context, item ) ); } } return response; }
public ValidationResponse validateRepositoryTarget( ApplicationValidationContext ctx, CRepositoryTarget settings ) ValidationResponse response = new ApplicationValidationResponse();
"The source nexus repository is of an invalid Format." ); ValidationResponse response = new ApplicationValidationResponse(); new ValidationMessage( "shadowOf", e.getMessage(), "The source nexus repository is not existing." ); ValidationResponse response = new ApplicationValidationResponse();