Class DirectAmLink
java.lang.Object
org.forgerock.openig.tools.notifications.ws.link.DirectAmLink
- All Implemented Interfaces:
AmLink
Manage the
WebSocketAdapter
and run subscribe and unsubscribe operations on it.
This AmLink
complete features list is:
- Start and stop a
WebSocketAdapter
- Send (un-)subscriptions message over a
WebSocketAdapter
- Handle (un-)subscription Acknowledgments sent by AM
- Translate
JsonValue
notification messages intoNotification
The following issues may occur while starting, and so fail promises:
- The
WebSocketAdapter
fails to start - A disconnection happens while waiting for an Ack: all waiting Acks will be considered as failed, see #3
- An Ack is never received : THEN THIS PROMISE WILL NEVER BEEN COMPLETED
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.forgerock.openig.tools.notifications.ws.link.AmLink
AmLink.AmLinkSupplier, AmLink.ResilientAmLinkSupplier
-
Method Summary
Modifier and TypeMethodDescriptionstatic AmLink.AmLinkSupplier
asSupplier
(WebSocketAdapter wsAdapter) Builds a supplier ofDirectAmLink
.close()
Close theAmLink
and its associated resources.start()
Start theAmLink
.Subscribe to an AM topic.unsubscribe
(String topic) Unsubscribe from an AM topic.
-
Method Details
-
start
Description copied from interface:AmLink
-
close
Description copied from interface:AmLink
Close theAmLink
and its associated resources. The instance can't be reused afterward. -
subscribe
Description copied from interface:AmLink
Subscribe to an AM topic. After successful subscription, the notification consumer (supplied in will begin receiving notifications on this topic. -
unsubscribe
Description copied from interface:AmLink
Unsubscribe from an AM topic. After successful unsubscribe request, the notification consumer will stop receiving notifications on this topic.- Specified by:
unsubscribe
in interfaceAmLink
- Parameters:
topic
- The AM topic to un-subscribe from.- Returns:
- A promise of a successful un-subscription to the AM topic.
-
asSupplier
Builds a supplier ofDirectAmLink
.- Parameters:
wsAdapter
- The WebSocketAdapter to use.- Returns:
- a supplier of
DirectAmLink
.
-