|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object dk.i1.diameter.session.ACHandler
public class ACHandler
A utility class for dealing with accounting. It supports sub-sessions, interim accounting and other common stuff. It can be used for incorporating into session classes. The session must dispatch ACAs to it. The class uses the sub-session 0 for the session itself and it is always present. It is the responsibility of the user to update the the usage data in the SubSession instances and/or override the collectACRInfo() method. Acct-Realtime-Required semantics are not directly supported.
Nested Class Summary | |
---|---|
static class |
ACHandler.SubSession
A collection of data belonging to a (sub-)session. |
Field Summary | |
---|---|
Integer |
acct_application_id
The acct-application-id to include in ACRs. |
String |
acct_multi_session_id
The acct-multi-session-id to include in ACRs, if any |
Constructor Summary | |
---|---|
ACHandler(BaseSession base_session)
Constructor for ACHandler |
Method Summary | |
---|---|
long |
calcNextTimeout()
Calculate the next time that handleTimeouts() should be called. |
void |
collectACRInfo(Message acr,
ACHandler.SubSession ss,
int record_type)
Collect information and put it into an ACR. |
long |
createSubSession()
Creates a sub-session. |
void |
handleACA(Message answer)
Process an ACA |
void |
handleTimeout()
Process timeouts, if any. |
void |
sendEvent()
Send an event record for the whole session. |
void |
sendEvent(AVP[] avps)
Send an event record for the whole session with an additional set of AVPs Implemented as sendEvent(0,null) |
void |
sendEvent(long subsession_id)
Send an event record for the sub-session with an additional set of AVPs Implemented as sendEvent(subsession_id,null) |
void |
sendEvent(long subsession_id,
AVP[] avps)
Send an event record for the sub-session with an additional set of AVPs collectACR() will be called and the AVPs will then be added to the ACR, and then sent. |
void |
startSession()
Start accounting for the session This will result in the ACR start-record being sent. |
void |
startSubSession(long subsession_id)
Start sub-session accounting for the specified sub-session. |
void |
stopSession()
Stop accounting. |
void |
stopSubSession(long subsession_id)
Stop a sub-session. |
ACHandler.SubSession |
subSession(long subsession_id)
Retrieve a sub-session by id |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public String acct_multi_session_id
public Integer acct_application_id
Constructor Detail |
---|
public ACHandler(BaseSession base_session)
base_session
- The BaseSession (or subclass thereof) for which
the accounting should be produced.Method Detail |
---|
public long calcNextTimeout()
public void handleTimeout()
public long createSubSession()
public ACHandler.SubSession subSession(long subsession_id)
subsession_id
- The sub-session id
public void startSubSession(long subsession_id)
subsession_id
- The sub-session idpublic void stopSubSession(long subsession_id)
subsession_id
- The sub-session idpublic void startSession()
public void stopSession()
public void sendEvent()
public void sendEvent(AVP[] avps)
public void sendEvent(long subsession_id)
public void sendEvent(long subsession_id, AVP[] avps)
public void handleACA(Message answer)
public void collectACRInfo(Message acr, ACHandler.SubSession ss, int record_type)
Subclasses probably want to override this to add session-type specific AVPs.
acr
- The ACR message being constructedss
- The sub-sessionrecord_type
- The record type (start/interim/stop/event)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |