org.jdiameter.common.impl.app.cxdx
Class CxDxSessionFactoryImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.cxdx.CxDxSessionFactoryImpl
All Implemented Interfaces:
StateChangeListener<AppSession>, ClientCxDxSessionListener, ServerCxDxSessionListener, ICxDxMessageFactory, ICxDxSessionFactory, IAppSessionFactory

public class CxDxSessionFactoryImpl
extends java.lang.Object
implements ICxDxSessionFactory, ClientCxDxSessionListener, ServerCxDxSessionListener, ICxDxMessageFactory, StateChangeListener<AppSession>

Author:
Bartosz Baranowski , Alexandre Mendonca

Field Summary
protected  ClientCxDxSessionListener clientSessionListener
           
protected  ISessionDatasource iss
           
protected  ICxDxMessageFactory messageFactory
           
protected  ServerCxDxSessionListener serverSessionListener
           
protected  IAppSessionDataFactory<ICxDxSessionData> sessionDataFactory
           
protected  ISessionFactory sessionFactory
           
protected  StateChangeListener<AppSession> stateListener
           
 
Constructor Summary
CxDxSessionFactoryImpl(SessionFactory sessionFactory)
           
 
Method Summary
 JLocationInfoAnswer createLocationInfoAnswer(Answer answer)
          Creates a Location-Info-Answer event.
 JLocationInfoRequest createLocationInfoRequest(Request request)
          Creates a Location-Info-Request event.
 JMultimediaAuthAnswer createMultimediaAuthAnswer(Answer answer)
          Creates a Multimedia-Auth-Answer event.
 JMultimediaAuthRequest createMultimediaAuthRequest(Request request)
          Creates a Multimedia-Auth-Request event.
 JPushProfileAnswer createPushProfileAnswer(Answer answer)
          Creates a Push-Profile-Answer event.
 JPushProfileRequest createPushProfileRequest(Request request)
          Creates a Push-Profile-Request event.
 JRegistrationTerminationAnswer createRegistrationTerminationAnswer(Answer answer)
          Creates a Registration-Termination-Answer event.
 JRegistrationTerminationRequest createRegistrationTerminationRequest(Request request)
          Creates a Registration-Termination-Request event.
 JServerAssignmentAnswer createServerAssignmentAnswer(Answer answer)
          Creates a Server-Assignment-Answer event.
 JServerAssignmentRequest createServerAssignmentRequest(Request request)
          Creates a Server-Assignment-Request event.
 JUserAuthorizationAnswer createUserAuthorizationAnswer(Answer answer)
          Creates a User-Authorization-Answer event.
 JUserAuthorizationRequest createUserAuthorizationRequest(Request request)
          Creates a User-Authorization-Request event.
 void doLocationInformationAnswer(ClientCxDxSession appSession, JLocationInfoRequest request, JLocationInfoAnswer answer)
           
 void doLocationInformationRequest(ServerCxDxSession appSession, JLocationInfoRequest request)
           
 void doMultimediaAuthAnswer(ClientCxDxSession appSession, JMultimediaAuthRequest request, JMultimediaAuthAnswer answer)
           
 void doMultimediaAuthRequest(ServerCxDxSession appSession, JMultimediaAuthRequest request)
           
 void doOtherEvent(AppSession appSession, AppRequestEvent request, AppAnswerEvent answer)
           
 void doPushProfileAnswer(ServerCxDxSession appSession, JPushProfileRequest request, JPushProfileAnswer answer)
           
 void doPushProfileRequest(ClientCxDxSession appSession, JPushProfileRequest request)
           
 void doRegistrationTerminationAnswer(ServerCxDxSession appSession, JRegistrationTerminationRequest request, JRegistrationTerminationAnswer answer)
           
 void doRegistrationTerminationRequest(ClientCxDxSession appSession, JRegistrationTerminationRequest request)
           
 void doServerAssignmentAnswer(ClientCxDxSession appSession, JServerAssignmentRequest request, JServerAssignmentAnswer answer)
           
 void doServerAssignmentRequest(ServerCxDxSession appSession, JServerAssignmentRequest request)
           
 void doUserAuthorizationAnswer(ClientCxDxSession appSession, JUserAuthorizationRequest request, JUserAuthorizationAnswer answer)
           
 void doUserAuthorizationRequest(ServerCxDxSession appSession, JUserAuthorizationRequest request)
           
 long getApplicationId()
          Returns the Application-Id that this message factory is related to
 ClientCxDxSessionListener getClientSessionListener()
          Get stack wide listener for sessions.
 ICxDxMessageFactory getMessageFactory()
           
 AppSession getNewSession(java.lang.String sessionId, java.lang.Class<? extends AppSession> aClass, ApplicationId applicationId, java.lang.Object[] args)
           
 ServerCxDxSessionListener getServerSessionListener()
          Get stack wide listener for sessions.
 AppSession getSession(java.lang.String sessionId, java.lang.Class<? extends AppSession> aClass)
           
 StateChangeListener<AppSession> getStateListener()
           
 void setClientSessionListener(ClientCxDxSessionListener clientSessionListener)
          Set stack wide listener for sessions.
 void setMessageFactory(ICxDxMessageFactory messageFactory)
           
 void setServerSessionListener(ServerCxDxSessionListener serverSessionListener)
          Set stack wide listener for sessions.
 void setStateListener(StateChangeListener<AppSession> stateListener)
           
 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

sessionFactory

protected ISessionFactory sessionFactory

clientSessionListener

protected ClientCxDxSessionListener clientSessionListener

serverSessionListener

protected ServerCxDxSessionListener serverSessionListener

messageFactory

protected ICxDxMessageFactory messageFactory

stateListener

protected StateChangeListener<AppSession> stateListener

iss

protected ISessionDatasource iss

sessionDataFactory

protected IAppSessionDataFactory<ICxDxSessionData> sessionDataFactory
Constructor Detail

CxDxSessionFactoryImpl

public CxDxSessionFactoryImpl(SessionFactory sessionFactory)
Method Detail

getClientSessionListener

public ClientCxDxSessionListener getClientSessionListener()
Description copied from interface: ICxDxSessionFactory
Get stack wide listener for sessions. In local mode it has similar effect as setting this directly in app session. However clustered session use this value when recreated!

Specified by:
getClientSessionListener in interface ICxDxSessionFactory
Returns:
the clientSessionListener

setClientSessionListener

public void setClientSessionListener(ClientCxDxSessionListener clientSessionListener)
Description copied from interface: ICxDxSessionFactory
Set stack wide listener for sessions. In local mode it has similar effect as setting this directly in app session. However clustered session use this value when recreated!

Specified by:
setClientSessionListener in interface ICxDxSessionFactory
Parameters:
clientSessionListener - the clientSessionListener to set

getServerSessionListener

public ServerCxDxSessionListener getServerSessionListener()
Description copied from interface: ICxDxSessionFactory
Get stack wide listener for sessions. In local mode it has similar effect as setting this directly in app session. However clustered session use this value when recreated!

Specified by:
getServerSessionListener in interface ICxDxSessionFactory
Returns:
the serverSessionListener

setServerSessionListener

public void setServerSessionListener(ServerCxDxSessionListener serverSessionListener)
Description copied from interface: ICxDxSessionFactory
Set stack wide listener for sessions. In local mode it has similar effect as setting this directly in app session. However clustered session use this value when recreated!

Specified by:
setServerSessionListener in interface ICxDxSessionFactory
Parameters:
serverSessionListener - the serverSessionListener to set

getMessageFactory

public ICxDxMessageFactory getMessageFactory()
Specified by:
getMessageFactory in interface ICxDxSessionFactory
Returns:
the messageFactory

setMessageFactory

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

getStateListener

public StateChangeListener<AppSession> getStateListener()
Specified by:
getStateListener in interface ICxDxSessionFactory
Returns:
the stateListener

setStateListener

public void setStateListener(StateChangeListener<AppSession> stateListener)
Specified by:
setStateListener in interface ICxDxSessionFactory
Parameters:
stateListener - the stateListener to set

getSession

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

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

createLocationInfoAnswer

public JLocationInfoAnswer createLocationInfoAnswer(Answer answer)
Description copied from interface: ICxDxMessageFactory
Creates a Location-Info-Answer event.

Specified by:
createLocationInfoAnswer in interface ICxDxMessageFactory
Parameters:
answer - the answer to create the LIA from
Returns:
an AppAnswerEvent wrapping the LIA

createLocationInfoRequest

public JLocationInfoRequest createLocationInfoRequest(Request request)
Description copied from interface: ICxDxMessageFactory
Creates a Location-Info-Request event.

Specified by:
createLocationInfoRequest in interface ICxDxMessageFactory
Parameters:
request - the request to create the LIR from
Returns:
an AppRequestEvent wrapping the LIR

createMultimediaAuthAnswer

public JMultimediaAuthAnswer createMultimediaAuthAnswer(Answer answer)
Description copied from interface: ICxDxMessageFactory
Creates a Multimedia-Auth-Answer event.

Specified by:
createMultimediaAuthAnswer in interface ICxDxMessageFactory
Parameters:
answer - the answer to create the MAA from
Returns:
an AppAnswerEvent wrapping the MAA

createMultimediaAuthRequest

public JMultimediaAuthRequest createMultimediaAuthRequest(Request request)
Description copied from interface: ICxDxMessageFactory
Creates a Multimedia-Auth-Request event.

Specified by:
createMultimediaAuthRequest in interface ICxDxMessageFactory
Parameters:
request - the request to create the MAR from
Returns:
an AppRequestEvent wrapping the MAR

createPushProfileAnswer

public JPushProfileAnswer createPushProfileAnswer(Answer answer)
Description copied from interface: ICxDxMessageFactory
Creates a Push-Profile-Answer event.

Specified by:
createPushProfileAnswer in interface ICxDxMessageFactory
Parameters:
answer - the answer to create the PPA from
Returns:
an AppAnswerEvent wrapping the PPA

createPushProfileRequest

public JPushProfileRequest createPushProfileRequest(Request request)
Description copied from interface: ICxDxMessageFactory
Creates a Push-Profile-Request event.

Specified by:
createPushProfileRequest in interface ICxDxMessageFactory
Parameters:
request - the request to create the PPR from
Returns:
an AppRequestEvent wrapping the PPR

createRegistrationTerminationAnswer

public JRegistrationTerminationAnswer createRegistrationTerminationAnswer(Answer answer)
Description copied from interface: ICxDxMessageFactory
Creates a Registration-Termination-Answer event.

Specified by:
createRegistrationTerminationAnswer in interface ICxDxMessageFactory
Parameters:
answer - the answer to create the RTA from
Returns:
an AppAnswerEvent wrapping the RTA

createRegistrationTerminationRequest

public JRegistrationTerminationRequest createRegistrationTerminationRequest(Request request)
Description copied from interface: ICxDxMessageFactory
Creates a Registration-Termination-Request event.

Specified by:
createRegistrationTerminationRequest in interface ICxDxMessageFactory
Parameters:
request - the request to create the RTR from
Returns:
an AppRequestEvent wrapping the RTR

createServerAssignmentAnswer

public JServerAssignmentAnswer createServerAssignmentAnswer(Answer answer)
Description copied from interface: ICxDxMessageFactory
Creates a Server-Assignment-Answer event.

Specified by:
createServerAssignmentAnswer in interface ICxDxMessageFactory
Parameters:
answer - the answer to create the SAA from
Returns:
an AppAnswerEvent wrapping the SAA

createServerAssignmentRequest

public JServerAssignmentRequest createServerAssignmentRequest(Request request)
Description copied from interface: ICxDxMessageFactory
Creates a Server-Assignment-Request event.

Specified by:
createServerAssignmentRequest in interface ICxDxMessageFactory
Parameters:
request - the request to create the SAR from
Returns:
an AppRequestEvent wrapping the SAR

createUserAuthorizationAnswer

public JUserAuthorizationAnswer createUserAuthorizationAnswer(Answer answer)
Description copied from interface: ICxDxMessageFactory
Creates a User-Authorization-Answer event.

Specified by:
createUserAuthorizationAnswer in interface ICxDxMessageFactory
Parameters:
answer - the answer to create the UAA from
Returns:
an AppAnswerEvent wrapping the UAA

createUserAuthorizationRequest

public JUserAuthorizationRequest createUserAuthorizationRequest(Request request)
Description copied from interface: ICxDxMessageFactory
Creates a User-Authorization-Request event.

Specified by:
createUserAuthorizationRequest in interface ICxDxMessageFactory
Parameters:
request - the request to create the UAR from
Returns:
an AppRequestEvent wrapping the UAR

getApplicationId

public long getApplicationId()
Description copied from interface: ICxDxMessageFactory
Returns the Application-Id that this message factory is related to

Specified by:
getApplicationId in interface ICxDxMessageFactory
Returns:
the Application-Id value

doLocationInformationRequest

public void doLocationInformationRequest(ServerCxDxSession appSession,
                                         JLocationInfoRequest request)
                                  throws InternalException,
                                         IllegalDiameterStateException,
                                         RouteException,
                                         OverloadException
Specified by:
doLocationInformationRequest in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doMultimediaAuthRequest

public void doMultimediaAuthRequest(ServerCxDxSession appSession,
                                    JMultimediaAuthRequest request)
                             throws InternalException,
                                    IllegalDiameterStateException,
                                    RouteException,
                                    OverloadException
Specified by:
doMultimediaAuthRequest in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doOtherEvent

public void doOtherEvent(AppSession appSession,
                         AppRequestEvent request,
                         AppAnswerEvent answer)
                  throws InternalException,
                         IllegalDiameterStateException,
                         RouteException,
                         OverloadException
Specified by:
doOtherEvent in interface ClientCxDxSessionListener
Specified by:
doOtherEvent in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doPushProfileAnswer

public void doPushProfileAnswer(ServerCxDxSession appSession,
                                JPushProfileRequest request,
                                JPushProfileAnswer answer)
                         throws InternalException,
                                IllegalDiameterStateException,
                                RouteException,
                                OverloadException
Specified by:
doPushProfileAnswer in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doRegistrationTerminationAnswer

public void doRegistrationTerminationAnswer(ServerCxDxSession appSession,
                                            JRegistrationTerminationRequest request,
                                            JRegistrationTerminationAnswer answer)
                                     throws InternalException,
                                            IllegalDiameterStateException,
                                            RouteException,
                                            OverloadException
Specified by:
doRegistrationTerminationAnswer in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doServerAssignmentRequest

public void doServerAssignmentRequest(ServerCxDxSession appSession,
                                      JServerAssignmentRequest request)
                               throws InternalException,
                                      IllegalDiameterStateException,
                                      RouteException,
                                      OverloadException
Specified by:
doServerAssignmentRequest in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doUserAuthorizationRequest

public void doUserAuthorizationRequest(ServerCxDxSession appSession,
                                       JUserAuthorizationRequest request)
                                throws InternalException,
                                       IllegalDiameterStateException,
                                       RouteException,
                                       OverloadException
Specified by:
doUserAuthorizationRequest in interface ServerCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doLocationInformationAnswer

public void doLocationInformationAnswer(ClientCxDxSession appSession,
                                        JLocationInfoRequest request,
                                        JLocationInfoAnswer answer)
                                 throws InternalException,
                                        IllegalDiameterStateException,
                                        RouteException,
                                        OverloadException
Specified by:
doLocationInformationAnswer in interface ClientCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doMultimediaAuthAnswer

public void doMultimediaAuthAnswer(ClientCxDxSession appSession,
                                   JMultimediaAuthRequest request,
                                   JMultimediaAuthAnswer answer)
                            throws InternalException,
                                   IllegalDiameterStateException,
                                   RouteException,
                                   OverloadException
Specified by:
doMultimediaAuthAnswer in interface ClientCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doPushProfileRequest

public void doPushProfileRequest(ClientCxDxSession appSession,
                                 JPushProfileRequest request)
                          throws InternalException,
                                 IllegalDiameterStateException,
                                 RouteException,
                                 OverloadException
Specified by:
doPushProfileRequest in interface ClientCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doRegistrationTerminationRequest

public void doRegistrationTerminationRequest(ClientCxDxSession appSession,
                                             JRegistrationTerminationRequest request)
                                      throws InternalException,
                                             IllegalDiameterStateException,
                                             RouteException,
                                             OverloadException
Specified by:
doRegistrationTerminationRequest in interface ClientCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doServerAssignmentAnswer

public void doServerAssignmentAnswer(ClientCxDxSession appSession,
                                     JServerAssignmentRequest request,
                                     JServerAssignmentAnswer answer)
                              throws InternalException,
                                     IllegalDiameterStateException,
                                     RouteException,
                                     OverloadException
Specified by:
doServerAssignmentAnswer in interface ClientCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doUserAuthorizationAnswer

public void doUserAuthorizationAnswer(ClientCxDxSession appSession,
                                      JUserAuthorizationRequest request,
                                      JUserAuthorizationAnswer answer)
                               throws InternalException,
                                      IllegalDiameterStateException,
                                      RouteException,
                                      OverloadException
Specified by:
doUserAuthorizationAnswer in interface ClientCxDxSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

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>


Copyright © 2014. All Rights Reserved.