org.jdiameter.server.impl.app.auth
Class ServerAuthSessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.auth.AppAuthSessionImpl
          extended by org.jdiameter.server.impl.app.auth.ServerAuthSessionImpl
All Implemented Interfaces:
AppSession, StateMachine, ServerAuthSession, BaseSession, EventListener<Request,Answer>, NetworkReqListener

public class ServerAuthSessionImpl
extends AppAuthSessionImpl
implements ServerAuthSession, EventListener<Request,Answer>, NetworkReqListener

Server Authorization session implementation

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

Field Summary
protected  IServerAuthActionContext context
           
protected  IAuthMessageFactory factory
           
protected  ServerAuthSessionListener listener
           
protected static org.slf4j.Logger logger
           
protected  IServerAuthSessionData sessionData
           
protected static java.lang.String TIMER_NAME_TS
           
 
Fields inherited from class org.jdiameter.common.impl.app.auth.AppAuthSessionImpl
appId, stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appSessionData, scheduler, session, sessions, sf, timerFacility
 
Constructor Summary
ServerAuthSessionImpl(IServerAuthSessionData sessionData, ISessionFactory sf, ServerAuthSessionListener lst, IAuthMessageFactory fct, StateChangeListener<AppSession> scListener, IServerAuthActionContext context, long tsTimeout, boolean stateless)
           
 
Method Summary
protected  void cancelTsTimer()
           
 boolean equals(java.lang.Object obj)
           
<E> E
getState(java.lang.Class<E> eClass)
           
 boolean handleEvent(StateEvent event)
           
 boolean handleEventForStatefullSession(StateEvent event)
           
 boolean handleEventForStatelessSession(StateEvent event)
           
 int hashCode()
           
 boolean isReplicable()
           
 boolean isStateless()
           
 void onTimer(java.lang.String timerName)
           
 Answer processRequest(Request request)
           
 void receivedSuccessMessage(Request request, Answer answer)
           
 void release()
           
protected  void send(org.jdiameter.server.impl.app.auth.Event.Type type, AppEvent event)
           
 void sendAbortSessionRequest(AbortSessionRequest abortSessionRequest)
           
 void sendAuthAnswer(AppAnswerEvent appAnswerEvent)
           
 void sendReAuthRequest(ReAuthRequest reAuthRequest)
           
 void sendSessionTerminationAnswer(SessionTermAnswer sessionTermAnswer)
           
protected  void setState(ServerAuthSessionState newState)
           
protected  void startTsTimer()
           
 void timeoutExpired(Request request)
           
 
Methods inherited from class org.jdiameter.common.impl.app.auth.AppAuthSessionImpl
addStateChangeNotification, removeStateChangeNotification
 
Methods inherited from class org.jdiameter.common.impl.app.AppSessionImpl
getCreationTime, getLastAccessedTime, getSessionAppId, getSessionId, getSessions, isAppSession, isValid
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jdiameter.api.app.AppSession
getSessionAppId, getSessions
 
Methods inherited from interface org.jdiameter.api.BaseSession
getCreationTime, getLastAccessedTime, getSessionId, isAppSession, isValid
 
Methods inherited from interface org.jdiameter.api.app.StateMachine
addStateChangeNotification, removeStateChangeNotification
 

Field Detail

logger

protected static final org.slf4j.Logger logger

sessionData

protected IServerAuthSessionData sessionData

factory

protected transient IAuthMessageFactory factory

context

protected transient IServerAuthActionContext context

listener

protected transient ServerAuthSessionListener listener

TIMER_NAME_TS

protected static final java.lang.String TIMER_NAME_TS
See Also:
Constant Field Values
Constructor Detail

ServerAuthSessionImpl

public ServerAuthSessionImpl(IServerAuthSessionData sessionData,
                             ISessionFactory sf,
                             ServerAuthSessionListener lst,
                             IAuthMessageFactory fct,
                             StateChangeListener<AppSession> scListener,
                             IServerAuthActionContext context,
                             long tsTimeout,
                             boolean stateless)
Method Detail

sendAuthAnswer

public void sendAuthAnswer(AppAnswerEvent appAnswerEvent)
                    throws InternalException,
                           IllegalDiameterStateException,
                           RouteException,
                           OverloadException
Specified by:
sendAuthAnswer in interface ServerAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendReAuthRequest

public void sendReAuthRequest(ReAuthRequest reAuthRequest)
                       throws InternalException,
                              IllegalDiameterStateException,
                              RouteException,
                              OverloadException
Specified by:
sendReAuthRequest in interface ServerAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendAbortSessionRequest

public void sendAbortSessionRequest(AbortSessionRequest abortSessionRequest)
                             throws InternalException,
                                    IllegalDiameterStateException,
                                    RouteException,
                                    OverloadException
Specified by:
sendAbortSessionRequest in interface ServerAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendSessionTerminationAnswer

public void sendSessionTerminationAnswer(SessionTermAnswer sessionTermAnswer)
                                  throws InternalException,
                                         IllegalDiameterStateException,
                                         RouteException,
                                         OverloadException
Specified by:
sendSessionTerminationAnswer in interface ServerAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

send

protected void send(org.jdiameter.server.impl.app.auth.Event.Type type,
                    AppEvent event)
             throws InternalException
Throws:
InternalException

isStateless

public boolean isStateless()
Specified by:
isStateless in interface AppSession

setState

protected void setState(ServerAuthSessionState newState)

getState

public <E> E getState(java.lang.Class<E> eClass)
Specified by:
getState in interface StateMachine

handleEvent

public boolean handleEvent(StateEvent event)
                    throws InternalException,
                           OverloadException
Specified by:
handleEvent in interface StateMachine
Throws:
InternalException
OverloadException

handleEventForStatelessSession

public boolean handleEventForStatelessSession(StateEvent event)
                                       throws InternalException,
                                              OverloadException
Throws:
InternalException
OverloadException

handleEventForStatefullSession

public boolean handleEventForStatefullSession(StateEvent event)
                                       throws InternalException,
                                              OverloadException
Throws:
InternalException
OverloadException

receivedSuccessMessage

public void receivedSuccessMessage(Request request,
                                   Answer answer)
Specified by:
receivedSuccessMessage in interface EventListener<Request,Answer>

timeoutExpired

public void timeoutExpired(Request request)
Specified by:
timeoutExpired in interface EventListener<Request,Answer>

processRequest

public Answer processRequest(Request request)
Specified by:
processRequest in interface NetworkReqListener

isReplicable

public boolean isReplicable()
Specified by:
isReplicable in interface BaseSession
Overrides:
isReplicable in class AppSessionImpl

startTsTimer

protected void startTsTimer()

cancelTsTimer

protected void cancelTsTimer()

onTimer

public void onTimer(java.lang.String timerName)
Specified by:
onTimer in class AppSessionImpl

hashCode

public int hashCode()
Overrides:
hashCode in class AppAuthSessionImpl

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AppAuthSessionImpl

release

public void release()
Specified by:
release in interface BaseSession
Overrides:
release in class AppAuthSessionImpl


Copyright © 2014. All Rights Reserved.