com.iplanet.trustbase.initiator.dsms
Class ProtocolAdapterFactory

java.lang.Object
  |
  +--com.iplanet.trustbase.initiator.dsms.ProtocolAdapterFactory

public class ProtocolAdapterFactory
extends java.lang.Object

The protocol Adapter factory is used by the CSCEngine to select a protocol for a given oid. It uses the configAdapter to determine the association between oid's and classnames. Given an oid "x" is will try and find the property "csc.protocolAdapter.x" which will give the class name if no class name is specified it checks in the resource accessible through the CSCEngine for the property "protocolAdapter.x".

See Also:
CSCEngine, CSCProtocolException, ConfigAdapter, ConfigAdapterException

Field Summary
 java.util.Map adapters
           
 ConfigAdapter configAdapter
           
 
Constructor Summary
ProtocolAdapterFactory(ConfigAdapter configAdapter)
          Construct a Protocol adapter based on the given config adapter.
 
Method Summary
protected  java.lang.String getAdapterClassName(java.lang.String adapterName)
           
 ProtocolAdapter getInstance(java.lang.String oid)
          Get a protocol Adapter for the given protocol
 ProtocolAdapter getInstance(java.lang.String oid, int version)
          Get a Protocol Adapter for the given protocol and version.
protected  ProtocolAdapter makeAdapter(java.lang.String oid, java.lang.String className)
           
protected  java.util.List makeAdapterList(java.lang.String oid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adapters

public java.util.Map adapters

configAdapter

public ConfigAdapter configAdapter
Constructor Detail

ProtocolAdapterFactory

public ProtocolAdapterFactory(ConfigAdapter configAdapter)
Construct a Protocol adapter based on the given config adapter.
Parameters:
configAdapter - the configAdapter.
Method Detail

getInstance

public ProtocolAdapter getInstance(java.lang.String oid)
                            throws CSCProtocolException,
                                   ConfigAdapterException
Get a protocol Adapter for the given protocol
Parameters:
oid - the protocol.
Throws:
CSCProtocolException -  
CSCConfigException -  

getInstance

public ProtocolAdapter getInstance(java.lang.String oid,
                                   int version)
                            throws CSCProtocolException,
                                   ConfigAdapterException
Get a Protocol Adapter for the given protocol and version.
Parameters:
oid - the protocol required.
version - the version number of the protocol - or 0 if the latest version is required.
Throws:
CSCProtocolException -  
CSCConfigException -  

makeAdapterList

protected java.util.List makeAdapterList(java.lang.String oid)
                                  throws CSCProtocolException,
                                         ConfigAdapterException

getAdapterClassName

protected java.lang.String getAdapterClassName(java.lang.String adapterName)
                                        throws ConfigAdapterException

makeAdapter

protected ProtocolAdapter makeAdapter(java.lang.String oid,
                                      java.lang.String className)
                               throws CSCProtocolException,
                                      ConfigAdapterException