DomainFilterInterceptor (Apache Tomcat 10.1.48 API Documentation)
Description: declaration: package: org.apache.catalina.tribes.group.interceptors, class: DomainFilterInterceptor

# Class DomainFilterInterceptor

java.lang.Object
org.apache.catalina.tribes.group.ChannelInterceptorBase
org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptor

All Implemented Interfaces:
  `ChannelInterceptor, DomainFilterInterceptorMBean, Heartbeat, MembershipListener`

public class DomainFilterInterceptor extends ChannelInterceptorBase implements DomainFilterInterceptorMBean
Filters membership based on domain.

- ## Nested Class Summary

  ### Nested classes/interfaces inherited from interface ChannelInterceptor

  `ChannelInterceptor.InterceptorEvent`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected byte[]`
  `domain`
  `protected int`
  `logInterval`
  `protected Membership`
  `membership`
  `protected static final StringManager`
  `sm`

  ### Fields inherited from class ChannelInterceptorBase

  `optionFlag`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DomainFilterInterceptor()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `byte[]`
  `getDomain()`
  `Member`
  `getLocalMember(boolean incAlive)`
  Intercepts the `Channel.getLocalMember(boolean)` method
  `int`
  `getLogInterval()`
  `Member`
  `getMember(Member mbr)`
  Intercepts the `Channel.getMember(Member)` method
  `Member[]`
  `getMembers()`
  Intercepts the `Channel.getMembers()` method
  `boolean`
  `hasMembers()`
  Intercepts the `Channel.hasMembers()` method
  `void`
  `memberAdded(Member member)`
  A member was added to the group
  `void`
  `memberDisappeared(Member member)`
  A member was removed from the group
  If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data
  `void`
  `messageReceived(ChannelMessage msg)`
  The `messageReceived` is invoked when a message is received.
  `void`
  `setDomain(byte[] domain)`
  `void`
  `setDomain(String domain)`
  `void`
  `setLogInterval(int logInterval)`
  `protected void`
  `setupMembership()`

  ### Methods inherited from class ChannelInterceptorBase

  `fireInterceptorEvent, getChannel, getNext, getOptionFlag, getPrevious, heartbeat, okToProcess, sendMessage, setChannel, setNext, setOptionFlag, setPrevious, start, stop`

  ### Methods inherited from class Object

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

  ### Methods inherited from interface DomainFilterInterceptorMBean

  `getOptionFlag`

- ## Field Details

  - ### sm

    protected static final StringManager sm

  - ### membership

    protected volatile Membership membership

  - ### domain

    protected byte[] domain

  - ### logInterval

    protected int logInterval

- ## Constructor Details

  - ### DomainFilterInterceptor

    public DomainFilterInterceptor()

- ## Method Details

  - ### messageReceived

    public void messageReceived(ChannelMessage msg)
    Description copied from interface: `ChannelInterceptor`
    The `messageReceived` is invoked when a message is received. `ChannelMessage.getAddress()` is the sender, or the reply-to address if it has been overwritten.
    Specified by:
      `messageReceived` in interface `ChannelInterceptor`
    Overrides:
      `messageReceived` in class `ChannelInterceptorBase`
    Parameters:
      `msg` - ChannelMessage

  - ### memberAdded

    public void memberAdded(Member member)
    Description copied from interface: `MembershipListener`
    A member was added to the group
    Specified by:
      `memberAdded` in interface `MembershipListener`
    Overrides:
      `memberAdded` in class `ChannelInterceptorBase`
    Parameters:
      `member` - Member - the member that was added

  - ### memberDisappeared

    public void memberDisappeared(Member member)
    Description copied from interface: `MembershipListener`
    A member was removed from the group
    If the member left voluntarily, the Member.getCommand will contain the Member.SHUTDOWN_PAYLOAD data
    Specified by:
      `memberDisappeared` in interface `MembershipListener`
    Overrides:
      `memberDisappeared` in class `ChannelInterceptorBase`
    Parameters:
      `member` - Member
    See Also:
      - `Member.SHUTDOWN_PAYLOAD`

  - ### hasMembers

    public boolean hasMembers()
    Description copied from interface: `ChannelInterceptor`
    Intercepts the `Channel.hasMembers()` method
    Specified by:
      `hasMembers` in interface `ChannelInterceptor`
    Overrides:
      `hasMembers` in class `ChannelInterceptorBase`
    Returns:
      boolean - if the channel has members in its membership group
    See Also:
      - `Channel.hasMembers()`

  - ### getMembers

    public Member[] getMembers()
    Description copied from interface: `ChannelInterceptor`
    Intercepts the `Channel.getMembers()` method
    Specified by:
      `getMembers` in interface `ChannelInterceptor`
    Overrides:
      `getMembers` in class `ChannelInterceptorBase`
    Returns:
      the members
    See Also:
      - `Channel.getMembers()`

  - ### getMember

    public Member getMember(Member mbr)
    Description copied from interface: `ChannelInterceptor`
    Intercepts the `Channel.getMember(Member)` method
    Specified by:
      `getMember` in interface `ChannelInterceptor`
    Overrides:
      `getMember` in class `ChannelInterceptorBase`
    Parameters:
      `mbr` - Member
    Returns:
      Member - the actual member information, including stay alive
    See Also:
      - `Channel.getMember(Member)`

  - ### getLocalMember

    public Member getLocalMember(boolean incAlive)
    Description copied from interface: `ChannelInterceptor`
    Intercepts the `Channel.getLocalMember(boolean)` method
    Specified by:
      `getLocalMember` in interface `ChannelInterceptor`
    Overrides:
      `getLocalMember` in class `ChannelInterceptorBase`
    Parameters:
      `incAlive` - boolean
    Returns:
      the member that represents this node
    See Also:
      - `Channel.getLocalMember(boolean)`

  - ### setupMembership

    protected void setupMembership()

  - ### getDomain

    public byte[] getDomain()
    Specified by:
      `getDomain` in interface `DomainFilterInterceptorMBean`

  - ### setDomain

    public void setDomain(byte[] domain)

  - ### setDomain

    public void setDomain(String domain)

  - ### getLogInterval

    public int getLogInterval()
    Specified by:
      `getLogInterval` in interface `DomainFilterInterceptorMBean`

  - ### setLogInterval

    public void setLogInterval(int logInterval)
    Specified by:
      `setLogInterval` in interface `DomainFilterInterceptorMBean`