Interface RoProvider
-
- All Superinterfaces:
RoProviderFactory
public interface RoProvider extends RoProviderFactory
The SBB interface for the Diameter Ro Resource Adaptor.
This API can be used in either an asynchronous or synchronous manner.
To send messages asynchronously, create a
RoClientSessionActivity
using one of thecreateRoClientSessionActivity()
methods.To send messages synchronously, use the following methods:
eventCreditControlRequest(CreditControlRequest)
initialCreditControlRequest(CreditControlRequest)
updateCreditControlRequest(CreditControlRequest)
terminationCreditControlRequest(CreditControlRequest)
The Credit-Control-Request messages must be created using message factory:
RoMessageFactory
returned fromgetRoMessageFactory()
- Author:
- Open Cloud
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description RoClientSessionActivity
createRoClientSessionActivity()
Create a new activity to send and receive Diameter messages.RoClientSessionActivity
createRoClientSessionActivity(String sessionIdOptionalComponent)
Create a new activity to send and receive Diameter messages.RoClientSessionActivity
createRoClientSessionActivity(String sessionId, DiameterIdentity destinationHost, DiameterIdentity destinationRealm)
Deprecated.This method is unsafe because it is requires the caller to guarantee uniqueness of session IDs.RoClientSessionActivity
createRoClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm)
Create a new activity to send and receive Diameter messages.RoClientSessionActivity
createRoClientSessionActivity(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.DiameterProvider
getBaseProvider()
Return a base Diameter provider that can be used to create base activities to send extension messages etc.RoMessageFactory
getRoMessageFactory()
Return a message factory to be used to create concrete implementations of credit control messages and AVPs.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[]
marshalRoCreditControlAnswer(CreditControlAnswer cca)
Marshal a Credit-Control-Answer into a byte array that can be serialized (e.g., stored in a CMP field).byte[]
marshalRoCreditControlRequest(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
unmarshalRoCreditControlAnswer(byte[] b)
Unmarshal a Credit-Control-Answer from a byte array.CreditControlRequest
unmarshalRoCreditControlRequest(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.-
Methods inherited from interface org.jainslee.resources.diameter.ro.RoProviderFactory
getConfiguredTGPPVersion, getInternalASURI, getRoProviderV790, getRoProviderV820, getRoProviderV8d0, getRoProviderV960, getRoProviderVa00, getRoProviderVb80, getRoProviderVcb0
-
-
-
-
Method Detail
-
getRoMessageFactory
RoMessageFactory getRoMessageFactory()
Return a message factory to be used to create concrete implementations of credit control messages and AVPs.
-
getBaseProvider
DiameterProvider getBaseProvider()
Return a base Diameter provider that can be used to create base activities to send extension messages etc.
-
createRoClientSessionActivity
RoClientSessionActivity createRoClientSessionActivity() throws CreateActivityException
Create a new activity to send and receive Diameter messages.- Returns:
- a DiameterActivity
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
createRoClientSessionActivity
RoClientSessionActivity createRoClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm) 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 messages- Returns:
- a DiameterActivity
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
createRoClientSessionActivity
@Deprecated RoClientSessionActivity createRoClientSessionActivity(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. The {@link \#createRoClientSessionActivity(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 DiameterActivity
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
createRoClientSessionActivity
RoClientSessionActivity createRoClientSessionActivity(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
-
createRoClientSessionActivity
RoClientSessionActivity createRoClientSessionActivity(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 DiameterActivity
- 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.ro
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
- if an error occured sending the request to the peer
-
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 to {@link RoMessageFactory\#createCreditControlRequest(java.lang.String)}.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.ro
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
- if an error occured sending the request to the peer
-
updateCreditControlRequest
CreditControlAnswer updateCreditControlRequest(CreditControlRequest ccr) throws SendException
Send an update (intermediate) Credit-Control-Request and block until the answer is received. The Session-Id and CC-Request-Number AVPs must be set by the caller since the RA does not store these when sending messages synchronously.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.ro
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
- if an error occured sending the request to the peerIllegalArgumentException
- if the CreditControlRequest does not contain CC-Request-Number and Session-Id AVPs
-
terminationCreditControlRequest
CreditControlAnswer terminationCreditControlRequest(CreditControlRequest ccr) throws SendException
Send a termination Credit-Control-Request and block until the answer is received. The Session-Id and CC-Request-Number AVPs must be set by the caller since the RA does not store these when sending messages synchronously.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.ro
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
- if an error occured sending the request to the peerIllegalArgumentException
- if the CreditControlRequest does not contain CC-Request-Number and Session-Id AVPs
-
marshalRoCreditControlRequest
byte[] marshalRoCreditControlRequest(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
-
marshalRoCreditControlAnswer
byte[] marshalRoCreditControlAnswer(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
-
unmarshalRoCreditControlRequest
CreditControlRequest unmarshalRoCreditControlRequest(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
-
unmarshalRoCreditControlAnswer
CreditControlAnswer unmarshalRoCreditControlAnswer(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
-
-