Interface RoProvider

    • 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​(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 messages
        destinationRealm - 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 messages
        destinationRealm - 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 messages
        destinationRealm - a destination realm to automatically put in all messages
        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
      • 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 peer
        IllegalArgumentException - 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 peer
        IllegalArgumentException - 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