@ThreadSafe public class SAMLSchemaBuilder extends Object
Schemas for validating SAML 1.0, 1.1, and 2.0.
Additional schemas may be included in the resulting object by supplying their locations
to an injected SchemaBuilder object.
| Modifier and Type | Class and Description |
|---|---|
static class |
SAMLSchemaBuilder.SAML1Version
Identifies which SAML 1.x version is in use.
|
| Modifier and Type | Field and Description |
|---|---|
private static String[] |
baseExtSchemas
Classpath relative location of SAML extension schemas.
|
private static String[] |
baseXMLSchemas
Classpath relative location of basic XML schemas.
|
private Schema |
cachedSchema
Cached copy of the schema produced by the builder.
|
private org.slf4j.Logger |
log
Logger.
|
private static String[] |
saml10Schemas
Classpath relative location of SAML 1_0 schemas.
|
private static String[] |
saml11Schemas
Classpath relative location of SAML 1_1 schemas.
|
private String[] |
saml1xSchemas
Reference to SAML 1.x schemas to apply.
|
private static String[] |
saml20Schemas
Classpath relative location of SAML 2_0 schemas.
|
private SchemaBuilder |
schemaBuilder
The builder to use.
|
private static String[] |
soapSchemas
Classpath relative location of SOAP 1_1 schemas.
|
private boolean |
unresolvedSchemaFatal
Flag indicating whether the failure to resolve a schema resource should be considered fatal.
|
| Constructor and Description |
|---|
SAMLSchemaBuilder(SAMLSchemaBuilder.SAML1Version ver)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
addSchemaToBuilder(String source)
Load the schema from the specified source and add it to the internal
SchemaBuilder. |
private void |
configureBuilder()
Configure the appropriate
SchemaBuilder with the right set of schemas. |
Schema |
getSAMLSchema()
Get a schema that can validate SAML 1.x, 2.0, and all registered extensions.
|
void |
setSchemaBuilder(SchemaBuilder builder)
Set a custom
SchemaBuilder to use. |
void |
setUnresolvedSchemaFatal(boolean flag)
Set the flag indicating whether the failure to resolve a schema resource should be considered fatal.
|
@Nonnull @NonnullElements @NotEmpty private static String[] baseXMLSchemas
@Nonnull @NonnullElements @NotEmpty private static String[] soapSchemas
@Nonnull @NonnullElements @NotEmpty private static String[] saml10Schemas
@Nonnull @NonnullElements @NotEmpty private static String[] saml11Schemas
@Nonnull @NonnullElements @NotEmpty private static String[] saml20Schemas
@Nonnull @NonnullElements @NotEmpty private static String[] baseExtSchemas
private org.slf4j.Logger log
private boolean unresolvedSchemaFatal
@Nullable private Schema cachedSchema
@Nonnull @NonnullElements @NotEmpty private String[] saml1xSchemas
@Nonnull private SchemaBuilder schemaBuilder
public SAMLSchemaBuilder(@Nonnull @ParameterName(name="ver") SAMLSchemaBuilder.SAML1Version ver)
A default SchemaBuilder is constructed, and injected with a
ClasspathResolver for resolving supplementary schemas.
ver - the SAML 1.x version to usepublic void setUnresolvedSchemaFatal(boolean flag)
Default value: true.
flag - true if should be fatal, false if notpublic void setSchemaBuilder(@Nonnull SchemaBuilder builder)
SchemaBuilder to use.builder - SchemaBuilder to use@Nonnull public Schema getSAMLSchema() throws SAXException
SAXException - thrown if a schema object cannot be created@Nonnull private void configureBuilder()
SchemaBuilder with the right set of schemas.private void addSchemaToBuilder(@Nonnull String source)
SchemaBuilder.source - the schema resource pathCopyright © 1999–2017 Shibboleth Consortium. All rights reserved.