HeartbeatListener (Apache Tomcat 11.0.8 API Documentation)
Description: declaration: package: org.apache.catalina.ha.backend, class: HeartbeatListener

# Class HeartbeatListener

java.lang.Object
org.apache.catalina.ha.backend.HeartbeatListener

All Implemented Interfaces:
  `LifecycleListener`

public class HeartbeatListener extends Object implements LifecycleListener

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected String`
  `host`
  `protected String`
  `ip`
  `protected int`
  `multiport`
  `protected int`
  `port`
  `protected String`
  `proxyList`
  Proxy list, format "address:port,address:port".
  `protected String`
  `proxyURL`
  URL prefix.
  `protected int`
  `ttl`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HeartbeatListener()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getGroup()`
  `String`
  `getHost()`
  `int`
  `getMultiport()`
  `int`
  `getPort()`
  `String`
  `getProxyList()`
  `String`
  `getProxyURL()`
  `int`
  `getTtl()`
  `void`
  `lifecycleEvent(LifecycleEvent event)`
  Acknowledge the occurrence of the specified event.
  `void`
  `setGroup(String group)`
  Set the Multicast IP to use for Multicast
  `void`
  `setHost(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(String proxyList)`
  Set the list of Proxies that send is requests, when not empty it toggles the multi to off.
  `void`
  `setProxyURLString(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 Details

  - ### port

    protected int port

  - ### host

    protected String host

  - ### ip

    protected String ip

  - ### multiport

    protected int multiport

  - ### ttl

    protected int ttl

  - ### proxyList

    protected String proxyList
    Proxy list, format "address:port,address:port".

  - ### proxyURL

    protected String proxyURL
    URL prefix.

- ## Constructor Details

  - ### HeartbeatListener

    public HeartbeatListener()

- ## Method Details

  - ### getHost

    public String getHost()
    Returns:
      the host corresponding to the connector we want to proxy.

  - ### setHost

    public void setHost(String host)
    Set the host corresponding to the connector.
    Parameters:
      `host` - the hostname or ip string.

  - ### getPort

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

  - ### setPort

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

  - ### getGroup

    public String getGroup()
    Returns:
      the Multicast IP we are using for Multicast

  - ### setGroup

    public void setGroup(String group)
    Set the Multicast IP to use for Multicast
    Parameters:
      `group` - the multi address to use.

  - ### getMultiport

    public int getMultiport()
    Returns:
      the Multicast Port we are using for Multicast.

  - ### setMultiport

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

  - ### getTtl

    public int getTtl()
    Returns:
      the TTL for Multicast packets.

  - ### setTtl

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

  - ### getProxyList

    public String getProxyList()
    Returns:
      the list of proxies that send us requests.

  - ### setProxyList

    public void setProxyList(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 String getProxyURL()
    Returns:
      the URL specified in <Location/> for the SetHandler heartbeat.

  - ### setProxyURLString

    public void setProxyURLString(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 /

  - ### lifecycleEvent

    public void lifecycleEvent(LifecycleEvent event)
    Description copied from interface: `LifecycleListener`
    Acknowledge the occurrence of the specified event.
    Specified by:
      `lifecycleEvent` in interface `LifecycleListener`
    Parameters:
      `event` - LifecycleEvent that has occurred