Package com.bea.wcp.diameter.accounting
Class ClientSession
java.lang.Object
com.bea.wcp.diameter.Session
com.bea.wcp.diameter.accounting.ClientSession
- All Implemented Interfaces:
Externalizable,Serializable
- Direct Known Subclasses:
RfSession
Client accounting session implementing the client accounting state machine
described in RFC 3588 section 8.2. This session can be used to create and
send new ACR accounting requests, and receive corresponding ACA answer
messages. The current session state is based on the accounting record type
of the previously created request. For an EVENT ACR, the session will be
terminated (removed from the Diameter session map) as soon as the
corresponding EVENT ACA message is received. Likewise, after STOP ACR
is sent, the session will be terminated as soon as the corresponding STOP
ACA message is received.
- Author:
- Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUsed by Externalizable.ClientSession(Application app) Creates a new ClientSession for the specified application.ClientSession(Application app, String id, Object parent) -
Method Summary
Modifier and TypeMethodDescriptioncreateACR(RecordType type) Creates a new accounting request (ACR) for the specified accounting record type.protected voidReceives accounting answer (ACA) messages for this session.voidvoidsndMessage(Message msg) Called by the container just before a new ACR or ACA message has been sent out.voidMethods inherited from class com.bea.wcp.diameter.Session
appendXml, createRequest, getAdapter, getApplication, getAttribute, getId, getListener, isTerminated, notifyListener, rcvMessage, rcvRequest, removeAttribute, setAdapter, setAttribute, setListener, terminate, toString
-
Constructor Details
-
ClientSession
public ClientSession()Used by Externalizable. -
ClientSession
Creates a new ClientSession for the specified application. -
ClientSession
-
-
Method Details
-
createACR
Creates a new accounting request (ACR) for the specified accounting record type. For a newly created ClientSession, the first ACR request must be either an EVENT request for event-based accounting, or a START request for session-based accounting. If an EVENT request, then this must be the only request created for the session, and the session will be terminated automatically upon receipt of the corresponding EVENT ACA message. If a START request, then this must be followed by zero or more INTERIM requests, and finally a terminating STOP request. Upon receiving the STOP ACA message, the session will be automatically terminated.- Parameters:
type- the accounting RecordType for the request- Returns:
- the resulting ACR request for this session
- Throws:
IllegalStateException- if the session is terminated, a request is currently pending, or the specified RequestType is not valid for the current session state
-
sndMessage
Called by the container just before a new ACR or ACA message has been sent out. The current session state is updated accordingly.- Overrides:
sndMessagein classSession- Parameters:
msg- the ACR/ACA message being sent out- Throws:
IOException- if the message could not be sentIllegalStateException- if the session has been terminated, a request is already pending, or a request is out of sequence (invalid record number)
-
rcvAnswer
Receives accounting answer (ACA) messages for this session. The session state machine will be updated according to ACA record number and type. If ACA record type is EVENT or STOP then the session will be automatically terminated.- Overrides:
rcvAnswerin classSession- Parameters:
ans- the ACA message- Throws:
DiameterException- if a Diameter protocol error occurredIOException- if an I/O error occurred while processing the message
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classSession- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classSession- Throws:
IOExceptionClassNotFoundException
-