Interface ArEventSubscriberPlugin

    • Method Detail

      • subscribe

        default HttpJsonEventSubscriberPlugin subscribe​(java.lang.String topic,
                                                        EventSubscriptionHandler handler)
        Registers new default event subscription.

        The default event subscriptions added to this plugin are added to each system it is attached to. For this reason, these subscriptions cannot be cancelled in any other way than shutting down the systems this plugin is attached to. If wanting to create subscriptions that are more readily cancellable, use the ArSystem.pluginFacadeOf(Class) method and cast its successful result to ArEventSubscriberPluginFacade, like so:

             var system = new System.Builder()
                 (...)
                 .plugins(new HttpJsonEventSubscriberPlugin())
                 .build();
             system.pluginFacadeOf(HttpJsonEventSubscriberPlugin.class)
                 .map(facade -> (ArEventSubscriberPluginFacade) facade)
                 .ifPresent(facade -> {...});
         
        Parameters:
        topic - Topic, or "eventType", that must be matched by received events. Topics are case insensitive and can only be subscribed to once.
        handler - Handler to receive matching events.
        Returns:
        Future completed when subscription is registered.
      • subscribe

        default HttpJsonEventSubscriberPlugin subscribe​(java.lang.String topic,
                                                        java.util.Map<java.lang.String,​java.lang.String> metadata,
                                                        EventSubscriptionHandler handler)
        Registers new default event subscription.

        The default event subscriptions added to this plugin are added to each system it is attached to. For this reason, these subscriptions cannot be cancelled in any other way than shutting down the systems this plugin is attached to. If wanting to create subscriptions that are more readily cancellable, use the ArSystem.pluginFacadeOf(Class) method and cast its successful result to ArEventSubscriberPluginFacade, like so:

             var system = new System.Builder()
                 (...)
                 .plugins(new HttpJsonEventSubscriberPlugin())
                 .build();
             system.pluginFacadeOf(HttpJsonEventSubscriberPlugin.class)
                 .map(facade -> (ArEventSubscriberPluginFacade) facade)
                 .ifPresent(facade -> {...});
         
        Parameters:
        topic - Topic, or "eventType", that must be matched by received events. Topics are case insensitive and can only be subscribed to once.
        metadata - Metadata pairs that must be matched by received events.
        handler - Handler to receive matching events.
        Returns:
        Future completed when subscription is registered.
      • subscribe

        default HttpJsonEventSubscriberPlugin subscribe​(java.lang.String topic,
                                                        java.util.Collection<se.arkalix.description.SystemDescription> providers,
                                                        EventSubscriptionHandler handler)
        Registers new default event subscription.

        The default event subscriptions added to this plugin are added to each system it is attached to. For this reason, these subscriptions cannot be cancelled in any other way than shutting down the systems this plugin is attached to. If wanting to create subscriptions that are more readily cancellable, use the ArSystem.pluginFacadeOf(Class) method and cast its successful result to ArEventSubscriberPluginFacade, like so:

             var system = new System.Builder()
                 (...)
                 .plugins(new HttpJsonEventSubscriberPlugin())
                 .build();
             system.pluginFacadeOf(HttpJsonEventSubscriberPlugin.class)
                 .map(facade -> (ArEventSubscriberPluginFacade) facade)
                 .ifPresent(facade -> {...});
         
        Parameters:
        topic - Topic, or "eventType", that must be matched by received events. Topics are case insensitive and can only be subscribed to once.
        providers - Event providers to receive events from.
        handler - Handler to receive matching events.
        Returns:
        Future completed when subscription is registered.
      • subscribe

        default HttpJsonEventSubscriberPlugin subscribe​(java.lang.String topic,
                                                        java.util.Map<java.lang.String,​java.lang.String> metadata,
                                                        java.util.Collection<se.arkalix.description.SystemDescription> providers,
                                                        EventSubscriptionHandler handler)
        Registers new default event subscription.

        The default event subscriptions added to this plugin are added to each system it is attached to. For this reason, these subscriptions cannot be cancelled in any other way than shutting down the systems this plugin is attached to. If wanting to create subscriptions that are more readily cancellable, use the ArSystem.pluginFacadeOf(Class) method and cast its successful result to ArEventSubscriberPluginFacade, like so:

             var system = new System.Builder()
                 (...)
                 .plugins(new HttpJsonEventSubscriberPlugin())
                 .build();
             system.pluginFacadeOf(HttpJsonEventSubscriberPlugin.class)
                 .map(facade -> (ArEventSubscriberPluginFacade) facade)
                 .ifPresent(facade -> {...});
         
        Parameters:
        topic - Topic, or "eventType", that must be matched by received events. Topics are case insensitive and can only be subscribed to once.
        metadata - Metadata pairs that must be matched by received events.
        providers - Event providers to receive events from.
        handler - Handler to receive matching events.
        Returns:
        Future completed when subscription is registered.
      • subscribe

        HttpJsonEventSubscriberPlugin subscribe​(EventSubscription subscription)
        Registers new default event subscription.

        The default event subscriptions added to this plugin are added to each system it is attached to. For this reason, these subscriptions cannot be cancelled in any other way than shutting down the systems this plugin is attached to. If wanting to create subscriptions that are more readily cancellable, use the ArSystem.pluginFacadeOf(Class) method and cast its successful result to ArEventSubscriberPluginFacade, like so:

             var system = new System.Builder()
                 (...)
                 .plugins(new HttpJsonEventSubscriberPlugin())
                 .build();
             system.pluginFacadeOf(HttpJsonEventSubscriberPlugin.class)
                 .map(facade -> (ArEventSubscriberPluginFacade) facade)
                 .ifPresent(facade -> {...});
         
        Parameters:
        subscription - Subscription to register.
        Returns:
        This builder.