org.jdiameter.client.impl.app.auth
Class ClientAuthSessionImpl

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.auth.ClientAuthSessionImpl
All Implemented Interfaces:
java.io.Serializable, AppSession, StateMachine, ClientAuthSession, BaseSession, EventListener<Request,Answer>, NetworkReqListener

public class ClientAuthSessionImpl
extends AppAuthSessionImpl
implements ClientAuthSession, EventListener<Request,Answer>, NetworkReqListener

Client Authorization session implementation

Author:
erick.svenson@yahoo.com, Bartosz Baranowski , Alexandre Mendonca
See Also:
Serialized Form

Field Summary
protected  IClientAuthActionContext context
           
protected  java.lang.String destHost
           
protected  java.lang.String destRealm
           
protected  IAuthMessageFactory factory
           
protected  ClientAuthSessionListener listener
           
protected static org.slf4j.Logger logger
           
protected  java.util.concurrent.locks.Lock sendAndStateLock
           
protected  ClientAuthSessionState state
           
protected  boolean stateless
           
protected static java.lang.String TIMER_NAME_TS
           
protected  java.io.Serializable timerId_ts
           
 
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
ClientAuthSessionImpl(java.lang.String sessionId, SessionFactory 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)
           
 void relink(IContainer stack)
           
protected  void send(org.jdiameter.client.impl.app.auth.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

stateless

protected boolean stateless

state

protected ClientAuthSessionState state

sendAndStateLock

protected java.util.concurrent.locks.Lock sendAndStateLock

factory

protected transient IAuthMessageFactory factory

context

protected transient IClientAuthActionContext context

listener

protected transient ClientAuthSessionListener listener

destHost

protected java.lang.String destHost

destRealm

protected java.lang.String destRealm

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

ClientAuthSessionImpl

public ClientAuthSessionImpl(java.lang.String sessionId,
                             SessionFactory 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.auth.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

relink

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

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)
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

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()


Copyright © 2010. All Rights Reserved.