Java 类io.dropwizard.validation.ValidationMethod 实例源码

项目:soabase    文件:SoaConfiguration.java   
@ValidationMethod(message="deploymentGroups cannot be null and names can only contain letters, numbers, underscores, dashes or periods")
@JsonIgnore
public boolean isValidDeploymentGroups() {
    if ( deploymentGroups == null )
    {
        return false;
    }
    java.util.regex.Pattern pattern = java.util.regex.Pattern.compile("^[a-zA-Z0-9_\\-.]+$");
    for ( String group : deploymentGroups )
    {
        if ( !pattern.matcher(group).matches() )
        {
            return false;
        }
    }
    return true;
}
项目:verify-hub    文件:AssertionConsumerService.java   
@SuppressWarnings("unused")
@ValidationMethod(message = "Index must be an unsigned integer.")
public boolean isIndexAbsentOrUnsigned() {
    if (getIndex().isPresent()) {
        return getIndex().get() >= 0;
    }
    return true;
}
项目:verify-hub    文件:TransactionConfigEntityData.java   
@ValidationMethod(message = "Assertion Consumer Service indices must be unique.")
@SuppressWarnings("unused") // used by the deserializer
private boolean isAssertionConsumerServiceIndicesUnique() {
    Set<Integer> indices = new HashSet<>();
    for (AssertionConsumerService assertionConsumerService : assertionConsumerServices) {
        final Optional<Integer> index = assertionConsumerService.getIndex();
        if (index.isPresent() && !indices.add(index.get())) {
            return false;
        }
    }
    return true;
}
项目:verify-hub    文件:TransactionConfigEntityData.java   
@ValidationMethod(message = "Exactly one Assertion Consumer Service must be marked as default.")
@SuppressWarnings("unused") // used by the deserializer
private boolean isOnlyOneDefaultAssertionConsumerServiceIndex() {
    boolean hasDefault = false;
    for (AssertionConsumerService assertionConsumerService : assertionConsumerServices) {
        if (assertionConsumerService.getDefault()) {
            if (hasDefault) {
                return false;
            }
            hasDefault = true;
        }
    }
    return hasDefault;
}
项目:verify-hub    文件:Certificate.java   
@ValidationMethod(message = "Certificate was not a valid x509 cert.")
public boolean isX509Valid() {
    try {
        getCertificate();
    } catch (CertificateException e) {
        return false;
    }
    return true;
}
项目:emodb    文件:DataStoreConfiguration.java   
@ValidationMethod(message = ".systemTablePlacement references a keyspace not defined in 'cassandraKeyspaces'")
public boolean isValidSystemTablePlacement() {
    String systemKeyspace = _systemTablePlacement.substring(0, _systemTablePlacement.indexOf(':'));
    for (CassandraConfiguration cassandraConfig : _cassandraClusters.values()) {
        if (cassandraConfig.getKeyspaces().containsKey(systemKeyspace)) {
            return true;
        }
    }
    return false;
}
项目:watchtower-automation    文件:RundeckProviderConfiguration.java   
@ValidationMethod(message="Invalid authentication")
public boolean isAuthenticationValid() {
  if (token != null && !token.isEmpty())
    return true;

  if (username != null && !username.isEmpty()
      && password != null && password.isEmpty())
    return true;

  return false;
}
项目:dropwizard-metrics-influxdb    文件:InfluxDbReporterFactory.java   
@ValidationMethod(message = "measurementMappings must be regular expressions")
public boolean isMeasurementMappingRegularExpressions() {
    for (Map.Entry<String, String> entry : buildMeasurementMappings().entrySet()) {
        try {
            Pattern.compile(entry.getValue());
        } catch (PatternSyntaxException e) {
            return false;
        }
    }
    return true;
}
项目:biblio-server    文件:Session.java   
/**
 * Validates the _session's token to proper UUID form.
 * @return A boolean value. If true the _session token is correctly formed, otherwise false.
 */
@JsonIgnore
@ValidationMethod(message="may not be correctly formatted token")
public boolean isValidToken() {
    boolean isValid = true;
    try {
        UUID.fromString(_session);
    } catch (Exception e) {
        isValid = false;
    }
    return isValid;
}
项目:dropwizard-mongodb    文件:MongoClientFactory.java   
@JsonIgnore
@ValidationMethod(message = ".options.readPreference must be one of \"primary\", \"primaryPreferred\", \"secondary\", \"secondaryPreferred\", or \"nearest\"")
public boolean isReadPreferenceValid() {
    if (options.get(READ_PREFERENCE_KEY) == null) {
        return true;
    }
    try {
        ReadPreference.valueOf(options.get(READ_PREFERENCE_KEY));
    } catch (IllegalArgumentException | ClassCastException e) {
        return false;
    }
    return true;
}
项目:skid-road    文件:SkidRoadReadOnlyConfiguration.java   
@ValidationMethod
public boolean isCerficateCheckingDisabled() {
    if (disableCertificateChecks) {
        System.setProperty("com.amazonaws.sdk.disableCertChecking","true");
    }
    return true;
}
项目:skid-road    文件:RequestLogUploadConfiguration.java   
@ValidationMethod
public boolean isCerficateCheckingDisabled() {
    if (disableCertificateChecks) {
        System.setProperty("com.amazonaws.sdk.disableCertChecking","true");
    }
    return true;
}
项目:verify-hub    文件:AssertionConsumerService.java   
@SuppressWarnings("unused")
@ValidationMethod(message = "Assertion Consumer Service url must be an absolute url.")
public boolean isUriValid() {
    return uri.isAbsolute();
}
项目:verify-hub    文件:MatchingServiceConfigEntityData.java   
@ValidationMethod(message = "Matching Service url must be an absolute url.")
@SuppressWarnings("unused") // used by the deserializer
private boolean isUriValid() {
    return uri.isAbsolute();
}
项目:CredentialStorageService-dw-hibernate    文件:RemoteCredentialDataSourceFactory.java   
@JsonIgnore
@ValidationMethod(
    message = ".refreshFrequency must be less greater than zero when credential retrieval is enabled")
public boolean isRefreshFrequencySetWhenFeatureIsEnabled() {
    return this.retrieveCredentials ? this.refreshFrequency > 1 : true;
}
项目:dropwizard-grpc    文件:GrpcServerFactory.java   
@ValidationMethod(message = "cert chain file {value} does not exist")
public boolean isValidCertChainFile() {
    return certChainFile == null || Files.exists(certChainFile);
}
项目:dropwizard-grpc    文件:GrpcServerFactory.java   
@ValidationMethod(message = "private key file {value} does not exist")
public boolean isValidPrivateKeyFile() {
    return privateKeyFile == null || Files.exists(privateKeyFile);
}
项目:dropwizard-hikaricp    文件:DataSourceFactory.java   
@JsonIgnore
@ValidationMethod(message = ".minSize must be less than or equal to maxSize")
public boolean isMinSizeLessThanMaxSize() {
    return this.minSize <= this.maxSize;
}
项目:dropwizard-cassandra    文件:NettySSLOptionsFactory.java   
@ValidationMethod(message = "must define keyManager when clientAuth is REQUIRE")
public boolean isClientAuthConfigValid() {
    return clientAuth != ClientAuth.REQUIRE || keyManager != null;
}
项目:dropwizard-mongodb    文件:MongoClientFactory.java   
@JsonIgnore
@ValidationMethod(message = ".options.writeConcern must be one of the static WriteConcerns on com.mongodb.WriteConcern by name.  Case doesn't matter.")
public boolean isWriteConcernValid() {
    return options.get(WRITE_CONCERN_KEY) == null || WriteConcern.valueOf(options.get(WRITE_CONCERN_KEY)) != null;
}
项目:dropwizard-mongodb    文件:MongoClientFactory.java   
@JsonIgnore
@ValidationMethod(message = ".options.dbDecoderFactory must be one of \"lazy\", \"lazy-writeable\", or \"default\"")
public boolean isDBDecoderFactoryValid() {
    return options.get(DB_DECODER_FACTORY_KEY) == null || DB_DECODER_FACTORY_VALUES.contains(options.get(DB_DECODER_FACTORY_KEY));
}
项目:dropwizard-elasticsearch    文件:EsConfiguration.java   
@ValidationMethod
@JsonIgnore
public boolean isValidConfig() {
    return nodeClient || !servers.isEmpty();
}
项目:dropwizard-jaxws    文件:ValidatingInvokerTest.java   
@ValidationMethod(message="foo may not be 'John'")
public boolean isNotJohn() {
    return !("John".equals(foo));
}
项目:skid-road    文件:SkidRoadReadOnlyConfiguration.java   
@ValidationMethod(message = "both or neither AWS access parameter must be set.")
public boolean isBothOrNeitherAwsAccessParameterSet() {
    return (StringUtils.isNotBlank(accessKeyID) && StringUtils.isNotBlank(secretAccessKey)) ||
            (StringUtils.isBlank(accessKeyID) && StringUtils.isBlank(secretAccessKey));
}
项目:skid-road    文件:RequestLogUploadConfiguration.java   
@ValidationMethod(message = "both or neither AWS access parameter must be set.")
public boolean isBothOrNeitherAwsAccessParameterSet() {
    return (StringUtils.isNotBlank(accessKeyID) && StringUtils.isNotBlank(secretAccessKey)) ||
            (StringUtils.isBlank(accessKeyID) && StringUtils.isBlank(secretAccessKey));
}