org.jwall.web.audit.rules
Class AuditEventRule

java.lang.Object
  extended by org.jwall.web.audit.rules.AuditEventRule
All Implemented Interfaces:
EventRule<AuditEvent>

public class AuditEventRule
extends Object
implements EventRule<AuditEvent>

This class implements a simple rule, which can be applied to an audit-event and may trigger a set of actions. Thus, basically an event-rule is an event-filter plus some event-actions.

Author:
Christian Bockermann <chris@jwall.org>

Field Summary
static Class<?>[] CLASSES
           
static String MATCH_ALL_FILTERS
           
static String MATCH_ANY_FILTER
           
 
Constructor Summary
AuditEventRule()
           
 
Method Summary
 boolean add(Condition filter)
           
 boolean add(EventAction action)
           
 boolean equals(Object o)
           
 List<EventAction> getActions()
           
 String getComment()
           
 List<Condition> getConditions()
           
 String getMatch()
           
 int hashCode()
           
 boolean isEnabled()
           
 boolean isMatchAll()
           
 boolean matches(AuditEvent evt, RuleContext ctx)
          This method checks whether the rule triggers for the given event.
 Object readResolve()
           
 boolean remove(Condition filter)
           
 boolean remove(EventAction action)
           
 boolean removeAction(int i)
           
 boolean removeCondition(int i)
           
 void setActions(Set<EventAction> actions)
           
 void setComment(String comment)
           
 void setConditions(List<Condition> filters)
           
 void setEnabled(boolean enabled)
           
 void setMatch(String match)
           
 void setMatchAll(boolean b)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MATCH_ANY_FILTER

public static final String MATCH_ANY_FILTER
See Also:
Constant Field Values

MATCH_ALL_FILTERS

public static final String MATCH_ALL_FILTERS
See Also:
Constant Field Values

CLASSES

public static final Class<?>[] CLASSES
Constructor Detail

AuditEventRule

public AuditEventRule()
Method Detail

matches

public boolean matches(AuditEvent evt,
                       RuleContext ctx)
This method checks whether the rule triggers for the given event.

Specified by:
matches in interface EventRule<AuditEvent>
Parameters:
evt - The event to test the rule on.
Returns:
true if the rule matches the given event, false otherwise.

isEnabled

public boolean isEnabled()
Returns:
the enabled

setEnabled

public void setEnabled(boolean enabled)
Parameters:
enabled - the enabled to set

getComment

public String getComment()
Returns:
the comment

setComment

public void setComment(String comment)
Parameters:
comment - the comment to set

getMatch

public String getMatch()
Returns:
the match

setMatch

public void setMatch(String match)
Parameters:
match - the match to set

isMatchAll

public boolean isMatchAll()

setMatchAll

public void setMatchAll(boolean b)

getConditions

public List<Condition> getConditions()
Returns:
the filters

setConditions

public void setConditions(List<Condition> filters)
Parameters:
filters - the filters to set

add

public boolean add(Condition filter)

remove

public boolean remove(Condition filter)

removeCondition

public boolean removeCondition(int i)

add

public boolean add(EventAction action)

remove

public boolean remove(EventAction action)

removeAction

public boolean removeAction(int i)

getActions

public List<EventAction> getActions()
Returns:
the actions

setActions

public void setActions(Set<EventAction> actions)
Parameters:
actions - the actions to set

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

readResolve

public Object readResolve()

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2012 jwall.org. All Rights Reserved.