org.jdiameter.server.impl.app.rf
Class ServerRfSessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.rf.AppRfSessionImpl
          extended by org.jdiameter.server.impl.app.rf.ServerRfSessionImpl
All Implemented Interfaces:
AppSession, StateMachine, BaseSession, EventListener<Request,Answer>, NetworkReqListener, ServerRfSession

public class ServerRfSessionImpl
extends AppRfSessionImpl
implements EventListener<Request,Answer>, ServerRfSession, NetworkReqListener

Server Accounting session implementation

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

Field Summary
protected  IServerRfActionContext context
           
protected  ServerRfSessionListener listener
           
protected  IServerRfSessionData sessionData
           
protected static java.lang.String TIMER_NAME_TS
           
 
Fields inherited from class org.jdiameter.common.impl.app.rf.AppRfSessionImpl
appId, sendAndStateLock, stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appSessionData, scheduler, session, sessions, sf, timerFacility
 
Constructor Summary
ServerRfSessionImpl(IServerRfSessionData sessionData, ISessionFactory sessionFactory, ServerRfSessionListener serverSessionListener, IServerRfActionContext serverContextListener, StateChangeListener<AppSession> stLst, long tsTimeout, boolean stateless)
           
 
Method Summary
protected  Answer createEventAnswer(Request request)
           
protected  Answer createInterimAnswer(Request request)
           
protected  Answer createStartAnswer(Request request)
           
protected  Answer createStopAnswer(Request request)
           
<E> E
getState(java.lang.Class<E> eClass)
           
 boolean handleEvent(StateEvent event)
           
 boolean handleEventForStatefulMode(StateEvent event)
           
 boolean handleEventForStatelessMode(StateEvent event)
           
 boolean isReplicable()
           
 boolean isStateless()
           
 void onTimer(java.lang.String timerName)
           
 Answer processRequest(Request request)
           
 void receivedSuccessMessage(Request request, Answer answer)
           
 void release()
           
 void sendAccountAnswer(RfAccountingAnswer accountAnswer)
           
protected  void setState(IAppSessionState newState)
           
 void timeoutExpired(Request request)
           
 
Methods inherited from class org.jdiameter.common.impl.app.rf.AppRfSessionImpl
addStateChangeNotification, createAccountAnswer, createAccountRequest, 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

context

protected transient IServerRfActionContext context

listener

protected transient ServerRfSessionListener listener

TIMER_NAME_TS

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

sessionData

protected IServerRfSessionData sessionData
Constructor Detail

ServerRfSessionImpl

public ServerRfSessionImpl(IServerRfSessionData sessionData,
                           ISessionFactory sessionFactory,
                           ServerRfSessionListener serverSessionListener,
                           IServerRfActionContext serverContextListener,
                           StateChangeListener<AppSession> stLst,
                           long tsTimeout,
                           boolean stateless)
Method Detail

sendAccountAnswer

public void sendAccountAnswer(RfAccountingAnswer accountAnswer)
                       throws InternalException,
                              java.lang.IllegalStateException,
                              RouteException,
                              OverloadException
Specified by:
sendAccountAnswer in interface ServerRfSession
Throws:
InternalException
java.lang.IllegalStateException
RouteException
OverloadException

isStateless

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

setState

protected void setState(IAppSessionState newState)

handleEvent

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

handleEventForStatelessMode

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

handleEventForStatefulMode

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

onTimer

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

createStopAnswer

protected Answer createStopAnswer(Request request)

createInterimAnswer

protected Answer createInterimAnswer(Request request)

createEventAnswer

protected Answer createEventAnswer(Request request)

createStartAnswer

protected Answer createStartAnswer(Request request)

getState

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

processRequest

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

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>

isReplicable

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

release

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


Copyright © 2014. All Rights Reserved.