public class CredentialHandlerFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_PACKAGE_NAME
The default package where the all the implementing classes are supposed to
reside.
|
private static java.lang.String |
IRODS_IMPLEMENTING_CLASS |
private PegasusBag |
mBag
Handle to the PegasusBag
|
private static java.util.Map |
mImplementingClassNameTable
A table that maps, Pegasus style keys to the names of the corresponding classes
implementing the CondorStyle interface.
|
private java.util.Map<CredentialHandler.TYPE,CredentialHandler> |
mImplementingClassTable
A table that maps, Pegasus style keys to appropriate classes implementing the
CredentialHandler interface
|
private boolean |
mInitialized
A boolean indicating that the factory has been initialized.
|
private static java.lang.String |
S3_IMPLEMENTING_CLASS |
private static java.lang.String |
SSH_IMPLEMENTING_CLASS |
private static java.lang.String |
X509_IMPLEMENTING_CLASS
The name of the class implementing the x509 credentials
|
Constructor and Description |
---|
CredentialHandlerFactory()
The default constructor.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.Object |
get(CredentialHandler.TYPE type)
Returns the implementation from the implementing class table.
|
private static java.util.Map<CredentialHandler.TYPE,java.lang.String> |
implementingClassNameTable()
Returns a table that maps, the credential types to the implementing
classes.
|
void |
initialize(PegasusBag bag)
Initializes the Factory.
|
CredentialHandler |
loadInstance(CredentialHandler.TYPE type)
This method loads the appropriate implementing CondorStyle as specified
by the user at runtime.
|
private CredentialHandler |
loadInstance(PegasusBag bag,
java.lang.String className)
This method loads the appropriate CredentialHandler using reflection.
|
private void |
put(CredentialHandler.TYPE type,
CredentialHandler implementation)
Inserts an entry into the implementing class table.
|
public static final java.lang.String DEFAULT_PACKAGE_NAME
private static final java.lang.String X509_IMPLEMENTING_CLASS
private static final java.lang.String IRODS_IMPLEMENTING_CLASS
private static final java.lang.String S3_IMPLEMENTING_CLASS
private static final java.lang.String SSH_IMPLEMENTING_CLASS
private static java.util.Map mImplementingClassNameTable
private java.util.Map<CredentialHandler.TYPE,CredentialHandler> mImplementingClassTable
private boolean mInitialized
private PegasusBag mBag
public CredentialHandlerFactory()
private static java.util.Map<CredentialHandler.TYPE,java.lang.String> implementingClassNameTable()
public void initialize(PegasusBag bag) throws CredentialHandlerFactoryException
bag
- the bag of initialization objectsCredentialHandlerFactoryException
- that nests any error that
might occur during the instantiation of the implementation.public CredentialHandler loadInstance(CredentialHandler.TYPE type) throws CredentialHandlerFactoryException
type
- the credential type that needs to be loaded.CredentialHandlerFactoryException
- that nests any error that
might occur during the instantiation of the implementation.private CredentialHandler loadInstance(PegasusBag bag, java.lang.String className) throws CredentialHandlerFactoryException
bag
- the bag of initialization objectsclassName
- the name of the implementing class.CredentialHandlerFactoryException
- that nests any error that
might occur during the instantiation of the implementation.DEFAULT_PACKAGE_NAME
private java.lang.Object get(CredentialHandler.TYPE type)
type
- the credential handler typeprivate void put(CredentialHandler.TYPE type, CredentialHandler implementation)
type
- the credential handler typeimplementation
- the class implementing that style.