Project Aristotle - ArisID Attribute Services

org.openliberty.arisid
Class ArisIdServiceFactory

java.lang.Object
  extended by org.openliberty.arisid.ArisIdServiceFactory

public class ArisIdServiceFactory
extends java.lang.Object

The ArisIdServiceFactory is responsible for creating and managing instances of ArisIdService objects. Each ArisIdService object is associated with a single CARML declaration and a single Attribute Services Stack Provider (IAttrSvcStack). Each ArisIdService instance created by the factory represents a single CARML declaration (containing 1 or more Interaction objects used to read and modify data. An ArisIdService has associated with it a class that implements the services used by the defined Interactions. While there may be multiple ArisIdService objects with differing CARML declarations, the factory will work to ensure that there is only once instance of each IAttrSvcStack stack in the JVM.

Version:
0.1, 12/17/07

Field Summary
static java.lang.String IGF_ATTRIBUTE_SERVICE_PROV_DEFAULT
           
static java.lang.String IGF_ATTRIBUTE_SERVICE_PROVIDER
           
 
Constructor Summary
ArisIdServiceFactory()
           
 
Method Summary
static ArisIdService createAttributeService(java.lang.Class<IAttrSvcStack> stackImplementationClass, javax.security.auth.Subject appCredential, java.net.URI carmldoc)
          The attribute services factory will create an ArisIdService instance based on the requested class implementing the IAttrSvcStack interface.
static ArisIdService createAttributeService(java.lang.String stackImplementationClass, javax.security.auth.Subject appCredential, java.net.URI carmldoc, java.lang.String appIdName, java.net.URI appUri, java.lang.String appDescription)
          The attribute services factory will create an ArisIdService instance based on the requested class implementing the IAttrSvcStack interface.
static ArisIdService createAttributeService(javax.security.auth.Subject appCredential, java.lang.String appIdName, java.net.URI appUri, java.lang.String appDescription)
          The attribute services factory will create an ArisIdService instance based on the java property org.openliberty.arisid.stack that implements IAttrSvcStack interface.
static ArisIdService createAttributeService(javax.security.auth.Subject appCredential, java.net.URI carmldoc)
          The attribute services factory will create an ArisIdService instance based on the java property org.openliberty.arisid.stack that implements IAttrSvcStack interface.
static ArisIdService parseCarmlOnly(java.net.URI carmlDoc)
          Method used to instantiate an ArisIdService for the purpose of Carml declaration parsing only.
static void restart()
          Initiate a warm restart with all currently instantiated stacks.
static void shutdown()
          Initiate a graceful shutdown of all stacks being managed by the factory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IGF_ATTRIBUTE_SERVICE_PROVIDER

public static final java.lang.String IGF_ATTRIBUTE_SERVICE_PROVIDER
See Also:
Constant Field Values

IGF_ATTRIBUTE_SERVICE_PROV_DEFAULT

public static final java.lang.String IGF_ATTRIBUTE_SERVICE_PROV_DEFAULT
See Also:
Constant Field Values
Constructor Detail

ArisIdServiceFactory

public ArisIdServiceFactory()
Method Detail

createAttributeService

public static ArisIdService createAttributeService(java.lang.Class<IAttrSvcStack> stackImplementationClass,
                                                   javax.security.auth.Subject appCredential,
                                                   java.net.URI carmldoc)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.InstantiationException,
                                                   java.lang.IllegalAccessException,
                                                   AuthenticationException,
                                                   NoSuchContextException,
                                                   NoSuchSubjectException,
                                                   SubjectNotUniqueException,
                                                   IGFException,
                                                   java.io.FileNotFoundException
The attribute services factory will create an ArisIdService instance based on the requested class implementing the IAttrSvcStack interface. This method should only be used for testing or in broader implementations. Applications should not force a particular stack.

Parameters:
stackImplementationClass - The class to be instantiated implementing the IAttrSvcStack interface.
appCredential - A Subject representing the applications credential which will be authenticated during the instantiation.
carmldoc - A URI for a CARML declaration document used to initialize the attribute service or NULL if the document is to be created dynamically.
Returns:
An instance of ArisIdService
Throws:
java.lang.ClassNotFoundException - The specified stack class was not found.
java.lang.InstantiationException - There was an error instantiating the class or the stack specified does not implement IAttrSvcStack/
java.lang.IllegalAccessException
IGFException - A general IGF Exception has occurred.
SubjectNotUniqueException - The application credential could not be mapped to a unique Subject (e.g. multiple matches found).
NoSuchContextException - The attribute service stack could no locate the context for the application subject.
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
AuthenticationException - The credential specified by the Subject did not authenticate successfully
java.io.FileNotFoundException - Thrown when the carmldoc cannot be located through the provided URI.

createAttributeService

public static ArisIdService createAttributeService(java.lang.String stackImplementationClass,
                                                   javax.security.auth.Subject appCredential,
                                                   java.net.URI carmldoc,
                                                   java.lang.String appIdName,
                                                   java.net.URI appUri,
                                                   java.lang.String appDescription)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.InstantiationException,
                                                   java.lang.IllegalAccessException,
                                                   AuthenticationException,
                                                   NoSuchContextException,
                                                   NoSuchSubjectException,
                                                   SubjectNotUniqueException,
                                                   IGFException,
                                                   java.io.FileNotFoundException
The attribute services factory will create an ArisIdService instance based on the requested class implementing the IAttrSvcStack interface. This method should only be used for testing or in broader implementations. Applications should not force a particular stack.

Parameters:
stackImplementationClass - The class to be instantiated implementing the IAttrSvcStack interface.
appCredential - A Subject representing the applications credential which will be authenticated during the instantiation.
carmldoc - A URI for a CARML declaration document used to initialize the attribute service or NULL if the document is to be created dynamically.
appIdName - A unique name (URI) for the application
appDescription - A description of the application or null
Returns:
An instance of ArisIdService
Throws:
java.lang.ClassNotFoundException - The specified stack class was not found.
java.lang.InstantiationException - There was an error instantiating the class or the stack specified does not implement IAttrSvcStack/
java.lang.IllegalAccessException
IGFException - A general IGF Exception has occurred.
SubjectNotUniqueException - The application credential could not be mapped to a unique Subject (e.g. multiple matches found).
NoSuchContextException - The attribute service stack could no locate the context for the application subject.
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
AuthenticationException - The credential specified by the Subject did not authenticate successfully
java.io.FileNotFoundException - Thrown when the carmldoc cannot be located through the provided URI.

createAttributeService

public static ArisIdService createAttributeService(javax.security.auth.Subject appCredential,
                                                   java.lang.String appIdName,
                                                   java.net.URI appUri,
                                                   java.lang.String appDescription)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.InstantiationException,
                                                   java.lang.IllegalAccessException,
                                                   AuthenticationException,
                                                   NoSuchContextException,
                                                   NoSuchSubjectException,
                                                   SubjectNotUniqueException,
                                                   IGFException
The attribute services factory will create an ArisIdService instance based on the java property org.openliberty.arisid.stack that implements IAttrSvcStack interface. This is the preferred way to instantiate an ArisIdService when the CarmlDoc object is being created using the java classes.

Parameters:
appCredential - A Subject representing the applications credential which will be authenticated during the instantiation.
appIdName - A unique name for the application (URI)
appDescription - A description of the application (or null).
Returns:
An instance of ArisIdService
Throws:
java.lang.ClassNotFoundException - The specified stack class was not found.
java.lang.InstantiationException - There was an error instantiating the class or the stack specified does not implement IAttrSvcStack/
java.lang.IllegalAccessException
IGFException - A general IGF Exception has occurred.
SubjectNotUniqueException - The application credential could not be mapped to a unique Subject (e.g. multiple matches found).
NoSuchContextException - The attribute service stack could no locate the context for the application subject.
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
AuthenticationException - The credential specified by the Subject did not authenticate successfully

parseCarmlOnly

public static ArisIdService parseCarmlOnly(java.net.URI carmlDoc)
                                    throws java.io.FileNotFoundException,
                                           AttrSvcInitializedException,
                                           java.lang.InstantiationException,
                                           IGFException,
                                           java.lang.IllegalAccessException
Method used to instantiate an ArisIdService for the purpose of Carml declaration parsing only. The ArisIdService created will not have a stack provider declared and thus cannot be initialized by calling the initialize method.

Parameters:
carmlDoc - A URI describing the location of the CARML declaration to be parsed.
Returns:
An ArisIdService object containing the parsed CarmlDoc object.
Throws:
java.io.FileNotFoundException - Occurs when the CARML document cannot be opened.
AttrSvcInitializedException - Occurs if a parsing or other error occurs during initialization.
java.lang.InstantiationException
IGFException
java.lang.IllegalAccessException

createAttributeService

public static ArisIdService createAttributeService(javax.security.auth.Subject appCredential,
                                                   java.net.URI carmldoc)
                                            throws java.lang.ClassNotFoundException,
                                                   java.lang.InstantiationException,
                                                   java.lang.IllegalAccessException,
                                                   AuthenticationException,
                                                   NoSuchContextException,
                                                   NoSuchSubjectException,
                                                   SubjectNotUniqueException,
                                                   IGFException,
                                                   java.io.FileNotFoundException
The attribute services factory will create an ArisIdService instance based on the java property org.openliberty.arisid.stack that implements IAttrSvcStack interface. This is the preferred way to instantiate an ArisIdService when there is an existing CARML document.

Parameters:
appCredential - A Subject representing the applications credential which will be authenticated during the instantiation.
carmldoc - A URI for a CARML declaration document used to initialize the attribute service or NULL if the document is to be created dynamically.
Returns:
An instance of ArisIdService
Throws:
java.lang.ClassNotFoundException - The specified stack class was not found.
java.lang.InstantiationException - There was an error instantiating the class or the stack specified does not implement IAttrSvcStack/
java.lang.IllegalAccessException
IGFException - A general IGF Exception has occurred.
SubjectNotUniqueException - The application credential could not be mapped to a unique Subject (e.g. multiple matches found).
NoSuchContextException - The attribute service stack could no locate the context for the application subject.
NoSuchSubjectException - The attribute service could not locate a subject within the mapped context to authenticate
AuthenticationException - The credential specified by the Subject did not authenticate successfully
java.io.FileNotFoundException - Thrown when the carmldoc cannot be located through the provided URI.

shutdown

public static void shutdown()
Initiate a graceful shutdown of all stacks being managed by the factory. Note: this is a privileged operation.


restart

public static void restart()
Initiate a warm restart with all currently instantiated stacks. Note: this is a privileged operation.


OpenLiberty.org - Licensed under Apache APL 2.0