Class JackrabbitEventFilter
- java.lang.Object
-
- org.apache.jackrabbit.api.observation.JackrabbitEventFilter
-
- Direct Known Subclasses:
OakEventFilter
@ConsumerType public class JackrabbitEventFilter extends Object
A storage object for event filter configuration.The parameters of the filter can then be set by chaining the set methods, since each method returns the same
EventFilterwith the indicated parameter set.Once the filter is configured, it and an
EventListenerobject are passed toJackrabbitObservationManager.addEventListener(javax.jcr.observation.EventListener, JackrabbitEventFilter).The filter restricts which events are sent to the
EventListeneraccording to the following parameters. Note that the term associated parent node of an event means the parent node of the item at (or formerly at) the path returned byEvent.getPath().-
eventTypes: A bitwiseORof the event types to be listened to. SeeEventfor details. -
absPath,absPaths,excludedPaths,isDeep: Only events whose associated parent node is at one of the paths inabsPathorabsPaths(or within its subgraph, ifisDeepistrue) will be received except if the associated parent node is at one of the paths inexcludedPathsor its subgraph. It is permissible to register a listener for a path where no node currently exists. -
uuid: Only events whose associated parent node has one of the identifiers in this list will be received. If his parameter isnullthen no identifier-related restriction is placed on events received. Note that specifying an empty array instead ofnullwould result in no nodes being listened to. The term "UUID" is used for compatibility with JCR 1.0. -
nodeTypeName: Only events whose associated parent node has one of the node types (or a subtype of one of the node types) in this list will be received. If his parameter isnullthen no node type-related restriction is placed on events received. Note that specifying an empty array instead ofnullwould result in no nodes types being listened to. -
noLocal: iftrue, then events generated by the session through which the listener was registered are ignored. Otherwise, they are not ignored. -
noExternal: iftrue, then events from external cluster nodes are ignored. Otherwise, they are not ignored. -
noInternal: iftrue, then events from this cluster node are ignored. Otherwise, they are not ignored.
-
-
Constructor Summary
Constructors Constructor Description JackrabbitEventFilter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAbsPath()Returns theabsPathparameter of the filter.String[]getAdditionalPaths()Returns theabsPathsparameter of the filter.intgetEventTypes()Returns theeventTypesparameter of the filter.String[]getExcludedPaths()Returns theexcludedPathsparameter of the filter.String[]getIdentifiers()Returns theuuidsparameter of the filter.booleangetIsDeep()Returns theisDeepparameter of the filter.String[]getNodeTypes()Returns thenodeTypeNameparameter of the filter.booleangetNoExternal()Returns thenoExternalparameter of the filter.booleangetNoInternal()Returns thenoInternalparameter of the filter.booleangetNoLocal()Returns thenoLocalparameter of the filter.JackrabbitEventFiltersetAbsPath(String absPath)Sets theabsPathparameter of the filter.JackrabbitEventFiltersetAdditionalPaths(String... absPaths)Sets theabsPathsparameter of the filter.JackrabbitEventFiltersetEventTypes(int eventTypes)Sets theeventTypesparameter of the filter.JackrabbitEventFiltersetExcludedPaths(String... excludedPaths)Sets theexcludedPathsparameter of the filter.JackrabbitEventFiltersetIdentifiers(String[] identifiers)Sets theidentifiersparameter of the filter.JackrabbitEventFiltersetIsDeep(boolean isDeep)Sets theisDeepparameter of the filter.JackrabbitEventFiltersetNodeTypes(String[] nodeTypeNames)Sets thenodeTypeNamesparameter of the filter.JackrabbitEventFiltersetNoExternal(boolean noExternal)Sets thenoExternalparameter of the filter.JackrabbitEventFiltersetNoInternal(boolean noInternal)Sets thenoInternalparameter of the filter.JackrabbitEventFiltersetNoLocal(boolean noLocal)Sets thenoLocalparameter of the filter.
-
-
-
Method Detail
-
setEventTypes
public JackrabbitEventFilter setEventTypes(int eventTypes)
Sets theeventTypesparameter of the filter. If left unset, this parameter defaults to0.- Parameters:
eventTypes- anint.- Returns:
- This EventFilter object with the
eventTypesparameter set.
-
getEventTypes
public int getEventTypes()
Returns theeventTypesparameter of the filter.- Returns:
- an
int.
-
setAbsPath
public JackrabbitEventFilter setAbsPath(String absPath)
Sets theabsPathparameter of the filter. If left unset, this parameter defaults tonull.- Parameters:
absPath- an absolute pathString.- Returns:
- This EventFilter object with the
absPathparameter set.
-
getAbsPath
public String getAbsPath()
Returns theabsPathparameter of the filter.- Returns:
- a
String.
-
setIsDeep
public JackrabbitEventFilter setIsDeep(boolean isDeep)
Sets theisDeepparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
isDeep- aboolean.- Returns:
- This EventFilter object with the
isDeepparameter set.
-
getIsDeep
public boolean getIsDeep()
Returns theisDeepparameter of the filter.- Returns:
- a
boolean.
-
setIdentifiers
public JackrabbitEventFilter setIdentifiers(String[] identifiers)
Sets theidentifiersparameter of the filter. If left unset, this parameter defaults tonull.- Parameters:
identifiers- aStringarray.- Returns:
- This EventFilter object with the
identifiersparameter set.
-
getIdentifiers
public String[] getIdentifiers()
Returns theuuidsparameter of the filter.- Returns:
- a
Stringarray.
-
setNodeTypes
public JackrabbitEventFilter setNodeTypes(String[] nodeTypeNames)
Sets thenodeTypeNamesparameter of the filter. If left unset, this parameter defaults tonull.- Parameters:
nodeTypeNames- aStringarray.- Returns:
- This EventFilter object with the
nodeTypesparameter set.
-
getNodeTypes
public String[] getNodeTypes()
Returns thenodeTypeNameparameter of the filter.- Returns:
- a
Stringarray.
-
setNoLocal
public JackrabbitEventFilter setNoLocal(boolean noLocal)
Sets thenoLocalparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
noLocal- aboolean.- Returns:
- This EventFilter object with the
noLocalparameter set.
-
getNoLocal
public boolean getNoLocal()
Returns thenoLocalparameter of the filter.- Returns:
- a
boolean.
-
setAdditionalPaths
public JackrabbitEventFilter setAdditionalPaths(String... absPaths)
Sets theabsPathsparameter of the filter. If left unset, this parameter defaults to an empty array.- Parameters:
absPaths- an absolute pathStringarray.- Returns:
- This EventFilter object with the
absPathsparameter set.
-
getAdditionalPaths
public String[] getAdditionalPaths()
Returns theabsPathsparameter of the filter.- Returns:
- a
Stringarray.
-
setExcludedPaths
public JackrabbitEventFilter setExcludedPaths(String... excludedPaths)
Sets theexcludedPathsparameter of the filter. If left unset, this parameter defaults to an empty array.- Parameters:
excludedPaths- an absolute pathStringarray.- Returns:
- This EventFilter object with the
excludedPathsparameter set.
-
getExcludedPaths
public String[] getExcludedPaths()
Returns theexcludedPathsparameter of the filter.- Returns:
- a
Stringarray.
-
setNoExternal
public JackrabbitEventFilter setNoExternal(boolean noExternal)
Sets thenoExternalparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
noExternal- aboolean.- Returns:
- This EventFilter object with the
noExternalparameter set.
-
getNoExternal
public boolean getNoExternal()
Returns thenoExternalparameter of the filter.- Returns:
- a
boolean.
-
setNoInternal
public JackrabbitEventFilter setNoInternal(boolean noInternal)
Sets thenoInternalparameter of the filter. If left unset, this parameter defaults tofalse.- Parameters:
noInternal- aboolean.- Returns:
- This EventFilter object with the
noExternalparameter set.
-
getNoInternal
public boolean getNoInternal()
Returns thenoInternalparameter of the filter.- Returns:
- a
boolean.
-
-