Package org.apache.catalina.tribes.group.interceptors

## 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 org.apache.catalina.tribes.ChannelInterceptor

`ChannelInterceptor.InterceptorEvent`

### Field Summary

Fields
`protected byte[]` `domain`
`protected int` `logInterval`
`protected Membership` `membership`
`protected static StringManager` `sm`

### Fields inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase

`optionFlag`

### Constructor Summary

Constructors
`DomainFilterInterceptor()`

### Method Summary

All Methods Instance Methods Concrete Methods
`byte[]` `getDomain()`
`Member` `getLocalMember​(boolean incAlive)` Return the member that represents this node.
`int` `getLogInterval()`
`Member` `getMember​(Member mbr)` Intercepts the `Channel.getMember(Member)` method
`Member[]` `getMembers()` Get all current cluster members
`boolean` `hasMembers()` has members
`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​(java.lang.String domain)`
`void` `setLogInterval​(int logInterval)`
`protected void` `setupMembership()`

### Methods inherited from class org.apache.catalina.tribes.group.ChannelInterceptorBase

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

### Methods inherited from class java.lang.Object

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

### Methods inherited from interface org.apache.catalina.tribes.group.interceptors.DomainFilterInterceptorMBean

`getOptionFlag`

### Field Detail

#### sm

    protected static final StringManager sm

#### membership

    protected volatile Membership membership

#### domain

    protected byte[] domain

#### logInterval

    protected int logInterval

### Constructor Detail

#### DomainFilterInterceptor

    public DomainFilterInterceptor()

### Method Detail

#### 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 class: `ChannelInterceptorBase`
has members

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 class: `ChannelInterceptorBase`
Get all current cluster members

Specified by:
  `getMembers` in interface `ChannelInterceptor`
Overrides:
  `getMembers` in class `ChannelInterceptorBase`
Returns:
  all members or empty array
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
See Also:
  `Channel.getMember(Member)`

#### getLocalMember

    public Member getLocalMember​(boolean incAlive)

Description copied from class: `ChannelInterceptorBase`
Return the member that represents this node.

Specified by:
  `getLocalMember` in interface `ChannelInterceptor`
Overrides:
  `getLocalMember` in class `ChannelInterceptorBase`
Parameters:
  `incAlive` - boolean
Returns:
  Member
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​(java.lang.String domain)

#### getLogInterval

    public int getLogInterval()

Specified by:
  `getLogInterval` in interface `DomainFilterInterceptorMBean`

#### setLogInterval

    public void setLogInterval​(int logInterval)

Specified by:
  `setLogInterval` in interface `DomainFilterInterceptorMBean`