Interface DiameterCcaProvider
-
public interface DiameterCcaProvider
The SBB interface for the Diameter CCA Resource Adaptor. This API can be used in either an asynchronous or synchronous manner. These methods support the synchronous uses:eventCreditControlRequest(CreditControlRequest)
initialCreditControlRequest(CreditControlRequest)
updateCreditControlRequest(CreditControlRequest)
terminationCreditControlRequest(CreditControlRequest)
CreditControlMessageFactory.createCreditControlRequest()
.- Author:
- Open Cloud
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description CreditControlClientSessionActivity
createClientSessionActivity()
Create a new activity to send and receive Diameter messages.CreditControlClientSessionActivity
createClientSessionActivity(String sessionIdOptionalComponent)
Create a new activity to send and receive Diameter messages.CreditControlClientSessionActivity
createClientSessionActivity(String sessionId, DiameterIdentity destinationHost, DiameterIdentity destinationRealm)
Deprecated.This method is unsafe because it is requires the caller to guarantee uniqueness of session IDs.CreditControlClientSessionActivity
createClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm)
Create a new activity to send and receive Diameter messages.CreditControlClientSessionActivity
createClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm, String sessionIdOptionalComponent)
Create a new activity to send and receive Diameter messages.CreditControlAnswer
eventCreditControlRequest(CreditControlRequest ccr)
Send a Credit-Control-Request message to the appropriate peers, and block until the response is received then return it.CreditControlMessageFactory
getCreditControlMessageFactory()
Return a message factory to be used to create concrete implementations of credit control messages and AVPsRhinoDiameterURI
getInternalASURI()
Get aRhinoDiameterURI
that uniquely identifies this AS, including its node and cluster IDs, for use when directing inter-node traffic.CreditControlAnswer
initialCreditControlRequest(CreditControlRequest ccr)
Send an initial Credit-Control-Request that will start a credit control session, and block until the answer is received.byte[]
marshalCreditControlAnswer(CreditControlAnswer cca)
Marshal a Credit-Control-Answer into a byte array that can be serialized (e.g., stored in a CMP field).byte[]
marshalCreditControlRequest(CreditControlRequest ccr)
Marshal a Credit-Control-Request into a byte array that can be serialized (e.g., stored in a CMP field).CreditControlAnswer
terminationCreditControlRequest(CreditControlRequest ccr)
Send a termination Credit-Control-Request and block until the answer is received.CreditControlAnswer
unmarshalCreditControlAnswer(byte[] b)
Unmarshal a Credit-Control-Answer from a byte array.CreditControlRequest
unmarshalCreditControlRequest(byte[] b)
Unmarshal a Credit-Control-Request from a byte array.CreditControlAnswer
updateCreditControlRequest(CreditControlRequest ccr)
Send an update (intermediate) Credit-Control-Request and block until the answer is received.
-
-
-
Method Detail
-
createClientSessionActivity
CreditControlClientSessionActivity createClientSessionActivity() throws CreateActivityException
Create a new activity to send and receive Diameter messages. All messages sent on an activity created by this method must contain valid routing AVPs (one or both of Destination-Realm and Destination-Host as defined by RFC6733).- Returns:
- a instance of a CreditControlClientSessionActivity to send credit control messages
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason- See Also:
createClientSessionActivity(org.jainslee.resources.diameter.base.types.DiameterIdentity, org.jainslee.resources.diameter.base.types.DiameterIdentity)
-
createClientSessionActivity
CreditControlClientSessionActivity createClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm) throws CreateActivityException
Create a new activity to send and receive Diameter messages. Messages sent on an activity created by this method will automatically have the Destination-Host and Destination-Realm AVPs set to the provided values.- Parameters:
destinationHost
- a destination host to automatically put in all messages, may be null if not neededdestinationRealm
- a destination realm to automatically put in all messages- Returns:
- a instance of a CreditControlClientSessionActivity to send credit control messages
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason- See Also:
createClientSessionActivity()
-
createClientSessionActivity
@Deprecated CreditControlClientSessionActivity createClientSessionActivity(String sessionId, DiameterIdentity destinationHost, DiameterIdentity destinationRealm) throws CreateActivityException
Deprecated.This method is unsafe because it is requires the caller to guarantee uniqueness of session IDs. ThecreateClientSessionActivity(org.jainslee.resources.diameter.base.types.DiameterIdentity, org.jainslee.resources.diameter.base.types.DiameterIdentity, String)
method can be used to create a session ID that with additional information appended to a guaranteed-unique session ID.Create a new activity to send and receive Diameter messages.- Parameters:
sessionId
- specifies the session ID of the new activity.destinationHost
- a destination host to automatically put in all messagesdestinationRealm
- a destination realm to automatically put in all messages- Returns:
- a instance of a CreditControlClientSessionActivity to send credit control messages
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
createClientSessionActivity
CreditControlClientSessionActivity createClientSessionActivity(String sessionIdOptionalComponent) throws CreateActivityException
Create a new activity to send and receive Diameter messages.- Parameters:
sessionIdOptionalComponent
- a string to append to the session ID generated for this activity. The Diameter session ID separator (';') will be inserted between the generated session ID and the optional component.- Returns:
- a DiameterActivity
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
createClientSessionActivity
CreditControlClientSessionActivity createClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm, String sessionIdOptionalComponent) throws CreateActivityException
Create a new activity to send and receive Diameter messages.- Parameters:
destinationHost
- a destination host to automatically put in all messagesdestinationRealm
- a destination realm to automatically put in all messagessessionIdOptionalComponent
- a string to append to the session ID generated for this activity. The Diameter session ID separator (';') will be inserted between the generated session ID and the optional component.- Returns:
- a instance of a CreditControlClientSessionActivity to send credit control messages
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
eventCreditControlRequest
CreditControlAnswer eventCreditControlRequest(CreditControlRequest ccr) throws SendException
Send a Credit-Control-Request message to the appropriate peers, and block until the response is received then return it.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.cca
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
-
initialCreditControlRequest
CreditControlAnswer initialCreditControlRequest(CreditControlRequest ccr) throws SendException
Send an initial Credit-Control-Request that will start a credit control session, and block until the answer is received. To send subsequent requests for this charging session, you must provide the Session-Id AVP contained in the returned CreditControlAnswer toCreditControlMessageFactory.createCreditControlRequest()
.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.cca
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
-
updateCreditControlRequest
CreditControlAnswer updateCreditControlRequest(CreditControlRequest ccr) throws SendException
Send an update (intermediate) Credit-Control-Request and block until the answer is received.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.cca
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
-
terminationCreditControlRequest
CreditControlAnswer terminationCreditControlRequest(CreditControlRequest ccr) throws SendException
Send a termination Credit-Control-Request and block until the answer is received.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.cca
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
-
getCreditControlMessageFactory
CreditControlMessageFactory getCreditControlMessageFactory()
Return a message factory to be used to create concrete implementations of credit control messages and AVPs- Returns:
- a CreditControlMessageFactory implementation
-
marshalCreditControlRequest
byte[] marshalCreditControlRequest(CreditControlRequest ccr)
Marshal a Credit-Control-Request into a byte array that can be serialized (e.g., stored in a CMP field).- Parameters:
ccr
- the Credit-Control-Request to marshal- Returns:
- a byte array with the marshalled data
-
marshalCreditControlAnswer
byte[] marshalCreditControlAnswer(CreditControlAnswer cca)
Marshal a Credit-Control-Answer into a byte array that can be serialized (e.g., stored in a CMP field).- Parameters:
cca
- the Credit-Control-Answer to marshal- Returns:
- a byte array with the marshalled data
-
unmarshalCreditControlRequest
CreditControlRequest unmarshalCreditControlRequest(byte[] b) throws DecodeException, AvpNotAllowedException
Unmarshal a Credit-Control-Request from a byte array.- Parameters:
b
- the byte array to unmarshal- Returns:
- a Credit-Control-Request constructed from the data in the byte array
- Throws:
DecodeException
AvpNotAllowedException
-
unmarshalCreditControlAnswer
CreditControlAnswer unmarshalCreditControlAnswer(byte[] b) throws DecodeException, AvpNotAllowedException
Unmarshal a Credit-Control-Answer from a byte array.- Parameters:
b
- the byte array to unmarshal- Returns:
- a Credit-Control-Answer constructed from the data in the byte array
- Throws:
DecodeException
AvpNotAllowedException
-
getInternalASURI
RhinoDiameterURI getInternalASURI()
Get aRhinoDiameterURI
that uniquely identifies this AS, including its node and cluster IDs, for use when directing inter-node traffic.- Returns:
- a
RhinoDiameterURI
that uniquely identifies this node
-
-