Class PubsubBus

    • Constructor Detail

      • PubsubBus

        public PubsubBus()
    • Method Detail

      • getBus

        @NonNull
        public static PubsubBus getBus()
        Get the installed PubsubBus implementation.
        Returns:
        The installed PubsubBus implementation, or default implementation if none are found.
      • publish

        public void publish​(@NonNull
                            Message message)
                     throws MessageException
        Publish a message on a channel.

        The message instance must have the channel and event name properties set on it.

        Parameters:
        message - The message properties.
        Throws:
        MessageException
      • subscribe

        @Deprecated
        public void subscribe​(@NonNull
                              String channelName,
                              @NonNull
                              ChannelSubscriber subscriber,
                              @NonNull
                              Authentication authentication,
                              @CheckForNull
                              EventFilter eventFilter)
        Deprecated.
        Subscribe to events on the specified event channel.
        Parameters:
        channelName - The channel name.
        subscriber - The subscriber instance that will receive the events.
        authentication - The authentication to which the subscription is associated.
        eventFilter - A message filter, or null if no filtering is to be applied. This tells the bus to only forward messages that match the properties (names and values) specified in the filter.
      • subscribe2

        public void subscribe2​(@NonNull
                               String channelName,
                               @NonNull
                               ChannelSubscriber subscriber,
                               @NonNull
                               org.springframework.security.core.Authentication authentication,
                               @CheckForNull
                               EventFilter eventFilter)
        Subscribe to events on the specified event channel.
        Parameters:
        channelName - The channel name.
        subscriber - The subscriber instance that will receive the events.
        authentication - The authentication to which the subscription is associated.
        eventFilter - A message filter, or null if no filtering is to be applied. This tells the bus to only forward messages that match the properties (names and values) specified in the filter.
      • unsubscribe

        public abstract void unsubscribe​(@NonNull
                                         String channelName,
                                         @NonNull
                                         ChannelSubscriber subscriber)
        Unsubscribe from events on the specified event channel.
        Parameters:
        channelName - The channel name.
        subscriber - The subscriber instance that was used to receive events.
      • shutdown

        public abstract void shutdown()
        Shutdown the bus.
      • start

        public void start()
        will start the bus if it has been shutdown do not restart if already started