org.opensaml.xml
Class Configuration

java.lang.Object
  extended by org.opensaml.xml.Configuration

public class Configuration
extends Object

Class for loading library configuration files and retrieving the configured components.


Field Summary
private static XMLObjectBuilderFactory builderFactory
          Configured XMLObject builder factory.
private static Map<QName,Element> configuredObjectProviders
          Object provider configuration elements indexed by QName.
private static QName defaultProvider
          Default object provider.
private static SecurityConfiguration globalSecurityConfig
          Configured global security configuration information.
private static Set<QName> idAttributeNames
          Configured set of attribute QNames which have been globally registered as having an ID type.
private static MarshallerFactory marshallerFactory
          Configured XMLObject marshaller factory.
private static ParserPool parserPool
          Configured parser pool.
private static UnmarshallerFactory unmarshallerFactory
          Configured XMLObject unmarshaller factory.
private static Map<String,Element> validatorSuiteConfigurations
          Validator suite configuration elements indexed by suite IDs.
private static Map<String,ValidatorSuite> validatorSuites
          Configured ValidatorSuites.
 
Constructor Summary
protected Configuration()
          Constructor.
 
Method Summary
static void deregisterIDAttribute(QName attributeName)
          Deregister an attribute as having a type of ID.
static void deregisterObjectProvider(QName key)
          Removes the builder, marshaller, and unmarshaller registered to the given key.
static void deregisterValidatorSuite(String suiteId)
          Removes a registered validator suite.
static XMLObjectBuilderFactory getBuilderFactory()
          Gets the XMLObject builder factory that has been configured with information from loaded configuration files.
static QName getDefaultProviderQName()
          Gets the QName for the object provider that will be used for XMLObjects that do not have a registered object provider.
static SecurityConfiguration getGlobalSecurityConfiguration()
          Get the global security configuration.
private static Logger getLogger()
          Get an SLF4J Logger.
static MarshallerFactory getMarshallerFactory()
          Gets the XMLObject marshaller factory that has been configured with information from loaded configuration files.
static Element getObjectProviderConfiguration(QName qualifedName)
          Deprecated. this method is deprecated with no replacement
static ParserPool getParserPool()
          Get the currently configured ParserPool instance.
static UnmarshallerFactory getUnmarshallerFactory()
          Gets the XMLObject unmarshaller factory that has been configured with information from loaded configuration files.
static ValidatorSuite getValidatorSuite(String suiteId)
          Gets a configured ValidatorSuite by its ID.
static Element getValidatorSuiteConfiguration(String suiteId)
          Deprecated. this method is deprecated with no replacement
static boolean isIDAttribute(QName attributeName)
          Determine whether a given attribute is registered as having an ID type.
static void registerIDAttribute(QName attributeName)
          Register an attribute as having a type of ID.
static void registerObjectProvider(QName providerName, XMLObjectBuilder builder, Marshaller marshaller, Unmarshaller unmarshaller)
          Adds an object provider to this configuration.
static void registerObjectProvider(QName providerName, XMLObjectBuilder builder, Marshaller marshaller, Unmarshaller unmarshaller, Element configuration)
          Deprecated. this method is deprecated with no replacement
static void registerValidatorSuite(String suiteId, ValidatorSuite suite)
          Registers a configured validator suite.
static void registerValidatorSuite(String suiteId, ValidatorSuite suite, Element configuration)
          Deprecated. this method is deprecated with no replacement
static void setGlobalSecurityConfiguration(SecurityConfiguration config)
          Set the global security configuration.
static void setParserPool(ParserPool newParserPool)
          Set the currently configured ParserPool instance.
static boolean validateJCEProviders()
          Validates that the set of security providers configured in the JVM supports required cryptographic capabilities, for example for the XML Encryption and XML Signature specifications.
static void validateNonSunJAXP()
          Validates that the system is not using the horribly buggy Sun JAXP implementation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultProvider

private static QName defaultProvider
Default object provider.


configuredObjectProviders

private static Map<QName,Element> configuredObjectProviders
Object provider configuration elements indexed by QName.


validatorSuiteConfigurations

private static Map<String,Element> validatorSuiteConfigurations
Validator suite configuration elements indexed by suite IDs.


builderFactory

private static XMLObjectBuilderFactory builderFactory
Configured XMLObject builder factory.


marshallerFactory

private static MarshallerFactory marshallerFactory
Configured XMLObject marshaller factory.


unmarshallerFactory

private static UnmarshallerFactory unmarshallerFactory
Configured XMLObject unmarshaller factory.


validatorSuites

private static Map<String,ValidatorSuite> validatorSuites
Configured ValidatorSuites.


idAttributeNames

private static Set<QName> idAttributeNames
Configured set of attribute QNames which have been globally registered as having an ID type.


globalSecurityConfig

private static SecurityConfiguration globalSecurityConfig
Configured global security configuration information.


parserPool

private static ParserPool parserPool
Configured parser pool.

Constructor Detail

Configuration

protected Configuration()
Constructor.

Method Detail

getParserPool

public static ParserPool getParserPool()
Get the currently configured ParserPool instance.

Returns:
the currently ParserPool

setParserPool

public static void setParserPool(ParserPool newParserPool)
Set the currently configured ParserPool instance.

Parameters:
newParserPool - the new ParserPool instance to configure

getDefaultProviderQName

public static QName getDefaultProviderQName()
Gets the QName for the object provider that will be used for XMLObjects that do not have a registered object provider.

Returns:
the QName for the default object provider

registerObjectProvider

public static void registerObjectProvider(QName providerName,
                                          XMLObjectBuilder builder,
                                          Marshaller marshaller,
                                          Unmarshaller unmarshaller)
Adds an object provider to this configuration.

Parameters:
providerName - the name of the object provider, corresponding to the element name or type name that the builder, marshaller, and unmarshaller operate on
builder - the builder for that given provider
marshaller - the marshaller for the provider
unmarshaller - the unmarshaller for the provider

deregisterObjectProvider

public static void deregisterObjectProvider(QName key)
Removes the builder, marshaller, and unmarshaller registered to the given key.

Parameters:
key - the key of the builder, marshaller, and unmarshaller to be removed

getBuilderFactory

public static XMLObjectBuilderFactory getBuilderFactory()
Gets the XMLObject builder factory that has been configured with information from loaded configuration files.

Returns:
the XMLObject builder factory

getMarshallerFactory

public static MarshallerFactory getMarshallerFactory()
Gets the XMLObject marshaller factory that has been configured with information from loaded configuration files.

Returns:
the XMLObject marshaller factory

getUnmarshallerFactory

public static UnmarshallerFactory getUnmarshallerFactory()
Gets the XMLObject unmarshaller factory that has been configured with information from loaded configuration files.

Returns:
the XMLObject unmarshaller factory

registerValidatorSuite

public static void registerValidatorSuite(String suiteId,
                                          ValidatorSuite suite)
Registers a configured validator suite.

Parameters:
suiteId - the ID of the suite
suite - the configured suite

deregisterValidatorSuite

public static void deregisterValidatorSuite(String suiteId)
Removes a registered validator suite.

Parameters:
suiteId - the ID of the suite

getValidatorSuite

public static ValidatorSuite getValidatorSuite(String suiteId)
Gets a configured ValidatorSuite by its ID.

Parameters:
suiteId - the suite's ID
Returns:
the ValidatorSuite or null if no suite was registered under that ID

registerIDAttribute

public static void registerIDAttribute(QName attributeName)
Register an attribute as having a type of ID.

Parameters:
attributeName - the QName of the ID attribute to be registered

deregisterIDAttribute

public static void deregisterIDAttribute(QName attributeName)
Deregister an attribute as having a type of ID.

Parameters:
attributeName - the QName of the ID attribute to be de-registered

isIDAttribute

public static boolean isIDAttribute(QName attributeName)
Determine whether a given attribute is registered as having an ID type.

Parameters:
attributeName - the QName of the attribute to be checked for ID type.
Returns:
true if attribute is registered as having an ID type.

getGlobalSecurityConfiguration

public static SecurityConfiguration getGlobalSecurityConfiguration()
Get the global security configuration.

Returns:
the global security configuration instance

setGlobalSecurityConfiguration

public static void setGlobalSecurityConfiguration(SecurityConfiguration config)
Set the global security configuration.

Parameters:
config - the new global security configuration instance

validateNonSunJAXP

public static void validateNonSunJAXP()
Validates that the system is not using the horribly buggy Sun JAXP implementation.


validateJCEProviders

public static boolean validateJCEProviders()
Validates that the set of security providers configured in the JVM supports required cryptographic capabilities, for example for the XML Encryption and XML Signature specifications. Depending on the requirements of the calling code, failure to fully support encryption and signature requirements may or may not be significant, so return a status flag to let the caller make that determination.

Returns:
false if one or more capablities are not present, otherwise true

registerObjectProvider

public static void registerObjectProvider(QName providerName,
                                          XMLObjectBuilder builder,
                                          Marshaller marshaller,
                                          Unmarshaller unmarshaller,
                                          Element configuration)
Deprecated. this method is deprecated with no replacement

Adds an object provider to this configuration.

Parameters:
providerName - the name of the object provider, corresponding to the element name or type name that the builder, marshaller, and unmarshaller operate on
builder - the builder for that given provider
marshaller - the marshaller for the provider
unmarshaller - the unmarshaller for the provider
configuration - optional XML configuration snippet

getObjectProviderConfiguration

public static Element getObjectProviderConfiguration(QName qualifedName)
Deprecated. this method is deprecated with no replacement

Gets a clone of the configuration element for a qualified element. Note that this configuration reflects the state of things as they were when the configuration was loaded, applications may have programmatically removed builder, marshallers, and unmarshallers during runtime.

Parameters:
qualifedName - the namespace qualifed element name of the schema type of the object provider
Returns:
the object provider configuration element or null if no object provider is configured with that name

registerValidatorSuite

public static void registerValidatorSuite(String suiteId,
                                          ValidatorSuite suite,
                                          Element configuration)
Deprecated. this method is deprecated with no replacement

Registers a configured validator suite.

Parameters:
suiteId - the ID of the suite
suite - the configured suite
configuration - optional XML configuration information

getValidatorSuiteConfiguration

public static Element getValidatorSuiteConfiguration(String suiteId)
Deprecated. this method is deprecated with no replacement

Gets a clone of the ValidatorSuite configuration element for the ID. Note that this configuration reflects the state of things as they were when the configuration was loaded, applications may have programmatically removed altered the suite during runtime.

Parameters:
suiteId - the ID of the ValidatorSuite whose configuration is to be retrieved
Returns:
the validator suite configuration element or null if no suite is configured with that ID

getLogger

private static Logger getLogger()
Get an SLF4J Logger.

Returns:
a Logger instance


Copyright © 1999-2012. All Rights Reserved.