Class StableAmLink
java.lang.Object
org.forgerock.openig.tools.notifications.ws.link.StableAmLink
- All Implemented Interfaces:
AmLink,AmLinkListener,AmLinkListener.ResilientAmLinkListener
Permits to use a
AmLink even if not started or between disconnection and reconnection events.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.forgerock.openig.tools.notifications.ws.link.AmLink
AmLink.AmLinkSupplier, AmLink.ResilientAmLinkSupplierNested classes/interfaces inherited from interface org.forgerock.openig.tools.notifications.ws.link.AmLinkListener
AmLinkListener.ResilientAmLinkListener -
Method Summary
Modifier and TypeMethodDescriptionasSupplier(AmLink.ResilientAmLinkSupplier amLinkSupplier) Builds a supplier ofStableAmLink.close()Close theAmLinkand its associated resources.voidThe handler to call in case of a disconnection.voidonNotification(Notification notification) The notification handler, will receive all notifications sent by AM.voidonReopen()The handler to call on connection reopening.start()Start theAmLink.Subscribe to an AM topic.unsubscribe(String topic) Unsubscribe from an AM topic.
-
Method Details
-
start
Description copied from interface:AmLink -
onReopen
public void onReopen()Description copied from interface:AmLinkListener.ResilientAmLinkListenerThe handler to call on connection reopening. Can only be called after onDisconnection call, and will be called before any (un)subscribe promise completes.- Specified by:
onReopenin interfaceAmLinkListener.ResilientAmLinkListener
-
onDisconnection
public void onDisconnection()Description copied from interface:AmLinkListenerThe handler to call in case of a disconnection. When this handler is called, the instance is considered as closed. Can only be called after the start promise successful completion, and before every ongoing (un)subscribe promise failure.- Specified by:
onDisconnectionin interfaceAmLinkListener
-
onNotification
Description copied from interface:AmLinkListenerThe notification handler, will receive all notifications sent by AM. Duplicate notifications may occur.- Specified by:
onNotificationin interfaceAmLinkListener- Parameters:
notification- the received notification
-
close
Description copied from interface:AmLinkClose theAmLinkand its associated resources. The instance can't be reused afterward. -
subscribe
Description copied from interface:AmLinkSubscribe to an AM topic. After successful subscription, the notification consumer (supplied in will begin receiving notifications on this topic. -
unsubscribe
Description copied from interface:AmLinkUnsubscribe from an AM topic. After successful unsubscribe request, the notification consumer will stop receiving notifications on this topic.- Specified by:
unsubscribein interfaceAmLink- Parameters:
topic- The AM topic to un-subscribe from.- Returns:
- A promise of a successful un-subscription to the AM topic.
-
asSupplier
public static AmLink.ResilientAmLinkSupplier asSupplier(AmLink.ResilientAmLinkSupplier amLinkSupplier) Builds a supplier ofStableAmLink.- Parameters:
amLinkSupplier- The AmLinkSupplier to use to set up the underlying AmLink- Returns:
- a supplier of
StableAmLink.
-