/** * Provides the file name extension associated with a schema language. * * Results include the ".". * * @param schemaLanguage schema language * @return the file name extension associated with the schema language */ private String schemaFileExtension(@Nonnull final SchemaLanguage schemaLanguage) { switch (schemaLanguage) { case XML: return ".xsd"; case RELAX: return ".rng"; default: throw new ConstraintViolationException("unknown schema language"); } }
/** {@inheritDoc} */ @Override @Nonnull protected Subject populateSubject(@Nonnull final Subject subject) { if (result instanceof String) { subject.getPrincipals().add(new UsernamePrincipal((String) result)); return subject; } else if (result instanceof Principal) { subject.getPrincipals().add((Principal) result); return subject; } else if (result instanceof Subject) { // Override supplied Subject with our own, after transferring over any custom Principals. ((Subject) result).getPrincipals().addAll(subject.getPrincipals()); return (Subject) result; } // Save my walrus! throw new ConstraintViolationException("Result type was unexpected"); }
/** Constructor. */ public SAML1StringNameIdentifierEncoder() { identifierBuilder = (SAMLObjectBuilder<NameIdentifier>) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder( NameIdentifier.DEFAULT_ELEMENT_NAME); if (identifierBuilder == null) { throw new ConstraintViolationException("Builder unavailable for NameIdentifier objects"); } format = NameIdentifier.UNSPECIFIED; }
/** * Creates a new DataSource validator. * * @param source to validate * @deprecated - use the property setters */ @Deprecated public DataSourceValidator(final DataSource source) { DeprecationSupport.warn(ObjectType.METHOD, "DataSourceValidator(DataSource)", null, "DataSourceValidator()"); dataSource = source; try { initialize(); } catch (final ComponentInitializationException e) { throw new ConstraintViolationException("Invalid parameterization."); } }
/** * Creates a new DataSource validator. * * @param source to validate * @param throwOnError whether {@link #validate()} should throw or log errors * @deprecated - use the property setters */ @Deprecated public DataSourceValidator(final DataSource source, final boolean throwOnError) { DeprecationSupport.warn(ObjectType.METHOD, "DataSourceValidator(DataSource, boolean)", null, "DataSourceValidator()"); dataSource = source; throwOnValidateError = throwOnError; try { initialize(); } catch (final ComponentInitializationException e) { throw new ConstraintViolationException("Invalid parameterization."); } }
/** * Constructor. * * @param filter used for the LDAP search * @deprecated - use the property setters */ @Deprecated public ParameterizedExecutableSearchFilterBuilder(@Nonnull final String filter) { DeprecationSupport.warn(ObjectType.METHOD, "ParameterizedExecutableSearchFilterBuilder(String)", null, "ParameterizedExecutableSearchFilterBuilder()"); setSearchFilter(filter); try { initialize(); } catch (final ComponentInitializationException e) { throw new ConstraintViolationException("Invalid parameterization."); } }
/** Constructor. */ public SAML2StringNameIDEncoder() { identifierBuilder = (SAMLObjectBuilder<NameID>) XMLObjectProviderRegistrySupport.getBuilderFactory().getBuilder( NameID.DEFAULT_ELEMENT_NAME); if (identifierBuilder == null) { throw new ConstraintViolationException("Builder unavailable for NameID objects"); } setNameFormat(NameID.UNSPECIFIED); }
if (isFailFast(applicationContext)) { log.error("Unable to load properties from resource '{}'", additionalResource); throw new ConstraintViolationException("Unable to load properties from resource"); } else { log.warn("Unable to load properties from resource '{}'", additionalResource);
/** * Creates a new connection factory validator. * * @param factory to validate * @deprecated - use the property setters */ @Deprecated public ConnectionFactoryValidator(@Nonnull final ConnectionFactory factory) { DeprecationSupport.warn(ObjectType.METHOD, "ConnectionFactoryValidator(ConnectionFactory)", null, "ConnectionFactoryValidator()"); setConnectionFactory(factory); setThrowValidateError(true); try { initialize(); } catch (final ComponentInitializationException e) { throw new ConstraintViolationException("Invalid parameterization to deprecated structure"); } }
/** * Creates a new connection factory validator. * * @param factory to validate * @param throwOnError whether {@link #validate()} should throw or log errors * @deprecated - use the property setters */ @Deprecated public ConnectionFactoryValidator(@Nonnull final ConnectionFactory factory, final boolean throwOnError) { DeprecationSupport.warn(ObjectType.METHOD, "ConnectionFactoryValidator(ConnectionFactory, boolean)", null, "ConnectionFactoryValidator()"); setConnectionFactory(factory); setThrowValidateError(throwOnError); try { initialize(); } catch (final ComponentInitializationException e) { throw new ConstraintViolationException("Invalid parameterization to deprecated structure"); } }
if (isFailFast(applicationContext)) { log.error("Unable to load properties from resource '{}'", resource); throw new ConstraintViolationException("Unable to load properties from resource"); } else { log.warn("Unable to load properties from resource '{}'", resource); throw new ConstraintViolationException( "Unable to find '" + getSearchTarget() + "' at well known locations"); } else {