Package org.openas2
Class BaseSession
- java.lang.Object
-
- org.openas2.BaseSession
-
- All Implemented Interfaces:
Session
- Direct Known Subclasses:
XMLSession
public abstract class BaseSession extends java.lang.Object implements Session
-
-
Field Summary
-
Fields inherited from interface org.openas2.Session
DEFAULT_CONTENT_TRANSFER_ENCODING, LOG_LEVEL_OVERRIDE_KEY
-
-
Constructor Summary
Constructors Constructor Description BaseSession()Creates aBaseSessionobject, then calls theinit()method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBaseDirectory()CertificateFactorygetCertificateFactory()Short-cut method to retrieve a certificate factory.ComponentgetComponent(java.lang.String componentID)Gets theComponentcurrently registered with an IDjava.util.Map<java.lang.String,Component>getComponents()Return a map of component ID's toComponentobjects.PartnershipFactorygetPartnershipFactory()Short-cut method to retrieve a partner factory.ProcessorgetProcessor()Short-cut method to retrieve a processor.protected voidinit()This method is called by theBaseSessionconstructor to set up any global configuration settings.voidsetComponent(java.lang.String componentID, Component comp)Registers a component to a specified ID.voidstart()Lifecycle control method.voidstop()Lifecycle control method.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openas2.Session
getAppTitle, getAppVersion
-
-
-
-
Constructor Detail
-
BaseSession
public BaseSession() throws OpenAS2ExceptionCreates aBaseSessionobject, then calls theinit()method.- Throws:
OpenAS2Exception- - - Houston we have a problem- See Also:
init()
-
-
Method Detail
-
start
public void start() throws OpenAS2ExceptionDescription copied from interface:SessionLifecycle control method.- Specified by:
startin interfaceSession- Throws:
OpenAS2Exception
-
stop
public void stop() throws java.lang.ExceptionDescription copied from interface:SessionLifecycle control method.
-
getCertificateFactory
public CertificateFactory getCertificateFactory() throws ComponentNotFoundException
Description copied from interface:SessionShort-cut method to retrieve a certificate factory.- Specified by:
getCertificateFactoryin interfaceSession- Returns:
- the currently registered
CertificateFactorycomponent - Throws:
ComponentNotFoundException- If aCertificateFactorycomponent has not been registered- See Also:
CertificateFactory,Component
-
setComponent
public void setComponent(java.lang.String componentID, Component comp)Registers a component to a specified ID.- Parameters:
componentID- registers the component to this IDcomp- component to register- See Also:
Component
-
getComponent
public Component getComponent(java.lang.String componentID) throws ComponentNotFoundException
Description copied from interface:SessionGets theComponentcurrently registered with an ID- Specified by:
getComponentin interfaceSession- Parameters:
componentID- ID to search for- Returns:
- the component registered to the ID or null
- Throws:
ComponentNotFoundException- If a component is not registered with the ID
-
getComponents
public java.util.Map<java.lang.String,Component> getComponents()
Description copied from interface:SessionReturn a map of component ID's toComponentobjects.- Specified by:
getComponentsin interfaceSession- Returns:
- all registered components, mapped by ID
-
getPartnershipFactory
public PartnershipFactory getPartnershipFactory() throws ComponentNotFoundException
Description copied from interface:SessionShort-cut method to retrieve a partner factory.- Specified by:
getPartnershipFactoryin interfaceSession- Returns:
- the currently registered
PartnerFactorycomponent - Throws:
ComponentNotFoundException- If aPartnerFactorycomponent has not been registered- See Also:
PartnershipFactory,Component
-
getProcessor
public Processor getProcessor() throws ComponentNotFoundException
Description copied from interface:SessionShort-cut method to retrieve a processor.- Specified by:
getProcessorin interfaceSession- Returns:
- the currently registered
Processorcomponent - Throws:
ComponentNotFoundException- If aProcessorcomponent has not been registered- See Also:
Processor,Component
-
init
protected void init() throws OpenAS2ExceptionThis method is called by theBaseSessionconstructor to set up any global configuration settings.- Throws:
OpenAS2Exception- If an error occurs while initializing systems
-
getBaseDirectory
public java.lang.String getBaseDirectory()
- Specified by:
getBaseDirectoryin interfaceSession
-
-