org.jdiameter.client.impl.app.rf
Class ClientRfSessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.rf.AppRfSessionImpl
          extended by org.jdiameter.client.impl.app.rf.ClientRfSessionImpl
All Implemented Interfaces:
java.io.Serializable, AppSession, StateMachine, BaseSession, EventListener<Request,Answer>, NetworkReqListener, ClientRfSession

public class ClientRfSessionImpl
extends AppRfSessionImpl
implements EventListener<Request,Answer>, ClientRfSession

Client Accounting session implementation

Author:
Bartosz Baranowski , Alexandre Mendonca
See Also:
Serialized Form

Field Summary
protected  AppEvent buffer
           
protected  IClientRfActionContext context
           
static int DELIVER_AND_GRANT
           
protected  java.lang.String destHost
           
protected  java.lang.String destRealm
           
static int GRANT_AND_LOSE
           
protected  ClientRfSessionListener listener
           
protected  ClientRfSessionState state
           
protected static java.lang.String TIMER_NAME_INTERIM
           
protected  java.io.Serializable timerId_interim
           
 
Fields inherited from class org.jdiameter.common.impl.app.rf.AppRfSessionImpl
sendAndStateLock, stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appId, scheduler, session, sessionDataSource, sessionId, sf, timerFacility
 
Constructor Summary
ClientRfSessionImpl(java.lang.String sessionId, ISessionFactory sessionFactory, ClientRfSessionListener clientAccSessionListener, IClientRfActionContext iClientRfActionContext, StateChangeListener<AppSession> stateChangeListener, ApplicationId applicationId)
           
 
Method Summary
protected  boolean checkBufferSpace()
           
protected  Request createInterimRecord()
           
protected  Request createSessionTermRequest()
           
 boolean equals(java.lang.Object obj)
           
<E> E
getState(java.lang.Class<E> eClass)
           
 boolean handleEvent(StateEvent event)
           
 int hashCode()
           
 boolean isReplicable()
           
 boolean isStateless()
           
 void onTimer(java.lang.String timerName)
           
protected  void processInterimIntervalAvp(StateEvent event)
           
 Answer processRequest(Request request)
           
 void receivedSuccessMessage(Request request, Answer answer)
           
 void relink(IContainer stack)
           
 void sendAccountRequest(RfAccountingRequest accountRequest)
           
protected  void setState(IAppSessionState newState)
           
protected  void storeToBuffer(RfAccountingRequest accountRequest)
           
 void timeoutExpired(Request request)
           
 
Methods inherited from class org.jdiameter.common.impl.app.rf.AppRfSessionImpl
addStateChangeNotification, createAccountAnswer, createAccountRequest, 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

DELIVER_AND_GRANT

public static final int DELIVER_AND_GRANT
See Also:
Constant Field Values

GRANT_AND_LOSE

public static final int GRANT_AND_LOSE
See Also:
Constant Field Values

state

protected ClientRfSessionState state

context

protected transient IClientRfActionContext context

listener

protected transient ClientRfSessionListener listener

timerId_interim

protected java.io.Serializable timerId_interim

TIMER_NAME_INTERIM

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

destHost

protected java.lang.String destHost

destRealm

protected java.lang.String destRealm

buffer

protected AppEvent buffer
Constructor Detail

ClientRfSessionImpl

public ClientRfSessionImpl(java.lang.String sessionId,
                           ISessionFactory sessionFactory,
                           ClientRfSessionListener clientAccSessionListener,
                           IClientRfActionContext iClientRfActionContext,
                           StateChangeListener<AppSession> stateChangeListener,
                           ApplicationId applicationId)
Method Detail

sendAccountRequest

public void sendAccountRequest(RfAccountingRequest accountRequest)
                        throws InternalException,
                               java.lang.IllegalStateException,
                               RouteException,
                               OverloadException
Specified by:
sendAccountRequest in interface ClientRfSession
Throws:
InternalException
java.lang.IllegalStateException
RouteException
OverloadException

storeToBuffer

protected void storeToBuffer(RfAccountingRequest accountRequest)

checkBufferSpace

protected boolean checkBufferSpace()

setState

protected void setState(IAppSessionState newState)

isStateless

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

handleEvent

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

processInterimIntervalAvp

protected void processInterimIntervalAvp(StateEvent event)
                                  throws InternalException
Throws:
InternalException

onTimer

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

getState

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

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 AppRfSessionImpl

createInterimRecord

protected Request createInterimRecord()

createSessionTermRequest

protected Request createSessionTermRequest()

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.