Class CuratorListeners


  • public class CuratorListeners
    extends Object
    Utilities related to Curator listener classes.
    • Constructor Detail

      • CuratorListeners

        public CuratorListeners()
    • Method Detail

      • addLoggingCuratorListener

        public static void addLoggingCuratorListener​(org.apache.curator.framework.CuratorFramework client,
                                                     String myName)
        Add a CuratorListener to the given client that logs receipt of Curator events at INFO level.
        Parameters:
        client - the Curator client
        myName - the name for the logging listener, used in log messages
        See Also:
        CuratorListener, CuratorEvent
      • addLoggingConnectionStateListener

        public static void addLoggingConnectionStateListener​(org.apache.curator.framework.CuratorFramework client,
                                                             String myName)
        Add a ConnectionStateListener to the given client that logs state changes at INFO level.
        Parameters:
        client - the Curator client
        myName - the name for the logging listener, used in log messages
        See Also:
        ConnectionStateListener
      • addLoggingUnhandledErrorListener

        public static void addLoggingUnhandledErrorListener​(org.apache.curator.framework.CuratorFramework client,
                                                            String myName)
        Add an UnhandledErrorListener to the given client that logs unhandled errors at WARN level.
        Parameters:
        client - the Curator client
        myName - the name for the logging listener, used in log messages
        See Also:
        UnhandledErrorListener
      • descriptionOf

        public static String descriptionOf​(org.apache.curator.framework.api.CuratorEvent event)
        Provide a human-readable description of a Curator event.
        Parameters:
        event - the Curator event to describe
        Returns:
        event description