Class EventHub

  • All Implemented Interfaces:
    java.io.Serializable


    public class EventHub
    extends java.lang.Object
    implements java.io.Serializable
    Class to manage fabric events.

    Feeds Channel event queues with events

    See Also:
    Serialized Form
    • Field Detail

      • disconnectedHandler

        protected transient EventHub.EventHubDisconnected disconnectedHandler
        Default reconnect event hub implementation. Applications are free to replace
    • Method Detail

      • getDisconnectedTime

        public long getDisconnectedTime​()
        Get disconnected time.
        Returns:
        Time in milli seconds disconnect occurred. Zero if never disconnected
      • isConnected

        public boolean isConnected​()
        Is event hub connected.
        Returns:
        boolean if true event hub is connected.
      • getConnectedTime

        public long getConnectedTime​()
        Get last connect time.
        Returns:
        Time in milli seconds the event hub last connected. Zero if never connected.
      • getLastConnectedAttempt

        public long getLastConnectedAttempt​()
        Get last attempt time to connect the event hub.
        Returns:
        Last attempt time to connect the event hub in milli seconds. Zero when never attempted.
      • getName

        public java.lang.String getName​()
        Event hub name
        Returns:
        event hub name
      • getUrl

        public java.lang.String getUrl​()
        Get the GRPC URL used to connect.
        Returns:
        GRPC URL.
      • toString

        public java.lang.String toString​()
        Overrides:
        toString in class java.lang.Object
      • shutdown

        public void shutdown​()
      • setEventHubDisconnectedHandler

        public EventHub.EventHubDisconnected setEventHubDisconnectedHandler​(EventHub.EventHubDisconnected newEventHubDisconnectedHandler)
        Set class to handle Event hub disconnects
        Parameters:
        newEventHubDisconnectedHandler - New handler to replace. If set to null no retry will take place.
        Returns:
        the old handler.
      • finalize

        public void finalize​()
                      throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable