Class DenyCommandNameFilter
java.lang.Object
org.axonframework.commandhandling.distributed.commandfilter.DenyCommandNameFilter
- All Implemented Interfaces:
Serializable,CommandMessageFilter
A
CommandMessageFilter implementation which denies CommandMessages based on their CommandMessage.getCommandName(). It can be combined with other CommandMessageFilter instances in an
efficient manner.- Since:
- 3.0
- Author:
- Koen Lavooij, Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDenyCommandNameFilter(String commandName) Initializes aDenyCommandNameFilterfor a singlecommandName.DenyCommandNameFilter(Set<String> commandNames) Initializes aDenyCommandNameFilterfrom the given set ofcommandNames. -
Method Summary
Modifier and TypeMethodDescriptionand(CommandMessageFilter other) Returns a filter that matches when both this instance and the givenothermatch.booleaninthashCode()booleanmatches(CommandMessage<?> commandMessage) Indicates whether the givencommandMessagematches this filter.or(CommandMessageFilter other) Returns a filter that matches when either this instance or the givenothermatches.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.commandhandling.distributed.CommandMessageFilter
negate
-
Constructor Details
-
DenyCommandNameFilter
Initializes aDenyCommandNameFilterfrom the given set ofcommandNames. Commands with a name that is present in this set will be blocked by this filter.- Parameters:
commandNames- the names of commands blocked by this filter
-
DenyCommandNameFilter
Initializes aDenyCommandNameFilterfor a singlecommandName. Commands with a name equal to the given commandName will be blocked by this filter.- Parameters:
commandName- the name of the command blocked by this filter
-
-
Method Details
-
matches
Description copied from interface:CommandMessageFilterIndicates whether the givencommandMessagematches this filter.- Specified by:
matchesin interfaceCommandMessageFilter- Parameters:
commandMessage- the message to match- Returns:
trueif the command matches, otherwisefalse
-
and
Description copied from interface:CommandMessageFilterReturns a filter that matches when both this instance and the givenothermatch.- Specified by:
andin interfaceCommandMessageFilter- Parameters:
other- the other filter to match against- Returns:
- a filter that matches when both this instance and the other match
-
or
Description copied from interface:CommandMessageFilterReturns a filter that matches when either this instance or the givenothermatches.- Specified by:
orin interfaceCommandMessageFilter- Parameters:
other- the other filter to match against- Returns:
- a filter that matches when either this instance or the other matches
-
equals
-
hashCode
public int hashCode() -
toString
-