net.shibboleth.metadata.dom.saml
Class ValidateValidUntilStage

java.lang.Object
  extended by net.shibboleth.metadata.pipeline.AbstractComponent
      extended by net.shibboleth.metadata.pipeline.BaseStage<ItemType>
          extended by net.shibboleth.metadata.pipeline.BaseIteratingStage<DomElementItem>
              extended by net.shibboleth.metadata.dom.saml.ValidateValidUntilStage
All Implemented Interfaces:
Component, Stage<DomElementItem>

public class ValidateValidUntilStage
extends BaseIteratingStage<DomElementItem>

Checks that a SAML EntitiesDescriptor or EntityDescriptor's validUntil is (optionally) present and is within a given range. Items which are not a SAML EntitiesDescriptor or EntityDescriptor are ignored.


Field Summary
private  long maxValidityInterval
          Interval, in milliseconds, from now within which the validUntil date must fall.
private  boolean requireValidUntil
          Whether the item is required to have a validUntil attribute.
 
Constructor Summary
ValidateValidUntilStage()
           
 
Method Summary
protected  boolean doExecute(DomElementItem item)
          Processes a given Item.
protected  void doInitialize()
          Do the initialization of the component.
 long getMaxValidityInterval()
          Gets the interval, in milliseconds, from now within which the validUntil date must fall.
 boolean isRequireValidUntil()
          Gets whether the item is required to have a validUntil attribute.
 void setMaxValidityInterval(long interval)
          Sets the interval, in milliseconds, from now within which the validUntil date must fall.
 void setRequireValidUntil(boolean isRequired)
          Sets whether the item is required to have a validUntil attribute.
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseIteratingStage
doExecute
 
Methods inherited from class net.shibboleth.metadata.pipeline.BaseStage
execute
 
Methods inherited from class net.shibboleth.metadata.pipeline.AbstractComponent
equals, getId, getInitializationInstant, hashCode, initialize, isInitialized, setId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.shibboleth.metadata.pipeline.Component
getId, getInitializationInstant, initialize, isInitialized
 

Field Detail

requireValidUntil

private boolean requireValidUntil
Whether the item is required to have a validUntil attribute. Default value: true


maxValidityInterval

private long maxValidityInterval
Interval, in milliseconds, from now within which the validUntil date must fall. A value of 0 indicates that no maximum interval is checked. Default value: 1 week

Constructor Detail

ValidateValidUntilStage

public ValidateValidUntilStage()
Method Detail

isRequireValidUntil

public boolean isRequireValidUntil()
Gets whether the item is required to have a validUntil attribute.

Returns:
whether the item is required to have a validUntil attribute

setRequireValidUntil

public void setRequireValidUntil(boolean isRequired)
Sets whether the item is required to have a validUntil attribute.

Parameters:
isRequired - whether the item is required to have a validUntil attribute

getMaxValidityInterval

public long getMaxValidityInterval()
Gets the interval, in milliseconds, from now within which the validUntil date must fall.

Returns:
Interval, in milliseconds, from now within which the validUntil date must fall

setMaxValidityInterval

public void setMaxValidityInterval(long interval)
Sets the interval, in milliseconds, from now within which the validUntil date must fall. A value of 0 indicates that there is no check on the upper bound of the validity period.

Parameters:
interval - interval, in milliseconds, from now within which the validUntil date must fall; must be greater than or equal to 0

doExecute

protected boolean doExecute(DomElementItem item)
                     throws StageProcessingException
Processes a given Item.

Specified by:
doExecute in class BaseIteratingStage<DomElementItem>
Parameters:
item - Item on which to operate
Returns:
true if the Item should be retained in the collection, false if not
Throws:
StageProcessingException - thrown if there is a problem with the stage processing

doInitialize

protected void doInitialize()
                     throws ComponentInitializationException
Do the initialization of the component. Default implementation of this method is a no-op. Extending classes should override this method to perform any initialization logic necessary.

Overrides:
doInitialize in class AbstractComponent
Throws:
ComponentInitializationException - throw if there is a problem initializing the component


Copyright © 2009-2011. All Rights Reserved.