org.opensaml.saml2.metadata.provider
Class FilesystemMetadataProvider

java.lang.Object
  extended by org.opensaml.saml2.metadata.provider.BaseMetadataProvider
      extended by org.opensaml.saml2.metadata.provider.AbstractMetadataProvider
          extended by org.opensaml.saml2.metadata.provider.AbstractObservableMetadataProvider
              extended by org.opensaml.saml2.metadata.provider.FilesystemMetadataProvider
All Implemented Interfaces:
MetadataProvider, ObservableMetadataProvider

public class FilesystemMetadataProvider
extends AbstractObservableMetadataProvider

A metadata provider that pulls metadata from a file on the local filesystem. Metadata is cached and automatically refreshed when the file changes.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.opensaml.saml2.metadata.provider.ObservableMetadataProvider
ObservableMetadataProvider.Observer
 
Field Summary
 
Fields inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider
unmarshallerFactory
 
Constructor Summary
FilesystemMetadataProvider(java.io.File metadata)
          Constructor.
 
Method Summary
 XMLObject getMetadata()
          Gets the entire metadata tree, after the registered filter has been applied.
 void initialize()
          Initializes the provider and prepares it for use.
 boolean maintainExpiredMetadata()
          Gets whether cached metadata should be discarded if it expires and can not be refreshed.
 void setMaintainExpiredMetadata(boolean maintain)
          Sets whether cached metadata should be discarded if it expires and can not be refreshed.
 void setMetadataFilter(MetadataFilter newFilter)
          Sets the metadata filter applied to the metadata.
 
Methods inherited from class org.opensaml.saml2.metadata.provider.AbstractObservableMetadataProvider
emitChangeEvent, getObservers
 
Methods inherited from class org.opensaml.saml2.metadata.provider.AbstractMetadataProvider
clearDescriptorIndex, filterMetadata, getEntitiesDescriptor, getEntitiesDescriptorByName, getEntityDescriptor, getEntityDescriptorById, getEntityDescriptorById, getParserPool, getRole, getRole, isValid, releaseMetadataDOM, setParserPool, unmarshallMetadata
 
Methods inherited from class org.opensaml.saml2.metadata.provider.BaseMetadataProvider
getMetadataFilter, requireValidMetadata, setRequireValidMetadata
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensaml.saml2.metadata.provider.MetadataProvider
getEntitiesDescriptor, getEntityDescriptor, getMetadataFilter, getRole, getRole, requireValidMetadata, setRequireValidMetadata
 

Constructor Detail

FilesystemMetadataProvider

public FilesystemMetadataProvider(java.io.File metadata)
                           throws MetadataProviderException
Constructor.

Parameters:
metadata - the metadata file
Throws:
MetadataProviderException - thrown if the given file path is null, does not exist, does not represent a file, or if the metadata can not be parsed
Method Detail

initialize

public void initialize()
                throws MetadataProviderException
Initializes the provider and prepares it for use.

Throws:
MetadataProviderException - thrown if there is a problem reading, parsing, or validating the metadata

maintainExpiredMetadata

public boolean maintainExpiredMetadata()
Gets whether cached metadata should be discarded if it expires and can not be refreshed.

Returns:
whether cached metadata should be discarded if it expires and can not be refreshed

setMaintainExpiredMetadata

public void setMaintainExpiredMetadata(boolean maintain)
Sets whether cached metadata should be discarded if it expires and can not be refreshed.

Parameters:
maintain - whether cached metadata should be discarded if it expires and can not be refreshed

setMetadataFilter

public void setMetadataFilter(MetadataFilter newFilter)
                       throws MetadataProviderException
Sets the metadata filter applied to the metadata.

Specified by:
setMetadataFilter in interface MetadataProvider
Overrides:
setMetadataFilter in class BaseMetadataProvider
Parameters:
newFilter - the metadata filter applied to the metadata
Throws:
MetadataProviderException - thrown if the provider can not apply the filter to the metadata

getMetadata

public XMLObject getMetadata()
                      throws MetadataProviderException
Gets the entire metadata tree, after the registered filter has been applied.

Returns:
the entire metadata tree
Throws:
MetadataProviderException - thrown if the provider can not fetch the metadata