|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.dna.repository.observation.ObservationService
public class ObservationService
Nested Class Summary | |
---|---|
class |
ObservationService.DefaultProblemLog
Problem log implementation that records problems in the log. |
static interface |
ObservationService.ProblemLog
Interface to which problems with particular events are logged. |
class |
ObservationService.Statistics
The statistics for the system. |
class |
ObservationService.WorkspaceListener
Implementation of the JCR EventListener interface, returned by the sequencing system. |
Field Summary | |
---|---|
static ObservationService.ProblemLog |
NO_OP_PROBLEM_LOG
|
Constructor Summary | |
---|---|
ObservationService(SessionFactory sessionFactory)
|
Method Summary | |
---|---|
boolean |
addListener(javax.jcr.observation.EventListener listener)
|
boolean |
addListener(NodeChangeListener listener)
|
ServiceAdministrator |
getAdministrator()
|
Logger |
getLogger()
Get the logger for this system |
ObservationService.ProblemLog |
getProblemLog()
|
SessionFactory |
getSessionFactory()
|
ObservationService.Statistics |
getStatistics()
Get the statistics for this system. |
ObservationService.WorkspaceListener |
monitor(String repositoryWorkspaceName,
int eventTypes,
String... nodeTypeNames)
Monitor the supplied workspace for the supplied event types on any node in the workspace. |
ObservationService.WorkspaceListener |
monitor(String repositoryWorkspaceName,
String absolutePath,
int eventTypes,
boolean isDeep,
String[] uuids,
String[] nodeTypeNames,
boolean noLocal)
Monitor the supplied workspace for events of the given type on any node at or under the supplied path. |
ObservationService.WorkspaceListener |
monitor(String repositoryWorkspaceName,
String absolutePath,
String... nodeTypeNames)
Monitor the supplied workspace for default event types on any node at or
under the supplied path. |
boolean |
removeListener(javax.jcr.observation.EventListener listener)
|
boolean |
removeListener(NodeChangeListener listener)
|
void |
setLogger(Logger logger)
Set the logger for this system. |
void |
setProblemLog(ObservationService.ProblemLog problemLog)
Set the problem log that will be notified of problems handling events. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final ObservationService.ProblemLog NO_OP_PROBLEM_LOG
Constructor Detail |
---|
public ObservationService(SessionFactory sessionFactory)
Method Detail |
---|
public ServiceAdministrator getAdministrator()
getAdministrator
in interface AdministeredService
public SessionFactory getSessionFactory()
public ObservationService.Statistics getStatistics()
public Logger getLogger()
public void setLogger(Logger logger)
logger
- the logger, or null if the standard logging should be usedpublic ObservationService.ProblemLog getProblemLog()
public void setProblemLog(ObservationService.ProblemLog problemLog)
problemLog
- the new problem log implementation; if null, then the default problem log is usedpublic boolean addListener(javax.jcr.observation.EventListener listener)
public boolean removeListener(javax.jcr.observation.EventListener listener)
public boolean addListener(NodeChangeListener listener)
public boolean removeListener(NodeChangeListener listener)
public ObservationService.WorkspaceListener monitor(String repositoryWorkspaceName, String absolutePath, int eventTypes, boolean isDeep, String[] uuids, String[] nodeTypeNames, boolean noLocal) throws javax.jcr.RepositoryException
Monitoring is accomplished by registering a listener on the workspace, so this monitoring only has access to the
information that visible to the session created by the session factory
for the given
repository and workspace name.
The listener returned from this method is not managed by this SequencingService instance. If the listener is no longer
needed, it simply must be removed
as a listener of the
workspace and garbage collected. If this service is shutdown
while there are still
active listeners, those listeners will disconnect themselves from this service and the workspace with which they're
registered when they attempt to forward the next events.
The set of events that are monitored can be filtered by specifying restrictions based on characteristics of the node
associated with the event. In the case of event types NODE_ADDED
and
NODE_REMOVED
, the node associated with an event is the node at (or formerly at) the path
returned by Event.getPath()
. In the case of event types
PROPERTY_ADDED
, PROPERTY_REMOVED
and
PROPERTY_CHANGED
, the node associated with an event is the parent node of the property at
(or formerly at) the path returned by Event.getPath
:
absolutePath
, isDeep
: Only events whose associated node is at
absolutePath
(or within its subtree, if isDeep
is true
) will be received. It
is permissible to register a listener for a path where no node currently exists. uuids
: Only events whose associated node has one of the UUIDs in this list will be received. If his
parameter is null
then no UUID-related restriction is placed on events received. nodeTypeNames
: Only events whose associated node has one of the node types (or a subtype of one of the
node types) in this list will be received. If this parameter is null
then no node type-related restriction
is placed on events received.
Additionally, if noLocal
is true
, then events generated by the session through which the
listener was registered are ignored. Otherwise, they are not ignored.
The filters of an already-registered ObservationService.WorkspaceListener
can be changed at runtime by changing the attributes and
registering
.
repositoryWorkspaceName
- the name to be used with the session factory to obtain a session to the repository and
workspace that is to be monitoredabsolutePath
- the absolute path of the node at or below which changes are to be monitored; may be null if all nodes
in the workspace are to be monitoredeventTypes
- the bitmask of the Event
types that are to be monitoredisDeep
- true if events below the node given by the absolutePath
or by the uuids
are to
be processed, or false if only the events at the nodeuuids
- array of UUIDs of nodes that are to be monitored; may be null or empty if the UUIDs are not knownnodeTypeNames
- array of node type names that are to be monitored; may be null or empty if the monitoring has no node
type restrictionsnoLocal
- true if the events originating in the supplied workspace are to be ignored, or false if they are also to be
processed.
javax.jcr.RepositoryException
- if there is a problem registering the listenerpublic ObservationService.WorkspaceListener monitor(String repositoryWorkspaceName, String absolutePath, String... nodeTypeNames) throws javax.jcr.RepositoryException
default event types
on any node at or
under the supplied path.
Monitoring is accomplished by registering a listener on the workspace, so this monitoring only has access to the
information that visible to the session created by the session factory
for the given
repository and workspace name.
The listener returned from this method is not managed by this SequencingService instance. If the listener is no longer
needed, it simply must be removed
as a listener of the
workspace and garbage collected.
repositoryWorkspaceName
- the name to be used with the session factory to obtain a session to the repository and
workspace that is to be monitoredabsolutePath
- the absolute path of the node at or below which changes are to be monitored; may be null if all nodes
in the workspace are to be monitorednodeTypeNames
- the names of the node types that are to be monitored; may be null or empty if the monitoring has no
node type restrictions
javax.jcr.RepositoryException
- if there is a problem registering the listenerpublic ObservationService.WorkspaceListener monitor(String repositoryWorkspaceName, int eventTypes, String... nodeTypeNames) throws javax.jcr.RepositoryException
Monitoring is accomplished by registering a listener on the workspace, so this monitoring only has access to the
information that visible to the session created by the session factory
for the given
repository and workspace name.
The listener returned from this method is not managed by this SequencingService instance. If the listener is no longer
needed, it simply must be removed
as a listener of the
workspace and garbage collected.
repositoryWorkspaceName
- the name to be used with the session factory to obtain a session to the repository and
workspace that is to be monitoredeventTypes
- the bitmask of the Event
types that are to be monitorednodeTypeNames
- the names of the node types that are to be monitored; may be null or empty if the monitoring has no
node type restrictions
javax.jcr.RepositoryException
- if there is a problem registering the listener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |