public final class JCREventHelper extends Object implements Component
EventHolder in JCR.| Modifier and Type | Field and Description |
|---|---|
private static String |
__EVENT_HOLDER_NODE_NAME |
private static String |
__EVENT_NAME_PREFIX |
private static String |
__NODETYPE_EVENT |
private static String |
__NODETYPE_EVENT_ELEMENT |
| Modifier | Constructor and Description |
|---|---|
private |
JCREventHelper() |
| Modifier and Type | Method and Description |
|---|---|
private static String[] |
_getHashedPath(String name)
Computes a hashed path in the JCR tree from the name of the child object.
Subclasses may override this method to provide a more suitable hash function. This implementation relies on the buzhash algorithm. |
static Node |
addEventNode(EventHolder eventHolder,
Date eventDate,
String eventType,
UserIdentity author)
Add an event node
|
static NodeIterator |
getEvents(EventHolder eventHolder)
Returns the event child nodes
|
static NodeIterator |
getEvents(EventHolder eventHolder,
String[] types)
Returns the events sorted by ascending date
|
static Node |
getEventsRootNode(Node node)
Get the node holding the JCR events under the given node
|
static String |
getEventXPathQuery(EventHolder eventHolder,
Expression eventExpression,
SortCriteria sortCriteria)
Creates the XPath query corresponding to specified
Expression. |
private static final String __EVENT_HOLDER_NODE_NAME
private static final String __NODETYPE_EVENT
private static final String __NODETYPE_EVENT_ELEMENT
private static final String __EVENT_NAME_PREFIX
private JCREventHelper()
public static Node getEventsRootNode(Node node) throws RepositoryException
node - The parent nodeRepositoryException - if an error occurredpublic static NodeIterator getEvents(EventHolder eventHolder) throws RepositoryException
eventHolder - The event holderRepositoryException - if an error occurredpublic static NodeIterator getEvents(EventHolder eventHolder, String[] types) throws RepositoryException
eventHolder - The event holdertypes - The types of events to return. Can be null to get all eventsRepositoryException - if an error occurredpublic static String getEventXPathQuery(EventHolder eventHolder, Expression eventExpression, SortCriteria sortCriteria) throws RepositoryException
Expression.eventHolder - the event holdereventExpression - the query predicates.sortCriteria - the sort criteria.RepositoryException - if an error occurredpublic static Node addEventNode(EventHolder eventHolder, Date eventDate, String eventType, UserIdentity author) throws RepositoryException
eventHolder - The event holdereventDate - The event's dateeventType - The event's typeauthor - The event's authorRepositoryException - if an error occurredprivate static String[] _getHashedPath(String name)
name - the name of the child object