org.jdiameter.client.impl.app.acc
Class ClientAccSessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.acc.AppAccSessionImpl
          extended by org.jdiameter.client.impl.app.acc.ClientAccSessionImpl
All Implemented Interfaces:
ClientAccSession, AppSession, StateMachine, BaseSession, EventListener<Request,Answer>, NetworkReqListener

public class ClientAccSessionImpl
extends AppAccSessionImpl
implements EventListener<Request,Answer>, ClientAccSession

Client Accounting session implementation

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

Field Summary
protected  IClientAccActionContext context
           
static int DELIVER_AND_GRANT
           
static int GRANT_AND_LOSE
           
protected  ClientAccSessionListener listener
           
protected  IClientAccSessionData sessionData
           
protected static java.lang.String TIMER_NAME_INTERIM
           
 
Fields inherited from class org.jdiameter.common.impl.app.acc.AppAccSessionImpl
sendAndStateLock, stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appSessionData, scheduler, session, sessions, sf, timerFacility
 
Constructor Summary
ClientAccSessionImpl(IClientAccSessionData sessionData, ISessionFactory sessionFactory, ClientAccSessionListener clientAccSessionListener, IClientAccActionContext iClientAccActionContext, StateChangeListener<AppSession> stateChangeListener)
           
 
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 release()
           
 void sendAccountRequest(AccountRequest accountRequest)
           
protected  void setState(IAppSessionState newState)
           
protected  void storeToBuffer(Request accountRequest)
           
 void timeoutExpired(Request request)
           
 
Methods inherited from class org.jdiameter.common.impl.app.acc.AppAccSessionImpl
addStateChangeNotification, createAccountAnswer, createAccountRequest, 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
 
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

context

protected IClientAccActionContext context

listener

protected ClientAccSessionListener listener

TIMER_NAME_INTERIM

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

sessionData

protected IClientAccSessionData sessionData
Constructor Detail

ClientAccSessionImpl

public ClientAccSessionImpl(IClientAccSessionData sessionData,
                            ISessionFactory sessionFactory,
                            ClientAccSessionListener clientAccSessionListener,
                            IClientAccActionContext iClientAccActionContext,
                            StateChangeListener<AppSession> stateChangeListener)
Method Detail

sendAccountRequest

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

storeToBuffer

protected void storeToBuffer(Request 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)
Specified by:
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

createInterimRecord

protected Request createInterimRecord()

createSessionTermRequest

protected Request createSessionTermRequest()

hashCode

public int hashCode()
Overrides:
hashCode in class AppSessionImpl

equals

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

release

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


Copyright © 2014. All Rights Reserved.