org.jdiameter.client.impl.app.gq
Class GqClientSessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.auth.AppAuthSessionImpl
          extended by org.jdiameter.client.impl.app.gq.GqClientSessionImpl
All Implemented Interfaces:
AppSession, StateMachine, ClientAuthSession, BaseSession, EventListener<Request,Answer>, GqClientSession, NetworkReqListener

public class GqClientSessionImpl
extends AppAuthSessionImpl
implements GqClientSession, EventListener<Request,Answer>, NetworkReqListener

Client Gq Application session implementation

Author:
Yulian Oifa , Alexandre Mendonca , Bartosz Baranowski

Field Summary
protected  IClientAuthActionContext context
           
protected  IAuthMessageFactory factory
           
protected  ClientAuthSessionListener listener
           
protected static org.slf4j.Logger logger
           
protected  java.util.concurrent.locks.Lock sendAndStateLock
           
protected  IClientAuthSessionData 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
GqClientSessionImpl(IClientAuthSessionData sessionData, ISessionFactory sf, ClientAuthSessionListener lst, IAuthMessageFactory fct, StateChangeListener<AppSession> scListener, IClientAuthActionContext context, boolean stateless)
           
 
Method Summary
protected  void cancelTsTimer()
           
protected  AbortSessionAnswer createAbortSessionAnswer(Answer answer)
           
protected  AbortSessionRequest createAbortSessionRequest(Request request)
           
protected  ReAuthAnswer createReAuthAnswer(Answer answer)
           
protected  ReAuthRequest createReAuthRequest(Request request)
           
protected  SessionTermAnswer createSessionTermAnswer(Answer answer)
           
protected  Request createSessionTermRequest()
           
protected  SessionTermRequest createSessionTermRequest(Request request)
           
 boolean equals(java.lang.Object obj)
           
<E> E
getState(java.lang.Class<E> eClass)
           
 boolean handleEvent(StateEvent event)
           
 boolean handleEventForStatefulSession(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)
           
protected  void send(org.jdiameter.client.impl.app.gq.Event.Type type, AppEvent event)
           
 void sendAbortSessionAnswer(AbortSessionAnswer answer)
           
 void sendAuthRequest(AppRequestEvent request)
           
 void sendReAuthAnswer(ReAuthAnswer answer)
           
 void sendSessionTerminationRequest(SessionTermRequest request)
           
protected  void setState(ClientAuthSessionState 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

sendAndStateLock

protected java.util.concurrent.locks.Lock sendAndStateLock

factory

protected transient IAuthMessageFactory factory

context

protected transient IClientAuthActionContext context

listener

protected transient ClientAuthSessionListener listener

TIMER_NAME_TS

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

sessionData

protected IClientAuthSessionData sessionData
Constructor Detail

GqClientSessionImpl

public GqClientSessionImpl(IClientAuthSessionData sessionData,
                           ISessionFactory sf,
                           ClientAuthSessionListener lst,
                           IAuthMessageFactory fct,
                           StateChangeListener<AppSession> scListener,
                           IClientAuthActionContext context,
                           boolean stateless)
Method Detail

sendAbortSessionAnswer

public void sendAbortSessionAnswer(AbortSessionAnswer answer)
                            throws InternalException,
                                   IllegalDiameterStateException,
                                   RouteException,
                                   OverloadException
Specified by:
sendAbortSessionAnswer in interface ClientAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendAuthRequest

public void sendAuthRequest(AppRequestEvent request)
                     throws InternalException,
                            IllegalDiameterStateException,
                            RouteException,
                            OverloadException
Specified by:
sendAuthRequest in interface ClientAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendReAuthAnswer

public void sendReAuthAnswer(ReAuthAnswer answer)
                      throws InternalException,
                             IllegalDiameterStateException,
                             RouteException,
                             OverloadException
Specified by:
sendReAuthAnswer in interface ClientAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendSessionTerminationRequest

public void sendSessionTerminationRequest(SessionTermRequest request)
                                   throws InternalException,
                                          IllegalDiameterStateException,
                                          RouteException,
                                          OverloadException
Specified by:
sendSessionTerminationRequest in interface ClientAuthSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

send

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

isStateless

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

setState

protected void setState(ClientAuthSessionState 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

handleEventForStatefulSession

public boolean handleEventForStatefulSession(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()
                     throws java.lang.IllegalArgumentException,
                            InternalException
Throws:
java.lang.IllegalArgumentException
InternalException

cancelTsTimer

protected void cancelTsTimer()

onTimer

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

createAbortSessionAnswer

protected AbortSessionAnswer createAbortSessionAnswer(Answer answer)

createAbortSessionRequest

protected AbortSessionRequest createAbortSessionRequest(Request request)

createReAuthAnswer

protected ReAuthAnswer createReAuthAnswer(Answer answer)

createReAuthRequest

protected ReAuthRequest createReAuthRequest(Request request)

createSessionTermAnswer

protected SessionTermAnswer createSessionTermAnswer(Answer answer)

createSessionTermRequest

protected SessionTermRequest createSessionTermRequest(Request request)

createSessionTermRequest

protected Request createSessionTermRequest()

hashCode

public int hashCode()
Overrides:
hashCode in class AppAuthSessionImpl

equals

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


Copyright © 2014. All Rights Reserved.