Atavism Version 2018.1AGIS API

atavism.msgsys
Class Filter

java.lang.Object
  extended by atavism.msgsys.Filter
All Implemented Interfaces:
IFilter
Direct Known Subclasses:
MessageTypeFilter, PerceptionFilter

public abstract class Filter
extends java.lang.Object
implements IFilter

Subscription message filter base class. Filters have a list of matching MessageTypes and optionally provide their own FilterTable.

Sub-classes must implement matchMessageType, getMessageTypes(), and matchRemaining. Sub-classes must also provide a no argument constructor to be compatible with atavism marshalling.


Constructor Summary
Filter()
           
 
Method Summary
 boolean applyFilterUpdate(FilterUpdate update)
          Update the filter according to the instructions in udpate.
 boolean applyFilterUpdate(FilterUpdate update, AgentHandle sender, SubscriptionHandle sub)
          Update the filter according to the instructions in udpate.
abstract  java.util.Collection<MessageType> getMessageTypes()
          Returns the filter's message types.
 FilterTable getReceiveFilterTable()
          Returns filter table used to collect this kind of filter.
 FilterTable getResponderReceiveFilterTable()
          Returns filter table used to collect this kind of filter.
 FilterTable getResponderSendFilterTable()
          Returns filter table used to collect this kind of filter.
 FilterTable getSendFilterTable()
          Returns filter table used to collect this kind of filter.
abstract  boolean matchMessageType(java.util.Collection<MessageType> messageTypes)
          True if the given messageTypes intersects the filter's message types.
abstract  boolean matchRemaining(Message message)
          True if the message matches the filter criteria.
protected  java.lang.String toStringInternal()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Filter

public Filter()
Method Detail

matchMessageType

public abstract boolean matchMessageType(java.util.Collection<MessageType> messageTypes)
True if the given messageTypes intersects the filter's message types.

Specified by:
matchMessageType in interface IFilter

matchRemaining

public abstract boolean matchRemaining(Message message)
True if the message matches the filter criteria. The message type will already have been matched, so there's no need to check it again.

Specified by:
matchRemaining in interface IFilter

getMessageTypes

public abstract java.util.Collection<MessageType> getMessageTypes()
Returns the filter's message types.

Specified by:
getMessageTypes in interface IFilter

applyFilterUpdate

public boolean applyFilterUpdate(FilterUpdate update,
                                 AgentHandle sender,
                                 SubscriptionHandle sub)
Update the filter according to the instructions in udpate.

Specified by:
applyFilterUpdate in interface IFilter

applyFilterUpdate

public boolean applyFilterUpdate(FilterUpdate update)
Update the filter according to the instructions in udpate.


getSendFilterTable

public FilterTable getSendFilterTable()
Returns filter table used to collect this kind of filter.

Specified by:
getSendFilterTable in interface IFilter
Returns:
null to force use of DefaultFilterTable.

getReceiveFilterTable

public FilterTable getReceiveFilterTable()
Returns filter table used to collect this kind of filter.

Specified by:
getReceiveFilterTable in interface IFilter
Returns:
null to force use of DefaultFilterTable.

getResponderSendFilterTable

public FilterTable getResponderSendFilterTable()
Returns filter table used to collect this kind of filter.

Specified by:
getResponderSendFilterTable in interface IFilter
Returns:
null to force use of DefaultFilterTable.

getResponderReceiveFilterTable

public FilterTable getResponderReceiveFilterTable()
Returns filter table used to collect this kind of filter.

Specified by:
getResponderReceiveFilterTable in interface IFilter
Returns:
null to force use of DefaultFilterTable.

toStringInternal

protected java.lang.String toStringInternal()


Copyright © 2018 Dragonsan Studios Sp. z o.o.