Class HeartbeatListener

  • All Implemented Interfaces:
    LifecycleListener

    public class HeartbeatListener
    extends java.lang.Object
    implements LifecycleListener
    Lifecycle listener that provides heartbeat information to mod_heartbeat for Apache HTTP Server.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String host
      Host of the connector to proxy.
      protected java.lang.String ip
      Multicast IP address.
      protected int multiport
      Multicast port.
      protected int port
      Port of the connector to proxy.
      protected java.lang.String proxyList
      Proxy list, format "address:port,address:port".
      protected java.lang.String proxyURL
      URL prefix.
      protected int ttl
      Time-to-live for multicast packets.
    • Constructor Summary

      Constructors 
      Constructor Description
      HeartbeatListener()
      Constructs a new HeartbeatListener.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getGroup()
      Get the multicast IP address used for sending heartbeat messages.
      java.lang.String getHost()
      Get the host corresponding to the connector we want to proxy.
      int getMultiport()
      Get the multicast port used for sending heartbeat messages.
      int getPort()
      Get the port of the connector we want to proxy.
      java.lang.String getProxyList()
      Get the list of proxies that send requests to this server.
      java.lang.String getProxyURL()
      Get the URL specified in <Location/> for the SetHandler heartbeat in httpd.conf.
      int getTtl()
      Get the TTL value used for multicast packets.
      void lifecycleEvent​(LifecycleEvent event)
      Acknowledge the occurrence of the specified event.
      void setGroup​(java.lang.String group)
      Set the Multicast IP to use for Multicast
      void setHost​(java.lang.String host)
      Set the host corresponding to the connector.
      void setMultiport​(int port)
      Set the Port to use for Multicast
      void setPort​(int port)
      Set the port corresponding to the connector.
      void setProxyList​(java.lang.String proxyList)
      Set the list of Proxies that send is requests, when not empty it toggles the multi to off.
      void setProxyURLString​(java.lang.String proxyURL)
      Set the URL of receiver in httpd.
      void setTtl​(int ttl)
      Set the TTL for Multicast packets.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • port

        protected int port
        Port of the connector to proxy. Default is 8009.
      • host

        protected java.lang.String host
        Host of the connector to proxy.
      • ip

        protected java.lang.String ip
        Multicast IP address. Default is 224.0.1.105.
      • multiport

        protected int multiport
        Multicast port. Default is 23364.
      • ttl

        protected int ttl
        Time-to-live for multicast packets. Default is 16.
      • proxyList

        protected java.lang.String proxyList
        Proxy list, format "address:port,address:port".
      • proxyURL

        protected java.lang.String proxyURL
        URL prefix.
    • Constructor Detail

      • HeartbeatListener

        public HeartbeatListener()
        Constructs a new HeartbeatListener.
    • Method Detail

      • getHost

        public java.lang.String getHost()
        Get the host corresponding to the connector we want to proxy.
        Returns:
        the host
      • setHost

        public void setHost​(java.lang.String host)
        Set the host corresponding to the connector.
        Parameters:
        host - the hostname or ip string.
      • getPort

        public int getPort()
        Get the port of the connector we want to proxy.
        Returns:
        the port
      • setPort

        public void setPort​(int port)
        Set the port corresponding to the connector.
        Parameters:
        port - default 8009 the ajp one.
      • getGroup

        public java.lang.String getGroup()
        Get the multicast IP address used for sending heartbeat messages.
        Returns:
        the multicast IP address
      • setGroup

        public void setGroup​(java.lang.String group)
        Set the Multicast IP to use for Multicast
        Parameters:
        group - the multi address to use.
      • getMultiport

        public int getMultiport()
        Get the multicast port used for sending heartbeat messages.
        Returns:
        the multicast port
      • setMultiport

        public void setMultiport​(int port)
        Set the Port to use for Multicast
        Parameters:
        port - the port to use.
      • getTtl

        public int getTtl()
        Get the TTL value used for multicast packets.
        Returns:
        the TTL value
      • setTtl

        public void setTtl​(int ttl)
        Set the TTL for Multicast packets.
        Parameters:
        ttl - value for TTL.
      • getProxyList

        public java.lang.String getProxyList()
        Get the list of proxies that send requests to this server.
        Returns:
        the proxy list in "address:port,address:port" format
      • setProxyList

        public void setProxyList​(java.lang.String proxyList)
        Set the list of Proxies that send is requests, when not empty it toggles the multi to off. A SetHandler heartbeat must be existing in httpd.conf.
        Parameters:
        proxyList - the list of proxy, format "address:port,address:port".
      • getProxyURL

        public java.lang.String getProxyURL()
        Get the URL specified in <Location/> for the SetHandler heartbeat in httpd.conf.
        Returns:
        the proxy URL
      • setProxyURLString

        public void setProxyURLString​(java.lang.String proxyURL)
        Set the URL of receiver in httpd. That is the location used in
         <Location "/HeartbeatListener">
            SetHandler heartbeat
         </Location>
         
        All proxies MUST use the same location.
        Parameters:
        proxyURL - a String with the URL starting with /