org.jdiameter.common.impl.app.auth
Class AuthSessionFactoryImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.auth.AuthSessionFactoryImpl
All Implemented Interfaces:
StateChangeListener<AppSession>, ClientAuthSessionListener, ServerAuthSessionListener, IAuthMessageFactory, IAuthSessionFactory, IClientAuthActionContext, IServerAuthActionContext, IAppSessionFactory

public class AuthSessionFactoryImpl
extends java.lang.Object
implements IAuthSessionFactory, IAuthMessageFactory, ServerAuthSessionListener, ClientAuthSessionListener, IClientAuthActionContext, IServerAuthActionContext, StateChangeListener<AppSession>

Default Diameter Authorization Session Factory implementation

Author:
Bartosz Baranowski , Alexandre Mendonca

Field Summary
protected  IClientAuthActionContext clientSessionContext
           
protected  ClientAuthSessionListener clientSessionListener
           
protected  ISessionDatasource iss
           
protected  org.slf4j.Logger logger
           
protected  IAuthMessageFactory messageFactory
           
protected  long messageTimeout
           
protected  IServerAuthActionContext serverSessionContext
           
protected  ServerAuthSessionListener serverSessionListener
           
protected  IAppSessionDataFactory<IAuthSessionData> sessionDataFactory
           
protected  ISessionFactory sessionFactory
           
protected  boolean stateles
           
protected  StateChangeListener<AppSession> stateListener
           
 
Constructor Summary
AuthSessionFactoryImpl(SessionFactory sessionFactory)
           
 
Method Summary
 void accessTimeoutElapses(ClientAuthSession session)
           
 void accessTimeoutElapses(ServerAuthSession session)
           
 AppAnswerEvent createAuthAnswer(Answer answer)
           
 AppRequestEvent createAuthRequest(Request request)
           
 void disconnectUserOrDev(ClientAuthSession session, Message request)
           
 void doAbortSessionAnswerEvent(ServerAuthSession appSession, AbortSessionAnswer asa)
           
 void doAbortSessionRequestEvent(ClientAuthSession appSession, AbortSessionRequest asr)
           
 void doAuthAnswerEvent(ClientAuthSession appSession, AppRequestEvent request, AppAnswerEvent answer)
           
 void doAuthRequestEvent(ServerAuthSession appSession, AppRequestEvent request)
           
 void doOtherEvent(AppSession appSession, AppRequestEvent request, AppAnswerEvent answer)
           
 void doReAuthAnswerEvent(ServerAuthSession appSession, ReAuthRequest rar, ReAuthAnswer raa)
           
 void doReAuthRequestEvent(ClientAuthSession appSession, ReAuthRequest rar)
           
 void doSessionTerminationAnswerEvent(ClientAuthSession appSession, SessionTermAnswer sta)
           
 void doSessionTerminationRequestEvent(ServerAuthSession appSession, SessionTermRequest str)
           
 long getAccessTimeout()
           
 ApplicationId getApplicationId()
           
 int getAuthMessageCommandCode()
           
 IClientAuthActionContext getClientSessionContext()
           
 ClientAuthSessionListener getClientSessionListener()
           
 IAuthMessageFactory getMessageFactory()
           
 long getMessageTimeout()
           
 AppSession getNewSession(java.lang.String sessionId, java.lang.Class<? extends AppSession> aClass, ApplicationId applicationId, java.lang.Object[] args)
           
 IServerAuthActionContext getServerSessionContext()
           
 ServerAuthSessionListener getServerSessionListener()
           
 AppSession getSession(java.lang.String sessionId, java.lang.Class<? extends AppSession> aClass)
           
 StateChangeListener<AppSession> getStateListener()
           
 boolean isStateles()
           
 void setClientSessionContext(IClientAuthActionContext clientSessionContext)
           
 void setClientSessionListener(ClientAuthSessionListener clientSessionListener)
           
 void setMessageFactory(IAuthMessageFactory messageFactory)
           
 void setMessageTimeout(long messageTimeout)
           
 void setServerSessionContext(IServerAuthActionContext serverSessionContext)
           
 void setServerSessionListener(ServerAuthSessionListener serverSessionListener)
           
 void setStateles(boolean stateles)
           
 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

messageFactory

protected IAuthMessageFactory messageFactory

serverSessionListener

protected ServerAuthSessionListener serverSessionListener

stateListener

protected StateChangeListener<AppSession> stateListener

clientSessionListener

protected ClientAuthSessionListener clientSessionListener

stateles

protected boolean stateles

messageTimeout

protected long messageTimeout

logger

protected org.slf4j.Logger logger

iss

protected ISessionDatasource iss

sessionFactory

protected ISessionFactory sessionFactory

serverSessionContext

protected IServerAuthActionContext serverSessionContext

clientSessionContext

protected IClientAuthActionContext clientSessionContext

sessionDataFactory

protected IAppSessionDataFactory<IAuthSessionData> sessionDataFactory
Constructor Detail

AuthSessionFactoryImpl

public AuthSessionFactoryImpl(SessionFactory sessionFactory)
Method Detail

getClientSessionContext

public IClientAuthActionContext getClientSessionContext()
Specified by:
getClientSessionContext in interface IAuthSessionFactory
Returns:
the clientSessionContext

setClientSessionContext

public void setClientSessionContext(IClientAuthActionContext clientSessionContext)
Specified by:
setClientSessionContext in interface IAuthSessionFactory
Parameters:
clientSessionContext - the clientSessionContext to set

getServerSessionContext

public IServerAuthActionContext getServerSessionContext()
Specified by:
getServerSessionContext in interface IAuthSessionFactory
Returns:
the serverSessionContext

setServerSessionContext

public void setServerSessionContext(IServerAuthActionContext serverSessionContext)
Specified by:
setServerSessionContext in interface IAuthSessionFactory
Parameters:
serverSessionContext - the serverSessionContext to set

getMessageTimeout

public long getMessageTimeout()
Specified by:
getMessageTimeout in interface IAuthSessionFactory
Returns:
the messageTimeout

setMessageTimeout

public void setMessageTimeout(long messageTimeout)
Specified by:
setMessageTimeout in interface IAuthSessionFactory
Parameters:
messageTimeout - the messageTimeout to set

getMessageFactory

public IAuthMessageFactory getMessageFactory()
Specified by:
getMessageFactory in interface IAuthSessionFactory
Returns:
the messageFactory

setMessageFactory

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

getServerSessionListener

public ServerAuthSessionListener getServerSessionListener()
Specified by:
getServerSessionListener in interface IAuthSessionFactory
Returns:
the serverSessionListener

setServerSessionListener

public void setServerSessionListener(ServerAuthSessionListener serverSessionListener)
Specified by:
setServerSessionListener in interface IAuthSessionFactory
Parameters:
serverSessionListener - the serverSessionListener to set

getStateListener

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

setStateListener

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

getClientSessionListener

public ClientAuthSessionListener getClientSessionListener()
Specified by:
getClientSessionListener in interface IAuthSessionFactory
Returns:
the clientSessionListener

setClientSessionListener

public void setClientSessionListener(ClientAuthSessionListener clientSessionListener)
Specified by:
setClientSessionListener in interface IAuthSessionFactory
Parameters:
clientSessionListener - the clientSessionListener to set

isStateles

public boolean isStateles()
Specified by:
isStateles in interface IAuthSessionFactory

setStateles

public void setStateles(boolean stateles)
Specified by:
setStateles in interface IAuthSessionFactory

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

createAuthAnswer

public AppAnswerEvent createAuthAnswer(Answer answer)
Specified by:
createAuthAnswer in interface IAuthMessageFactory

createAuthRequest

public AppRequestEvent createAuthRequest(Request request)
Specified by:
createAuthRequest in interface IAuthMessageFactory

getAuthMessageCommandCode

public int getAuthMessageCommandCode()
Specified by:
getAuthMessageCommandCode in interface IAuthMessageFactory

getApplicationId

public ApplicationId getApplicationId()
Specified by:
getApplicationId in interface IAuthMessageFactory

doAbortSessionRequestEvent

public void doAbortSessionRequestEvent(ClientAuthSession appSession,
                                       AbortSessionRequest asr)
                                throws InternalException,
                                       IllegalDiameterStateException,
                                       RouteException,
                                       OverloadException
Specified by:
doAbortSessionRequestEvent in interface ClientAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doAbortSessionAnswerEvent

public void doAbortSessionAnswerEvent(ServerAuthSession appSession,
                                      AbortSessionAnswer asa)
                               throws InternalException,
                                      IllegalDiameterStateException,
                                      RouteException,
                                      OverloadException
Specified by:
doAbortSessionAnswerEvent in interface ServerAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doSessionTerminationRequestEvent

public void doSessionTerminationRequestEvent(ServerAuthSession appSession,
                                             SessionTermRequest str)
                                      throws InternalException,
                                             IllegalDiameterStateException,
                                             RouteException,
                                             OverloadException
Specified by:
doSessionTerminationRequestEvent in interface ServerAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doSessionTerminationAnswerEvent

public void doSessionTerminationAnswerEvent(ClientAuthSession appSession,
                                            SessionTermAnswer sta)
                                     throws InternalException,
                                            IllegalDiameterStateException,
                                            RouteException,
                                            OverloadException
Specified by:
doSessionTerminationAnswerEvent in interface ClientAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doAuthRequestEvent

public void doAuthRequestEvent(ServerAuthSession appSession,
                               AppRequestEvent request)
                        throws InternalException,
                               IllegalDiameterStateException,
                               RouteException,
                               OverloadException
Specified by:
doAuthRequestEvent in interface ServerAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doAuthAnswerEvent

public void doAuthAnswerEvent(ClientAuthSession appSession,
                              AppRequestEvent request,
                              AppAnswerEvent answer)
                       throws InternalException,
                              IllegalDiameterStateException,
                              RouteException,
                              OverloadException
Specified by:
doAuthAnswerEvent in interface ClientAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doReAuthRequestEvent

public void doReAuthRequestEvent(ClientAuthSession appSession,
                                 ReAuthRequest rar)
                          throws InternalException,
                                 IllegalDiameterStateException,
                                 RouteException,
                                 OverloadException
Specified by:
doReAuthRequestEvent in interface ClientAuthSessionListener
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

doReAuthAnswerEvent

public void doReAuthAnswerEvent(ServerAuthSession appSession,
                                ReAuthRequest rar,
                                ReAuthAnswer raa)
                         throws InternalException,
                                IllegalDiameterStateException,
                                RouteException,
                                OverloadException
Specified by:
doReAuthAnswerEvent in interface ServerAuthSessionListener
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 ClientAuthSessionListener
Specified by:
doOtherEvent in interface ServerAuthSessionListener
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>

accessTimeoutElapses

public void accessTimeoutElapses(ClientAuthSession session)
                          throws InternalException
Specified by:
accessTimeoutElapses in interface IClientAuthActionContext
Throws:
InternalException

getAccessTimeout

public long getAccessTimeout()
                      throws InternalException
Specified by:
getAccessTimeout in interface IClientAuthActionContext
Specified by:
getAccessTimeout in interface IServerAuthActionContext
Throws:
InternalException

disconnectUserOrDev

public void disconnectUserOrDev(ClientAuthSession session,
                                Message request)
                         throws InternalException
Specified by:
disconnectUserOrDev in interface IClientAuthActionContext
Throws:
InternalException

accessTimeoutElapses

public void accessTimeoutElapses(ServerAuthSession session)
                          throws InternalException
Specified by:
accessTimeoutElapses in interface IServerAuthActionContext
Throws:
InternalException


Copyright © 2014. All Rights Reserved.