net.geant.edugain.attributes
Class AttributeConverterFactory

java.lang.Object
  extended by net.geant.edugain.attributes.AttributeConverterFactory

public class AttributeConverterFactory
extends java.lang.Object

Singleton factory class for AttributeConverter and AttributeNameMappers. Instances which are created by this factory are configured with XML files. These file paths MUST be set before the createXXX method is called.

Author:
Adam Lantos

Field Summary
private  java.lang.String acFilePath
          AttributeConverter configuration file path.
private  java.lang.String afFilePath
          AttributeFilter configuration file path.
private  java.lang.String amFilePath
          AttributeNameMapper configuration file path.
private static AttributeConverterFactory instance
           
private  org.apache.log4j.Logger log
           
private static AttributeNameMapper nameMapper
          The configured AttributeNameMapper instance.
 
Constructor Summary
private AttributeConverterFactory()
          Private constructor.
 
Method Summary
 AttributeConverter createAttributeConverter()
          Creates new AttributeConverter instance, and configures it with the XML file.
private  AttributeConverter createAttributeConverter(AttributeConversionRulesType converterConfiguration)
          Creates new AttributeConverter instance.
 AttributeConverter createAttributeConverter(java.lang.String converterXMLConfig)
          Creates new AttributeConverter instance and configures it with String XML configuration.
 AttributeFilter createAttributeFilter()
          Creates new AttributeFilter instance, and configures it with the XML file.
private  AttributeFilter createAttributeFilter(AttributeFilterType filterConfiguration)
           
 AttributeFilter createAttributeFilter(java.lang.String filterXMLConfig)
           
 AttributeNameMapper createAttributeNameMapper()
          Creates new AttributeNameMapper instance and configures it.
 RequestContext createRequestContext(java.util.List<AttributeValues> input, java.lang.String remoteProvider, java.lang.String localProvider)
          Creates request context from input AttributeValues list and remote and local provider identifier.
 java.lang.String getAttributeConverterFilePath()
           
 java.lang.String getAttributeFilterFilePath()
          Get the Attribute Filter configuration file path.
private  AttributeNameMapper getAttributeNameMapper()
           
 java.lang.String getAttributeNameMapperFilePath()
           
static AttributeConverterFactory getInstance()
          Returns the AttributeConverterFactory instance.
 void setAttributeConverterFilePath(java.lang.String acFilePath)
          Set the Attribute Converter configuration file path.
 void setAttributeFilterFilePath(java.lang.String afFilePath)
          Set the Attribute Filter configuration file path.
 void setAttributeNameMapperFilePath(java.lang.String amFilePath)
          Set the Attribute Name Mapper configuration file path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static AttributeConverterFactory instance

acFilePath

private java.lang.String acFilePath
AttributeConverter configuration file path.


amFilePath

private java.lang.String amFilePath
AttributeNameMapper configuration file path.


afFilePath

private java.lang.String afFilePath
AttributeFilter configuration file path.


nameMapper

private static AttributeNameMapper nameMapper
The configured AttributeNameMapper instance.


log

private org.apache.log4j.Logger log
Constructor Detail

AttributeConverterFactory

private AttributeConverterFactory()
Private constructor.

Method Detail

getInstance

public static AttributeConverterFactory getInstance()
Returns the AttributeConverterFactory instance.

Returns:

createAttributeConverter

public AttributeConverter createAttributeConverter()
                                            throws ConfigurationException
Creates new AttributeConverter instance, and configures it with the XML file. This method will also configure the attribute name mapper.

Returns:
configured AttributeConverter instance
Throws:
ConfigurationException

createAttributeConverter

public AttributeConverter createAttributeConverter(java.lang.String converterXMLConfig)
                                            throws ConfigurationException
Creates new AttributeConverter instance and configures it with String XML configuration.

Parameters:
converterXMLConfig -
Returns:
Throws:
ConfigurationException

createAttributeConverter

private AttributeConverter createAttributeConverter(AttributeConversionRulesType converterConfiguration)
                                             throws ConfigurationException
Creates new AttributeConverter instance.

Parameters:
converterConfiguration -
Returns:
Throws:
ConfigurationException

createAttributeFilter

public AttributeFilter createAttributeFilter()
                                      throws ConfigurationException
Creates new AttributeFilter instance, and configures it with the XML file. This method will also configure the attribute name mapper.

Returns:
configured AttributeFilter instance
Throws:
ConfigurationException

createAttributeFilter

public AttributeFilter createAttributeFilter(java.lang.String filterXMLConfig)
                                      throws ConfigurationException
Throws:
ConfigurationException

createAttributeFilter

private AttributeFilter createAttributeFilter(AttributeFilterType filterConfiguration)
                                       throws ConfigurationException
Throws:
ConfigurationException

createAttributeNameMapper

public AttributeNameMapper createAttributeNameMapper()
                                              throws ConfigurationException
Creates new AttributeNameMapper instance and configures it.

Returns:
configuread AttributeNameMapper instance
Throws:
ConfigurationException

getAttributeConverterFilePath

public java.lang.String getAttributeConverterFilePath()

setAttributeConverterFilePath

public void setAttributeConverterFilePath(java.lang.String acFilePath)
Set the Attribute Converter configuration file path.

Parameters:
acFilePath -

getAttributeNameMapperFilePath

public java.lang.String getAttributeNameMapperFilePath()

setAttributeNameMapperFilePath

public void setAttributeNameMapperFilePath(java.lang.String amFilePath)
Set the Attribute Name Mapper configuration file path.

Parameters:
amFilePath -

getAttributeFilterFilePath

public java.lang.String getAttributeFilterFilePath()
Get the Attribute Filter configuration file path.

Returns:

setAttributeFilterFilePath

public void setAttributeFilterFilePath(java.lang.String afFilePath)
Set the Attribute Filter configuration file path.

Parameters:
amFilePath -

createRequestContext

public RequestContext createRequestContext(java.util.List<AttributeValues> input,
                                           java.lang.String remoteProvider,
                                           java.lang.String localProvider)
Creates request context from input AttributeValues list and remote and local provider identifier.

Parameters:
input -
remoteProvider -
localProvider -
Returns:
requestContext

getAttributeNameMapper

private AttributeNameMapper getAttributeNameMapper()