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:
java.io.Serializable, 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
See Also:
Serialized Form

Field Summary
protected  IServerAuthActionContext context
           
protected  IAuthMessageFactory factory
           
protected  ServerAuthSessionListener listener
           
protected static org.slf4j.Logger logger
           
protected  ServerAuthSessionState state
           
protected  boolean stateless
           
protected static java.lang.String TIMER_NAME_TS
           
protected  java.io.Serializable timerId_ts
           
protected  long tsTimeout
           
 
Fields inherited from class org.jdiameter.common.impl.app.auth.AppAuthSessionImpl
stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appId, scheduler, session, sessionDataSource, sessionId, sf, timerFacility
 
Constructor Summary
ServerAuthSessionImpl(java.lang.String sessionId, SessionFactory sf, Request initialRequest, 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 relink(IContainer stack)
           
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, release, 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, release
 
Methods inherited from interface org.jdiameter.api.app.StateMachine
addStateChangeNotification, removeStateChangeNotification
 

Field Detail

logger

protected static final org.slf4j.Logger logger

stateless

protected boolean stateless

state

protected ServerAuthSessionState state

factory

protected transient IAuthMessageFactory factory

context

protected transient IServerAuthActionContext context

listener

protected transient ServerAuthSessionListener listener

tsTimeout

protected long tsTimeout

timerId_ts

protected java.io.Serializable timerId_ts

TIMER_NAME_TS

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

ServerAuthSessionImpl

public ServerAuthSessionImpl(java.lang.String sessionId,
                             SessionFactory sf,
                             Request initialRequest,
                             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

relink

public void relink(IContainer stack)
Overrides:
relink in class AppAuthSessionImpl

startTsTimer

protected void startTsTimer()

cancelTsTimer

protected void cancelTsTimer()

onTimer

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

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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


Copyright © 2010. All Rights Reserved.