Interface ShClientSubscriptionActivity


  • public interface ShClientSubscriptionActivity
    Activity used by a Diameter Sh client to represent a subscription to changes in user data in an HSS. Push-Notification-Request messages are fired on this activity as events of type org.jainslee.resources.diameter.sh.SubscribedPushNotificationRequest and Subscribe-Notifications-Answer messages are fired as events of type org.jainslee.resources.diameter.sh.SubscribeNotificationsAnswer.

    This activity is created by a call to org.jainslee.resources.diameter.sh.ShProvider#createShClientSubscriptionActivity().

    Author:
    Open Cloud
    • Method Detail

      • getMessageFactory

        ShMessageFactory getMessageFactory()
        Get a message factory to manually create SubscribeNotificationsRequests, PushNotificationAnswers and AVPs.
      • sendSubscribeNotificationsRequest

        void sendSubscribeNotificationsRequest​(SubscribeNotificationsRequest message)
                                        throws SendException
        Send a Subscribe-Notifications-Request message.
        Parameters:
        message - request message to send
        Throws:
        SendException - if the request message could not be sent
      • sendUnsubscribeRequest

        void sendUnsubscribeRequest()
                             throws SendException
        Send a Subscribe-Notifications-Request message containing the AVPs required to UNSUBSCRIBE from the user that this activity represents a subscription to.
        Throws:
        SendException - if the request message could not be sent
      • sendPushNotificationAnswer

        void sendPushNotificationAnswer​(PushNotificationAnswer message)
                                 throws SendException
        Send a manually-constructed PushNotificationAnswer to the peer that sent the PushNotificationRequest.
        Throws:
        SendException - if the message could not be sent
      • sendPushNotificationAnswer

        void sendPushNotificationAnswer​(long resultCode,
                                        boolean isExperimentalResultCode)
                                 throws SendException
        Convenience method to create and send a PushNotificationAnswer containing a Result-Code or Experimental-Result AVP populated with the given value.

        This is equivalent of calling ShMessageFactory.createPushNotificationAnswer(long, boolean) followed by {@link \#sendPushNotificationAnswer(org.jainslee.resources.diameter.sh.types.vb60.PushNotificationAnswer)}.

        Throws:
        SendException - if the message could not be sent
      • getSubscribedUserIdentity

        UserIdentity getSubscribedUserIdentity()
        Return the User-Identity for the subscription in the HSS represented by this activity.
        Returns:
        the User-Identity AVP sent in the initial Subscription-Notifications-Request passed to {@link \#sendSubscribeNotificationsRequest(org.jainslee.resources.diameter.sh.types.vb60.SubscribeNotificationsRequest)}.
      • endActivity

        void endActivity()
        End this activity. This does not cause any messages to be sent, it simply ends the activity in the SLEE.