org.jdiameter.client.impl.app.sh
Class ShClientSessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.sh.ShSession
          extended by org.jdiameter.client.impl.app.sh.ShClientSessionImpl
All Implemented Interfaces:
AppSession, StateMachine, BaseSession, EventListener<Request,Answer>, NetworkReqListener, ClientShSession

public class ShClientSessionImpl
extends ShSession
implements ClientShSession, EventListener<Request,Answer>, NetworkReqListener

Basic implementation of ShClientSession - can be one time - for UDR,PUR and constant for SNR-PNR pair, in case when SNA contains response code from range different than 2001-2004(success codes) user is responsible for maintaing state - releasing etc, same goes if result code is contained Experimental-Result AVP
If ShSession moves to ShSessionState.TERMINATED - it means that no further messages can be received via it and it should be discarded.

Author:
Bartosz Baranowski , Alexandre Mendonca

Field Summary
protected  IShMessageFactory factory
           
protected  ClientShSessionListener listener
           
protected  java.util.concurrent.locks.Lock sendAndStateLock
           
protected  IShClientSessionData sessionData
           
 
Fields inherited from class org.jdiameter.common.impl.app.sh.ShSession
stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appSessionData, scheduler, session, sessions, sf, timerFacility
 
Constructor Summary
ShClientSessionImpl(IShClientSessionData sessionData, IShMessageFactory fct, ISessionFactory sf, ClientShSessionListener lst)
           
 
Method Summary
<E> E
getState(java.lang.Class<E> stateType)
           
 boolean handleEvent(StateEvent event)
           
 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.client.impl.app.sh.Event.Type type, AppEvent request, AppEvent answer)
           
 void sendProfileUpdateRequest(ProfileUpdateRequest request)
           
 void sendPushNotificationAnswer(PushNotificationAnswer answer)
           
 void sendSubscribeNotificationsRequest(SubscribeNotificationsRequest request)
           
 void sendUserDataRequest(UserDataRequest request)
           
 void timeoutExpired(Request request)
           
 
Methods inherited from class org.jdiameter.common.impl.app.sh.ShSession
addStateChangeNotification, removeStateChangeNotification
 
Methods inherited from class org.jdiameter.common.impl.app.AppSessionImpl
equals, getCreationTime, getLastAccessedTime, getSessionAppId, getSessionId, getSessions, hashCode, 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

sendAndStateLock

protected java.util.concurrent.locks.Lock sendAndStateLock

factory

protected transient IShMessageFactory factory

listener

protected transient ClientShSessionListener listener

sessionData

protected IShClientSessionData sessionData
Constructor Detail

ShClientSessionImpl

public ShClientSessionImpl(IShClientSessionData sessionData,
                           IShMessageFactory fct,
                           ISessionFactory sf,
                           ClientShSessionListener lst)
Method Detail

processRequest

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

getState

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

handleEvent

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

sendProfileUpdateRequest

public void sendProfileUpdateRequest(ProfileUpdateRequest request)
                              throws InternalException,
                                     IllegalDiameterStateException,
                                     RouteException,
                                     OverloadException
Specified by:
sendProfileUpdateRequest in interface ClientShSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendPushNotificationAnswer

public void sendPushNotificationAnswer(PushNotificationAnswer answer)
                                throws InternalException,
                                       IllegalDiameterStateException,
                                       RouteException,
                                       OverloadException
Specified by:
sendPushNotificationAnswer in interface ClientShSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendSubscribeNotificationsRequest

public void sendSubscribeNotificationsRequest(SubscribeNotificationsRequest request)
                                       throws InternalException,
                                              IllegalDiameterStateException,
                                              RouteException,
                                              OverloadException
Specified by:
sendSubscribeNotificationsRequest in interface ClientShSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendUserDataRequest

public void sendUserDataRequest(UserDataRequest request)
                         throws InternalException,
                                IllegalDiameterStateException,
                                RouteException,
                                OverloadException
Specified by:
sendUserDataRequest in interface ClientShSession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

send

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

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>

release

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

isStateless

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

isReplicable

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

onTimer

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


Copyright © 2014. All Rights Reserved.