Interface DiameterGxProvider
-
- All Superinterfaces:
DiameterGxProviderFactory
public interface DiameterGxProvider extends DiameterGxProviderFactory
The SBB interface for the Diameter Gx 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)
org.jainslee.resources.diameter.gx.DiameterGxMessageFactory#createGxCreditControlRequest()
.- Author:
- Open Cloud
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description GxClientSessionActivity
createGxClientSessionActivity()
Create a new activity to send and receive Diameter messages.GxClientSessionActivity
createGxClientSessionActivity(String sessionIdOptionalComponent)
Create a new activity to send and receive Diameter messages.GxClientSessionActivity
createGxClientSessionActivity(DiameterIdentity destinationHost, DiameterIdentity destinationRealm)
Create a new activity to send and receive Diameter messages.GxClientSessionActivity
createGxClientSessionActivity(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.DiameterGxMessageFactory
getDiameterGxMessageFactory()
Return a message factory to be used to create concrete implementations of credit control messages and AVPsCreditControlAnswer
initialCreditControlRequest(CreditControlRequest ccr)
Send an initial Credit-Control-Request that will start a credit control session, and block until the answer is received.byte[]
marshalGxCreditControlAnswer(CreditControlAnswer cca)
Marshal a Credit-Control-Answer into a byte array that can be serialized (e.g., stored in a CMP field).byte[]
marshalGxCreditControlRequest(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
unmarshalGxCreditControlAnswer(byte[] b)
Unmarshal a Credit-Control-Answer from a byte array.CreditControlRequest
unmarshalGxCreditControlRequest(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.gx.DiameterGxProviderFactory
getConfiguredTGPPVersion, getDiameterGxProviderVa10, getDiameterGxProviderVb90, getDiameterGxProviderVcd0, getInternalASURI
-
-
-
-
Method Detail
-
createGxClientSessionActivity
GxClientSessionActivity createGxClientSessionActivity() 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 GxClientSessionActivity to send credit control messages
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason
-
createGxClientSessionActivity
GxClientSessionActivity createGxClientSessionActivity(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 GxClientSessionActivity to send credit control messages
- Throws:
CreateActivityException
- if the RA could not create the activity for any reason- See Also:
createGxClientSessionActivity()
-
createGxClientSessionActivity
GxClientSessionActivity createGxClientSessionActivity(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
-
createGxClientSessionActivity
GxClientSessionActivity createGxClientSessionActivity(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 GxClientSessionActivity 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.gx
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 toorg.jainslee.resources.diameter.gx.DiameterGxMessageFactory#createGxCreditControlRequest()
.See the note regarding synchronous requests in the
org.jainslee.resources.diameter.gx
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.gx
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.gx
package docs.- Parameters:
ccr
- the CreditControlRequest to send- Returns:
- the answer received
- Throws:
SendException
-
getDiameterGxMessageFactory
DiameterGxMessageFactory getDiameterGxMessageFactory()
Return a message factory to be used to create concrete implementations of credit control messages and AVPs- Returns:
- a CreditControlMessageFactory implementation
-
marshalGxCreditControlRequest
byte[] marshalGxCreditControlRequest(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
-
marshalGxCreditControlAnswer
byte[] marshalGxCreditControlAnswer(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
-
unmarshalGxCreditControlRequest
CreditControlRequest unmarshalGxCreditControlRequest(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
-
unmarshalGxCreditControlAnswer
CreditControlAnswer unmarshalGxCreditControlAnswer(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
-
-