Interface ShClientSubscriptionActivity
-
public interface ShClientSubscriptionActivityActivity 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 typeorg.jainslee.resources.diameter.sh.SubscribedPushNotificationRequestand Subscribe-Notifications-Answer messages are fired as events of typeorg.jainslee.resources.diameter.sh.SubscribeNotificationsAnswer. This activity is created by a call toorg.jainslee.resources.diameter.sh.ShProvider#createShClientSubscriptionActivity().- Author:
- Open Cloud
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidendActivity()End this activity.ShMessageFactorygetMessageFactory()Get a message factory to manually create SubscribeNotificationsRequests, PushNotificationAnswers and AVPs.UserIdentitygetSubscribedUserIdentity()Return the User-Identity for the subscription in the HSS represented by this activity.voidsendPushNotificationAnswer(long resultCode, boolean isExperimentalResultCode)Convenience method to create and send a PushNotificationAnswer containing a Result-Code or Experimental-Result AVP populated with the given value.voidsendPushNotificationAnswer(PushNotificationAnswer message)Send a manually-constructed PushNotificationAnswer to the peer that sent the PushNotificationRequest.voidsendSubscribeNotificationsRequest(SubscribeNotificationsRequest message)Send a Subscribe-Notifications-Request message.voidsendSuccessPushNotificationAnswer()Convenience method to create and send a PushNotificationAnswer containing a Result-Code set toDiameterResultCode.DIAMETER_SUCCESS.voidsendUnsubscribeRequest()Send a Subscribe-Notifications-Request message containing the AVPs required to UNSUBSCRIBE from the user that this activity represents a subscription to.
-
-
-
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 SendExceptionSend 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 SendExceptionConvenience method to create and send a PushNotificationAnswer containing a Result-Code or Experimental-Result AVP populated with the given value. This is equivalent of callingShMessageFactory.createPushNotificationAnswer(long, boolean)followed by {@link \#sendPushNotificationAnswer(org.jainslee.resources.diameter.sh.types.vc60.PushNotificationAnswer)}.- Throws:
SendException- if the message could not be sent
-
sendSuccessPushNotificationAnswer
void sendSuccessPushNotificationAnswer() throws SendExceptionConvenience method to create and send a PushNotificationAnswer containing a Result-Code set toDiameterResultCode.DIAMETER_SUCCESS. This is equivalent of callingShMessageFactory.createPushNotificationAnswer(long, boolean)with arguments (DiameterResultCode.DIAMETER_SUCCESS, false) followed by {@link \#sendPushNotificationAnswer(org.jainslee.resources.diameter.sh.types.vc60.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.vc60.SubscribeNotificationsRequest)}.
-
endActivity
void endActivity()
End this activity. This does not cause any messages to be sent, it simply ends the activity in the SLEE.
-
-