# Class SenderState

java.lang.Object
org.apache.catalina.tribes.transport.SenderState

public class SenderState extends Object
Tracks the delivery state of a sender associated with a cluster member.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `FAILING`
  Sender has failed and is unable to transmit messages.
  `protected static final ConcurrentMap<Member, SenderState>`
  `memberStates`
  Registry of sender states for each cluster member.
  `static final int`
  `READY`
  Sender is ready to transmit messages.
  `static final int`
  `SUSPECT`
  Sender has been suspected of failure but not yet confirmed.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static SenderState`
  `getSenderState(Member member)`
  Returns the `SenderState` for the given member, creating one if it does not exist.
  `static SenderState`
  `getSenderState(Member member, boolean create)`
  Returns the `SenderState` for the given member.
  `boolean`
  `isFailing()`
  Returns `true` if the sender has failed.
  `boolean`
  `isReady()`
  Returns `true` if the sender is ready to transmit messages.
  `boolean`
  `isSuspect()`
  Returns `true` if the sender is in a suspect or failing state.
  `static void`
  `removeSenderState(Member member)`
  Removes the `SenderState` for the given member from the registry.
  `void`
  `setFailing()`
  Sets the sender state to failing.
  `void`
  `setReady()`
  Sets the sender state to ready.
  `void`
  `setSuspect()`
  Sets the sender state to suspect.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### READY

    public static final int READY
    Sender is ready to transmit messages.
    See Also:
      - Constant Field Values

  - ### SUSPECT

    public static final int SUSPECT
    Sender has been suspected of failure but not yet confirmed.
    See Also:
      - Constant Field Values

  - ### FAILING

    public static final int FAILING
    Sender has failed and is unable to transmit messages.
    See Also:
      - Constant Field Values

  - ### memberStates

    protected static final ConcurrentMap<Member, SenderState> memberStates
    Registry of sender states for each cluster member.

- ## Method Details

  - ### getSenderState

    public static SenderState getSenderState(Member member)
    Returns the `SenderState` for the given member, creating one if it does not exist.
    Parameters:
      `member` - the cluster member
    Returns:
      the sender state for the member

  - ### getSenderState

    public static SenderState getSenderState(Member member, boolean create)
    Returns the `SenderState` for the given member.
    Parameters:
      `member` - the cluster member
      `create` - if `true`, creates a new state when none exists
    Returns:
      the sender state, or `null` if not found and create is `false`

  - ### removeSenderState

    public static void removeSenderState(Member member)
    Removes the `SenderState` for the given member from the registry.
    Parameters:
      `member` - the cluster member whose state should be removed

  - ### isSuspect

    public boolean isSuspect()
    Returns `true` if the sender is in a suspect or failing state.
    Returns:
      `true` if the sender is not ready

  - ### setSuspect

    public void setSuspect()
    Sets the sender state to suspect.

  - ### isReady

    public boolean isReady()
    Returns `true` if the sender is ready to transmit messages.
    Returns:
      `true` if the sender is in the ready state

  - ### setReady

    public void setReady()
    Sets the sender state to ready.

  - ### isFailing

    public boolean isFailing()
    Returns `true` if the sender has failed.
    Returns:
      `true` if the sender is in the failing state

  - ### setFailing

    public void setFailing()
    Sets the sender state to failing.