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 typeorg.jainslee.resources.diameter.sh.SubscribedPushNotificationRequest
and 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 void
endActivity()
End this activity.ShMessageFactory
getMessageFactory()
Get a message factory to manually create SubscribeNotificationsRequests, PushNotificationAnswers and AVPs.UserIdentity
getSubscribedUserIdentity()
Return the User-Identity for the subscription in the HSS represented by this activity.void
sendPushNotificationAnswer(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.void
sendPushNotificationAnswer(PushNotificationAnswer message)
Send a manually-constructed PushNotificationAnswer to the peer that sent the PushNotificationRequest.void
sendSubscribeNotificationsRequest(SubscribeNotificationsRequest message)
Send a Subscribe-Notifications-Request message.void
sendSuccessPushNotificationAnswer()
Convenience method to create and send a PushNotificationAnswer containing a Result-Code set toDiameterResultCode.DIAMETER_SUCCESS
.void
sendUnsubscribeRequest()
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 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 callingShMessageFactory.createPushNotificationAnswer(long, boolean)
followed by {@link \#sendPushNotificationAnswer(org.jainslee.resources.diameter.sh.types.vb60.PushNotificationAnswer)}.- Throws:
SendException
- if the message could not be sent
-
sendSuccessPushNotificationAnswer
void sendSuccessPushNotificationAnswer() throws SendException
Convenience 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.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.
-
-