org.jdiameter.common.impl.app.sh
Class ShSessionFactoryImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.sh.ShSessionFactoryImpl
All Implemented Interfaces:
StateChangeListener<AppSession>, ClientShSessionListener, ServerShSessionListener, IAppSessionFactory, IShMessageFactory, IShSessionFactory

public class ShSessionFactoryImpl
extends java.lang.Object
implements IShSessionFactory, StateChangeListener<AppSession>, ClientShSessionListener, ServerShSessionListener, IShMessageFactory

Author:
Alexandre Mendonca , Bartosz Baranowski

Field Summary
protected static long applicationId
           
protected  ClientShSessionListener clientShSessionListener
           
protected  org.slf4j.Logger logger
           
protected  IShMessageFactory messageFactory
           
protected  long messageTimeout
           
protected  ServerShSessionListener serverShSessionListener
           
protected  IAppSessionDataFactory<IShSessionData> sessionDataFactory
           
protected  ISessionDatasource sessionDataSource
           
protected  ISessionFactory sessionFactory
           
protected  StateChangeListener<AppSession> stateChangeListener
           
 
Constructor Summary
ShSessionFactoryImpl(SessionFactory sessionFactory)
           
 
Method Summary
 AppAnswerEvent createProfileUpdateAnswer(Answer answer)
           
 AppRequestEvent createProfileUpdateRequest(Request request)
           
 AppAnswerEvent createPushNotificationAnswer(Answer answer)
           
 AppRequestEvent createPushNotificationRequest(Request request)
           
 AppAnswerEvent createSubscribeNotificationsAnswer(Answer answer)
           
 AppRequestEvent createSubscribeNotificationsRequest(Request request)
           
 AppAnswerEvent createUserDataAnswer(Answer answer)
           
 AppRequestEvent createUserDataRequest(Request request)
           
 void doOtherEvent(AppSession session, AppRequestEvent request, AppAnswerEvent answer)
           
 void doProfileUpdateAnswerEvent(ClientShSession session, ProfileUpdateRequest request, ProfileUpdateAnswer answer)
           
 void doProfileUpdateRequestEvent(ServerShSession session, ProfileUpdateRequest request)
           
 void doPushNotificationAnswerEvent(ServerShSession session, PushNotificationRequest request, PushNotificationAnswer answer)
           
 void doPushNotificationRequestEvent(ClientShSession session, PushNotificationRequest request)
           
 void doSubscribeNotificationsAnswerEvent(ClientShSession session, SubscribeNotificationsRequest request, SubscribeNotificationsAnswer answer)
           
 void doSubscribeNotificationsRequestEvent(ServerShSession session, SubscribeNotificationsRequest request)
           
 void doUserDataAnswerEvent(ClientShSession session, UserDataRequest request, UserDataAnswer answer)
           
 void doUserDataRequestEvent(ServerShSession session, UserDataRequest request)
           
 long getApplicationId()
           
 ClientShSessionListener getClientShSessionListener()
           
 IShMessageFactory getMessageFactory()
           
 long getMessageTimeout()
           
 AppSession getNewSession(java.lang.String sessionId, java.lang.Class<? extends AppSession> aClass, ApplicationId applicationId, java.lang.Object[] args)
           
 ServerShSessionListener getServerShSessionListener()
           
 AppSession getSession(java.lang.String sessionId, java.lang.Class<? extends AppSession> aClass)
           
 StateChangeListener<AppSession> getStateChangeListener()
           
 void setClientShSessionListener(ClientShSessionListener clientShSessionListener)
           
 void setMessageFactory(IShMessageFactory messageFactory)
           
 void setServerShSessionListener(ServerShSessionListener serverShSessionListener)
           
 void setStateChangeListener(StateChangeListener<AppSession> stateChangeListener)
           
 void stateChanged(AppSession source, java.lang.Enum oldState, java.lang.Enum newState)
           
 void stateChanged(java.lang.Enum oldState, java.lang.Enum newState)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected org.slf4j.Logger logger

clientShSessionListener

protected ClientShSessionListener clientShSessionListener

serverShSessionListener

protected ServerShSessionListener serverShSessionListener

messageFactory

protected IShMessageFactory messageFactory

stateChangeListener

protected StateChangeListener<AppSession> stateChangeListener

sessionFactory

protected ISessionFactory sessionFactory

sessionDataSource

protected ISessionDatasource sessionDataSource

sessionDataFactory

protected IAppSessionDataFactory<IShSessionData> sessionDataFactory

messageTimeout

protected long messageTimeout

applicationId

protected static final long applicationId
See Also:
Constant Field Values
Constructor Detail

ShSessionFactoryImpl

public ShSessionFactoryImpl(SessionFactory sessionFactory)
Method Detail

getClientShSessionListener

public ClientShSessionListener getClientShSessionListener()
Specified by:
getClientShSessionListener in interface IShSessionFactory
Returns:
the clientShSessionListener

setClientShSessionListener

public void setClientShSessionListener(ClientShSessionListener clientShSessionListener)
Specified by:
setClientShSessionListener in interface IShSessionFactory
Parameters:
clientShSessionListener - the clientShSessionListener to set

getServerShSessionListener

public ServerShSessionListener getServerShSessionListener()
Specified by:
getServerShSessionListener in interface IShSessionFactory
Returns:
the serverShSessionListener

setServerShSessionListener

public void setServerShSessionListener(ServerShSessionListener serverShSessionListener)
Specified by:
setServerShSessionListener in interface IShSessionFactory
Parameters:
serverShSessionListener - the serverShSessionListener to set

getMessageFactory

public IShMessageFactory getMessageFactory()
Specified by:
getMessageFactory in interface IShSessionFactory
Returns:
the messageFactory

setMessageFactory

public void setMessageFactory(IShMessageFactory messageFactory)
Specified by:
setMessageFactory in interface IShSessionFactory
Parameters:
messageFactory - the messageFactory to set

getStateChangeListener

public StateChangeListener<AppSession> getStateChangeListener()
Specified by:
getStateChangeListener in interface IShSessionFactory
Returns:
the stateChangeListener

setStateChangeListener

public void setStateChangeListener(StateChangeListener<AppSession> stateChangeListener)
Specified by:
setStateChangeListener in interface IShSessionFactory
Parameters:
stateChangeListener - the stateChangeListener to set

getNewSession

public AppSession getNewSession(java.lang.String sessionId,
                                java.lang.Class<? extends AppSession> aClass,
                                ApplicationId applicationId,
                                java.lang.Object[] args)
Specified by:
getNewSession in interface IAppSessionFactory

getSession

public AppSession getSession(java.lang.String sessionId,
                             java.lang.Class<? extends AppSession> aClass)
Specified by:
getSession in interface IAppSessionFactory

stateChanged

public void stateChanged(java.lang.Enum oldState,
                         java.lang.Enum newState)
Specified by:
stateChanged in interface StateChangeListener<AppSession>

stateChanged

public void stateChanged(AppSession source,
                         java.lang.Enum oldState,
                         java.lang.Enum newState)
Specified by:
stateChanged in interface StateChangeListener<AppSession>

doOtherEvent

public void doOtherEvent(AppSession session,
                         AppRequestEvent request,
                         AppAnswerEvent answer)
                  throws InternalException,
                         IllegalDiameterStateException,
                         RouteException,
                         OverloadException
Specified by:
doOtherEvent in interface ClientShSessionListener
Specified by:
doOtherEvent in interface ServerShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doProfileUpdateAnswerEvent

public void doProfileUpdateAnswerEvent(ClientShSession session,
                                       ProfileUpdateRequest request,
                                       ProfileUpdateAnswer answer)
                                throws InternalException,
                                       IllegalDiameterStateException,
                                       RouteException,
                                       OverloadException
Specified by:
doProfileUpdateAnswerEvent in interface ClientShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doPushNotificationRequestEvent

public void doPushNotificationRequestEvent(ClientShSession session,
                                           PushNotificationRequest request)
                                    throws InternalException,
                                           IllegalDiameterStateException,
                                           RouteException,
                                           OverloadException
Specified by:
doPushNotificationRequestEvent in interface ClientShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doSubscribeNotificationsAnswerEvent

public void doSubscribeNotificationsAnswerEvent(ClientShSession session,
                                                SubscribeNotificationsRequest request,
                                                SubscribeNotificationsAnswer answer)
                                         throws InternalException,
                                                IllegalDiameterStateException,
                                                RouteException,
                                                OverloadException
Specified by:
doSubscribeNotificationsAnswerEvent in interface ClientShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doUserDataAnswerEvent

public void doUserDataAnswerEvent(ClientShSession session,
                                  UserDataRequest request,
                                  UserDataAnswer answer)
                           throws InternalException,
                                  IllegalDiameterStateException,
                                  RouteException,
                                  OverloadException
Specified by:
doUserDataAnswerEvent in interface ClientShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doProfileUpdateRequestEvent

public void doProfileUpdateRequestEvent(ServerShSession session,
                                        ProfileUpdateRequest request)
                                 throws InternalException,
                                        IllegalDiameterStateException,
                                        RouteException,
                                        OverloadException
Specified by:
doProfileUpdateRequestEvent in interface ServerShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doPushNotificationAnswerEvent

public void doPushNotificationAnswerEvent(ServerShSession session,
                                          PushNotificationRequest request,
                                          PushNotificationAnswer answer)
                                   throws InternalException,
                                          IllegalDiameterStateException,
                                          RouteException,
                                          OverloadException
Specified by:
doPushNotificationAnswerEvent in interface ServerShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doSubscribeNotificationsRequestEvent

public void doSubscribeNotificationsRequestEvent(ServerShSession session,
                                                 SubscribeNotificationsRequest request)
                                          throws InternalException,
                                                 IllegalDiameterStateException,
                                                 RouteException,
                                                 OverloadException
Specified by:
doSubscribeNotificationsRequestEvent in interface ServerShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doUserDataRequestEvent

public void doUserDataRequestEvent(ServerShSession session,
                                   UserDataRequest request)
                            throws InternalException,
                                   IllegalDiameterStateException,
                                   RouteException,
                                   OverloadException
Specified by:
doUserDataRequestEvent in interface ServerShSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

createProfileUpdateAnswer

public AppAnswerEvent createProfileUpdateAnswer(Answer answer)
Specified by:
createProfileUpdateAnswer in interface IShMessageFactory

createProfileUpdateRequest

public AppRequestEvent createProfileUpdateRequest(Request request)
Specified by:
createProfileUpdateRequest in interface IShMessageFactory

createPushNotificationAnswer

public AppAnswerEvent createPushNotificationAnswer(Answer answer)
Specified by:
createPushNotificationAnswer in interface IShMessageFactory

createPushNotificationRequest

public AppRequestEvent createPushNotificationRequest(Request request)
Specified by:
createPushNotificationRequest in interface IShMessageFactory

createSubscribeNotificationsAnswer

public AppAnswerEvent createSubscribeNotificationsAnswer(Answer answer)
Specified by:
createSubscribeNotificationsAnswer in interface IShMessageFactory

createSubscribeNotificationsRequest

public AppRequestEvent createSubscribeNotificationsRequest(Request request)
Specified by:
createSubscribeNotificationsRequest in interface IShMessageFactory

createUserDataAnswer

public AppAnswerEvent createUserDataAnswer(Answer answer)
Specified by:
createUserDataAnswer in interface IShMessageFactory

createUserDataRequest

public AppRequestEvent createUserDataRequest(Request request)
Specified by:
createUserDataRequest in interface IShMessageFactory

getApplicationId

public long getApplicationId()
Specified by:
getApplicationId in interface IShMessageFactory

getMessageTimeout

public long getMessageTimeout()
Specified by:
getMessageTimeout in interface IShMessageFactory


Copyright © 2014. All Rights Reserved.