org.jdiameter.server.impl.app.cca
Class ServerCCASessionImpl

java.lang.Object
  extended by org.jdiameter.common.impl.app.AppSessionImpl
      extended by org.jdiameter.common.impl.app.cca.AppCCASessionImpl
          extended by org.jdiameter.server.impl.app.cca.ServerCCASessionImpl
All Implemented Interfaces:
AppSession, StateMachine, BaseSession, CCASession, ServerCCASession, EventListener<Request,Answer>, NetworkReqListener

public class ServerCCASessionImpl
extends AppCCASessionImpl
implements ServerCCASession, NetworkReqListener, EventListener<Request,Answer>

Credit Control Application Server session implementation

Author:
Alexandre Mendonca , Bartosz Baranowski

Field Summary
protected  long[] authAppIds
           
protected  IServerCCASessionContext context
           
protected  ICCAMessageFactory factory
           
protected  ServerCCASessionListener listener
           
protected  java.util.concurrent.locks.Lock sendAndStateLock
           
protected  IServerCCASessionData sessionData
           
protected static java.lang.String TCC_TIMER_NAME
           
 
Fields inherited from class org.jdiameter.common.impl.app.cca.AppCCASessionImpl
stateListeners
 
Fields inherited from class org.jdiameter.common.impl.app.AppSessionImpl
appSessionData, scheduler, session, sessions, sf, timerFacility
 
Constructor Summary
ServerCCASessionImpl(IServerCCASessionData data, ICCAMessageFactory fct, ISessionFactory sf, ServerCCASessionListener lst, IServerCCASessionContext ctx, StateChangeListener<AppSession> stLst)
           
 
Method Summary
protected  void dispatchEvent(AppEvent event)
           
 boolean equals(java.lang.Object obj)
           
<E> E
getState(java.lang.Class<E> stateType)
           
 boolean handleEvent(StateEvent event)
           
 int hashCode()
           
protected  boolean isProvisional(long resultCode)
           
 boolean isReplicable()
           
 boolean isStateless()
           
protected  boolean isSuccess(long resultCode)
           
 void onTimer(java.lang.String timerName)
           
 Answer processRequest(Request request)
           
 void receivedSuccessMessage(Request request, Answer answer)
           
 void release()
           
protected  void send(Event.Type type, AppRequestEvent request, AppAnswerEvent answer)
           
 void sendCreditControlAnswer(JCreditControlAnswer answer)
           
 void sendReAuthRequest(ReAuthRequest request)
           
protected  void setState(ServerCCASessionState newState)
           
protected  void setState(ServerCCASessionState newState, boolean release)
           
 void timeoutExpired(Request request)
           
 java.lang.String toString()
           
 
Methods inherited from class org.jdiameter.common.impl.app.cca.AppCCASessionImpl
addStateChangeNotification, 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, 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

sessionData

protected IServerCCASessionData sessionData

sendAndStateLock

protected java.util.concurrent.locks.Lock sendAndStateLock

factory

protected transient ICCAMessageFactory factory

context

protected transient IServerCCASessionContext context

listener

protected transient ServerCCASessionListener listener

TCC_TIMER_NAME

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

authAppIds

protected long[] authAppIds
Constructor Detail

ServerCCASessionImpl

public ServerCCASessionImpl(IServerCCASessionData data,
                            ICCAMessageFactory fct,
                            ISessionFactory sf,
                            ServerCCASessionListener lst,
                            IServerCCASessionContext ctx,
                            StateChangeListener<AppSession> stLst)
Method Detail

sendCreditControlAnswer

public void sendCreditControlAnswer(JCreditControlAnswer answer)
                             throws InternalException,
                                    IllegalDiameterStateException,
                                    RouteException,
                                    OverloadException
Specified by:
sendCreditControlAnswer in interface ServerCCASession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

sendReAuthRequest

public void sendReAuthRequest(ReAuthRequest request)
                       throws InternalException,
                              IllegalDiameterStateException,
                              RouteException,
                              OverloadException
Specified by:
sendReAuthRequest in interface ServerCCASession
Throws:
InternalException
IllegalDiameterStateException
RouteException
OverloadException

isStateless

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

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

isReplicable

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

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>

onTimer

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

isProvisional

protected boolean isProvisional(long resultCode)

isSuccess

protected boolean isSuccess(long resultCode)

setState

protected void setState(ServerCCASessionState newState)

setState

protected void setState(ServerCCASessionState newState,
                        boolean release)

release

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

send

protected void send(Event.Type type,
                    AppRequestEvent request,
                    AppAnswerEvent answer)
             throws InternalException
Throws:
InternalException

dispatchEvent

protected void dispatchEvent(AppEvent event)
                      throws InternalException
Throws:
InternalException

hashCode

public int hashCode()
Overrides:
hashCode in class AppSessionImpl

equals

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2014. All Rights Reserved.