Package net.shibboleth.metadata.dom
Class XMLSchemaValidationStage
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.metadata.pipeline.AbstractStage<T>
net.shibboleth.metadata.pipeline.AbstractIteratingStage<Element>
net.shibboleth.metadata.dom.XMLSchemaValidationStage
- All Implemented Interfaces:
Stage<Element>,net.shibboleth.shared.component.Component,net.shibboleth.shared.component.DestructableComponent,net.shibboleth.shared.component.IdentifiableComponent,net.shibboleth.shared.component.IdentifiedComponent,net.shibboleth.shared.component.InitializableComponent
A pipeline stage that XML schema validates the elements within the
DOMElementItem collection.
This stage requires the following properties be set prior to initialization:
schemaResources
isElementRequiredToBeSchemaValid() and an Element is found to
be invalid than an ErrorStatus object is set on the element. If the Element is not required to be valid and
an Element is found to be invalid than an WarningStatus is set on the Element.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanWhether Elements are required to be schema valid.private static final org.slf4j.LoggerClass logger.Collection of schema resources.private SchemaSchema used to validate Elements. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidProcesses a givenItem.protected voidGets an unmodifiable list of schema resources against which Elements are validated.private SchemaReturns the shared validation schema built during initialization.final booleanGets whether Elements are required to be schema valid.voidsetElementRequiredToBeSchemaValid(boolean isRequired) Sets whether Elements are required to be schema valid.voidsetSchemaResources(List<Resource> resources) Sets the schema resources against which Elements are validated.Methods inherited from class net.shibboleth.metadata.pipeline.AbstractIteratingStage
doExecuteMethods inherited from class net.shibboleth.metadata.pipeline.AbstractStage
execute, getCollectionPredicate, setCollectionPredicateMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initialize, isInitialized
-
Field Details
-
LOG
@Nonnull private static final org.slf4j.Logger LOGClass logger. -
schemaResources
Collection of schema resources. -
elementRequiredToBeSchemaValid
private boolean elementRequiredToBeSchemaValidWhether Elements are required to be schema valid. Default value:true -
validationSchema
Schema used to validate Elements. Built during initialization.
-
-
Constructor Details
-
XMLSchemaValidationStage
public XMLSchemaValidationStage()
-
-
Method Details
-
getSchemaResources
Gets an unmodifiable list of schema resources against which Elements are validated.- Returns:
- unmodifiable list of schema resources against which Elements are validated
-
setSchemaResources
Sets the schema resources against which Elements are validated.- Parameters:
resources- schema resources against which Elements are validated
-
isElementRequiredToBeSchemaValid
public final boolean isElementRequiredToBeSchemaValid()Gets whether Elements are required to be schema valid.- Returns:
- whether Elements are required to be schema valid
-
setElementRequiredToBeSchemaValid
public void setElementRequiredToBeSchemaValid(boolean isRequired) Sets whether Elements are required to be schema valid.- Parameters:
isRequired- whether Elements are required to be schema valid
-
getValidationSchema
Returns the shared validation schema built during initialization.- Returns:
- the shared validation schema
-
doExecute
Description copied from class:AbstractIteratingStageProcesses a givenItem.- Specified by:
doExecutein classAbstractIteratingStage<Element>- Parameters:
item-Itemon which to operate- Throws:
StageProcessingException- thrown if there is a problem with the stage processing
-
doInitialize
protected void doInitialize() throws net.shibboleth.shared.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.shared.component.AbstractIdentifiedInitializableComponent- Throws:
net.shibboleth.shared.component.ComponentInitializationException
-