org.jdiameter.client.impl
Class SessionFactoryImpl

java.lang.Object
  extended by org.jdiameter.client.impl.SessionFactoryImpl
All Implemented Interfaces:
SessionFactory, ISessionFactory

public class SessionFactoryImpl
extends java.lang.Object
implements ISessionFactory

Implementation for ISessionFactory

Author:
erick.svenson@yahoo.com, Bartosz Baranowski , Alexandre Mendonca

Field Summary
protected static UIDGenerator uid
           
 
Constructor Summary
SessionFactoryImpl(IContainer stack)
           
 
Method Summary
 IAppSessionFactory getAppSessionFactory(java.lang.Class<? extends AppSession> sessionClass)
          Retrieves the app session factory associated with an app session class
 IContainer getContainer()
           
<T extends AppSession>
T
getNewAppSession(ApplicationId applicationId, java.lang.Class<? extends AppSession> aClass)
           
<T extends AppSession>
T
getNewAppSession(java.lang.String sessionId, ApplicationId applicationId, java.lang.Class<? extends AppSession> aClass)
           
<T extends AppSession>
T
getNewAppSession(java.lang.String sessionId, ApplicationId applicationId, java.lang.Class<? extends AppSession> aClass, java.lang.Object... args)
          Method used for creating a new App Session using the specified class with the desired Application Id and Session Id.
 RawSession getNewRawSession()
           
 Session getNewSession()
           
 Session getNewSession(java.lang.String sessionId)
           
 java.lang.String getSessionId()
           
 java.lang.String getSessionId(java.lang.String custom)
           
 void registerAppFacory(java.lang.Class<? extends AppSession> sessionClass, IAppSessionFactory factory)
          Registers a new App Session factory.
 void unRegisterAppFacory(java.lang.Class<? extends AppSession> sessionClass)
          Unregisters an existing App Session factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

uid

protected static UIDGenerator uid
Constructor Detail

SessionFactoryImpl

public SessionFactoryImpl(IContainer stack)
Method Detail

getSessionId

public java.lang.String getSessionId(java.lang.String custom)
Specified by:
getSessionId in interface SessionFactory

getSessionId

public java.lang.String getSessionId()
Specified by:
getSessionId in interface SessionFactory

getNewRawSession

public RawSession getNewRawSession()
                            throws InternalException
Specified by:
getNewRawSession in interface SessionFactory
Throws:
InternalException

getNewSession

public Session getNewSession()
                      throws InternalException
Specified by:
getNewSession in interface SessionFactory
Throws:
InternalException

getNewSession

public Session getNewSession(java.lang.String sessionId)
                      throws InternalException
Specified by:
getNewSession in interface SessionFactory
Throws:
InternalException

getNewAppSession

public <T extends AppSession> T getNewAppSession(ApplicationId applicationId,
                                                 java.lang.Class<? extends AppSession> aClass)
                                      throws InternalException
Specified by:
getNewAppSession in interface SessionFactory
Throws:
InternalException

getNewAppSession

public <T extends AppSession> T getNewAppSession(java.lang.String sessionId,
                                                 ApplicationId applicationId,
                                                 java.lang.Class<? extends AppSession> aClass)
                                      throws InternalException
Specified by:
getNewAppSession in interface SessionFactory
Throws:
InternalException

getNewAppSession

public <T extends AppSession> T getNewAppSession(java.lang.String sessionId,
                                                 ApplicationId applicationId,
                                                 java.lang.Class<? extends AppSession> aClass,
                                                 java.lang.Object... args)
                                      throws InternalException
Description copied from interface: ISessionFactory
Method used for creating a new App Session using the specified class with the desired Application Id and Session Id.

Specified by:
getNewAppSession in interface ISessionFactory
Parameters:
sessionId - the session-id for this App Session, if desired
applicationId - the application id for this session
aClass - the class of the app session object
Returns:
an AppSession instance
Throws:
InternalException

registerAppFacory

public void registerAppFacory(java.lang.Class<? extends AppSession> sessionClass,
                              IAppSessionFactory factory)
Description copied from interface: ISessionFactory
Registers a new App Session factory.

Specified by:
registerAppFacory in interface ISessionFactory
Parameters:
sessionClass - the class of the objects being generated by the factory
factory - the factory to generate app sessions

unRegisterAppFacory

public void unRegisterAppFacory(java.lang.Class<? extends AppSession> sessionClass)
Description copied from interface: ISessionFactory
Unregisters an existing App Session factory.

Specified by:
unRegisterAppFacory in interface ISessionFactory
Parameters:
sessionClass - the class identifier for this factory

getAppSessionFactory

public IAppSessionFactory getAppSessionFactory(java.lang.Class<? extends AppSession> sessionClass)
Description copied from interface: ISessionFactory
Retrieves the app session factory associated with an app session class

Specified by:
getAppSessionFactory in interface ISessionFactory
Parameters:
sessionClass - the class identifier for the desired factory
Returns:
the App Session Factory instance if registered, null if no factory is registered for such class

getContainer

public IContainer getContainer()
Specified by:
getContainer in interface ISessionFactory
Returns:


Copyright © 2014. All Rights Reserved.