Package org.xwiki.eventstream
Interface Event
-
public interface EventA recorded event that occurred at some point in the wiki.Events are identified by:
- an
identifierunique for each event - a
group identifierused for all the events caused during the same action - the
exact date and timewhen the event occurred - an
importancewhich allows to order events in the same group, or in the same stream
- a
title - a
body - and a map of
parameters
- the
the applicationthat created them, like blog, user statuses, or the general wiki - an
eventual sub-streaminside the application, for example a space for wiki events, or a certain group for user statuses - the
particular typeof event, like adding a comment, updating an attachment, setting a new user status
- the
wiki, - the
space, - and the
documentaffected by the event, - and an eventual
entityinside the document, for example an individual attachment for attachment events, or an individual object for comment events.
- the
userthat caused the event - the
versionof the target document at the time that the event occurred - the
display titleof the target document at the time that the event occurred - the
requested URLthat caused the event
EventFactoryto create a newEventinstance.- Since:
- 3.0M2
- Version:
- $Id: 8cd712c8a54c6deeadd91da01c41b2e5dc862637 $
- an
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classEvent.ImportanceThe importance of an event.
-
Field Summary
Fields Modifier and Type Field Description static StringFIELD_APPLICATIONstatic StringFIELD_BODYstatic StringFIELD_DATEstatic StringFIELD_DOCUMENTstatic StringFIELD_DOCUMENTTITLEstatic StringFIELD_DOCUMENTVERSIONstatic StringFIELD_GROUPIDstatic StringFIELD_HIDDENstatic StringFIELD_IDstatic StringFIELD_IMPORTANCEstatic StringFIELD_PREFILTEREDstatic StringFIELD_RELATEDENTITYstatic StringFIELD_REMOTE_OBSERVATION_IDstatic StringFIELD_SPACEstatic StringFIELD_STREAMstatic StringFIELD_TARGETstatic StringFIELD_TITLEstatic StringFIELD_TYPEstatic StringFIELD_URLstatic StringFIELD_USERstatic StringFIELD_WIKI
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description StringgetApplication()Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...StringgetBody()A larger section of text where the event can store some data.default Map<String,Object>getCustom()DategetDate()An event happens at a precise date.DocumentReferencegetDocument()Document-related events target a certain document.StringgetDocumentTitle()The document title is usually more important than the document name.StringgetDocumentVersion()For events related to documents, this field records the version of the document at the time when the event occurred.StringgetGroupId()Multiple events can correspond to the same activity, so events can be grouped under the same GroupID.default booleangetHidden()StringgetId()Each event has a unique ID.Event.ImportancegetImportance()Different events can have a different importance.Map<String,String>getParameters()Deprecated.usegetCustom()insteadEntityReferencegetRelatedEntity()Some events may be related to a more specific entity in the target document, like an attachment or an object, or may relate to another document besides themain related document.default StringgetRemoteObservationId()SpaceReferencegetSpace()Document-related events target a certain document, and documents belong to a space; this is the space of the target document.StringgetStream()Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.default Set<String>getTarget()StringgetTitle()A name for the event.StringgetType()Events have different types: adding a comment, updating an attachment, importing an application, etc.URLgetUrl()If an event happens in an URL-accessible location (a document), or if the event itself can be seen at a given URL, this field stores that URL.DocumentReferencegetUser()Event usually occur as the result of a registered user activity.WikiReferencegetWiki()In a wiki farm, each event happens in one of the wikis.default booleanisPrefiltered()voidsetApplication(String application)voidsetBody(String body)default voidsetCustom(Map<String,?> custom)Associate the event with custom named values.voidsetDate(Date date)voidsetDocument(DocumentReference document)voidsetDocumentTitle(String title)voidsetDocumentVersion(String version)voidsetGroupId(String id)default voidsetHidden(boolean isHidden)voidsetId(String id)voidsetImportance(Event.Importance importance)voidsetParameters(Map<String,String> parameters)Deprecated.usesetCustom(Map)insteaddefault voidsetPrefiltered(boolean prefiltered)voidsetRelatedEntity(EntityReference entity)voidsetSpace(SpaceReference space)voidsetStream(String stream)default voidsetTarget(Set<String> target)voidsetTitle(String title)voidsetType(String type)voidsetUrl(URL url)voidsetUser(DocumentReference user)voidsetWiki(WikiReference wiki)
-
-
-
Field Detail
-
FIELD_ID
static final String FIELD_ID
- Since:
- 12.4RC1
- See Also:
getId(), Constant Field Values
-
FIELD_GROUPID
static final String FIELD_GROUPID
- Since:
- 12.4RC1
- See Also:
getGroupId(), Constant Field Values
-
FIELD_DATE
static final String FIELD_DATE
- Since:
- 12.4RC1
- See Also:
getDate(), Constant Field Values
-
FIELD_IMPORTANCE
static final String FIELD_IMPORTANCE
- Since:
- 12.4RC1
- See Also:
getImportance(), Constant Field Values
-
FIELD_TITLE
static final String FIELD_TITLE
- Since:
- 12.4RC1
- See Also:
getTitle(), Constant Field Values
-
FIELD_BODY
static final String FIELD_BODY
- Since:
- 12.4RC1
- See Also:
getBody(), Constant Field Values
-
FIELD_APPLICATION
static final String FIELD_APPLICATION
- Since:
- 12.4RC1
- See Also:
getApplication(), Constant Field Values
-
FIELD_STREAM
static final String FIELD_STREAM
- Since:
- 12.4RC1
- See Also:
getStream(), Constant Field Values
-
FIELD_TYPE
static final String FIELD_TYPE
- Since:
- 12.4RC1
- See Also:
getType(), Constant Field Values
-
FIELD_WIKI
static final String FIELD_WIKI
- Since:
- 12.4RC1
- See Also:
getWiki(), Constant Field Values
-
FIELD_SPACE
static final String FIELD_SPACE
- See Also:
getSpace(), Constant Field Values
-
FIELD_DOCUMENT
static final String FIELD_DOCUMENT
- Since:
- 12.4RC1
- See Also:
getDocument(), Constant Field Values
-
FIELD_DOCUMENTVERSION
static final String FIELD_DOCUMENTVERSION
- Since:
- 12.4RC1
- See Also:
getDocumentVersion(), Constant Field Values
-
FIELD_RELATEDENTITY
static final String FIELD_RELATEDENTITY
- Since:
- 12.4RC1
- See Also:
getRelatedEntity(), Constant Field Values
-
FIELD_USER
static final String FIELD_USER
- Since:
- 12.4RC1
- See Also:
getUser(), Constant Field Values
-
FIELD_URL
static final String FIELD_URL
- Since:
- 12.4RC1
- See Also:
getUrl(), Constant Field Values
-
FIELD_DOCUMENTTITLE
static final String FIELD_DOCUMENTTITLE
- Since:
- 12.4RC1
- See Also:
getDocumentTitle(), Constant Field Values
-
FIELD_TARGET
static final String FIELD_TARGET
- Since:
- 12.4RC1
- See Also:
getTarget(), Constant Field Values
-
FIELD_HIDDEN
static final String FIELD_HIDDEN
- Since:
- 12.4RC1
- See Also:
getHidden(), Constant Field Values
-
FIELD_PREFILTERED
static final String FIELD_PREFILTERED
- Since:
- 12.5RC1
- See Also:
isPrefiltered(), Constant Field Values
-
FIELD_REMOTE_OBSERVATION_ID
@Unstable static final String FIELD_REMOTE_OBSERVATION_ID
- Since:
- 14.7RC1
- See Also:
getRemoteObservationId(), Constant Field Values
-
-
Method Detail
-
getId
String getId()
Each event has a unique ID.- Returns:
- the unique ID of the event
-
getGroupId
String getGroupId()
Multiple events can correspond to the same activity, so events can be grouped under the same GroupID.- Returns:
- the event group ID
-
setGroupId
void setGroupId(String id)
- Parameters:
id- the event group ID- See Also:
getGroupId()
-
getDate
Date getDate()
An event happens at a precise date.- Returns:
- the event date
-
getImportance
Event.Importance getImportance()
Different events can have a different importance. This allows to determine which events are more or less important in the same event group, or which events are important in the stream. For example, annotation automatic updates are less important in a group of changes triggered by a document update, while a major version is more important than a minor version.- Returns:
- the importance of the event
-
setImportance
void setImportance(Event.Importance importance)
- Parameters:
importance- the importance of the event- See Also:
getImportance()
-
getTitle
String getTitle()
A name for the event.- Returns:
- the title of the event
-
setTitle
void setTitle(String title)
- Parameters:
title- the title of the event- See Also:
getTitle()
-
getBody
String getBody()
A larger section of text where the event can store some data.- Returns:
- the body of the event
-
getApplication
String getApplication()
Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...- Returns:
- the application name
-
setApplication
void setApplication(String application)
- Parameters:
application- the application Name- See Also:
getApplication()
-
getStream
String getStream()
Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.- Returns:
- the stream name
-
setStream
void setStream(String stream)
- Parameters:
stream- the stream Name- See Also:
getStream()
-
getType
String getType()
Events have different types: adding a comment, updating an attachment, importing an application, etc.- Returns:
- The type of the event
-
getWiki
WikiReference getWiki()
In a wiki farm, each event happens in one of the wikis.- Returns:
- the wiki name in which the event was created
-
setWiki
void setWiki(WikiReference wiki)
- Parameters:
wiki- the wiki name in which the event was created- See Also:
getWiki()
-
getSpace
SpaceReference getSpace()
Document-related events target a certain document, and documents belong to a space; this is the space of the target document.- Returns:
- the space in which the event was created
-
setSpace
void setSpace(SpaceReference space)
- Parameters:
space- the space in which the event was created- See Also:
getSpace()
-
getDocument
DocumentReference getDocument()
Document-related events target a certain document.- Returns:
- the document related to the event
-
setDocument
void setDocument(DocumentReference document)
- Parameters:
document- the document related to the event- See Also:
getDocument()
-
getDocumentVersion
String getDocumentVersion()
For events related to documents, this field records the version of the document at the time when the event occurred.- Returns:
- the document version when the event occurred
-
setDocumentVersion
void setDocumentVersion(String version)
- Parameters:
version- the document version when the event occurred- See Also:
getDocumentVersion()
-
getRelatedEntity
EntityReference getRelatedEntity()
Some events may be related to a more specific entity in the target document, like an attachment or an object, or may relate to another document besides themain related document. The result of this method depends on the actual event type.- Returns:
- the eventual entity related to the event, may be
null
-
setRelatedEntity
void setRelatedEntity(EntityReference entity)
- Parameters:
entity- the eventual entity related to the event- See Also:
getRelatedEntity()
-
getUser
DocumentReference getUser()
Event usually occur as the result of a registered user activity.- Returns:
- the user creating the event
-
setUser
void setUser(DocumentReference user)
- Parameters:
user- the user creating the event- See Also:
getUser()
-
getUrl
URL getUrl()
If an event happens in an URL-accessible location (a document), or if the event itself can be seen at a given URL, this field stores that URL.- Returns:
- the URL related to the event
-
getDocumentTitle
String getDocumentTitle()
The document title is usually more important than the document name. Since getting the title of a document version is a difficult task, store it in the event for faster and safer access.- Returns:
- the title of the related document when the event occurred.
-
setDocumentTitle
void setDocumentTitle(String title)
- Parameters:
title- the title of the related document when the event occurred.- See Also:
getDocumentTitle()
-
getParameters
@Deprecated(since="14.2RC1") Map<String,String> getParameters()
Deprecated.usegetCustom()instead- Returns:
- the named parameters associated with this event as key/value pairs.
-
setParameters
@Deprecated(since="14.2RC1") void setParameters(Map<String,String> parameters)
Deprecated.usesetCustom(Map)instead- Parameters:
parameters- the parameters to associate to the event.- See Also:
getParameters()
-
getCustom
default Map<String,Object> getCustom()
- Returns:
- the custom properties associated with this event
- Since:
- 14.2RC1
-
setCustom
default void setCustom(Map<String,?> custom)
Associate the event with custom named values.The exactly list of supported types can vary depending on the
EventStoreimplementation but it's expected that at least the following are supported:- String
- All standard primitive wrappers (Boolean, Integer, etc)
- java.util.Date
- Iterable and arrays of other supported types
- Parameters:
custom- the custom properties associated with this event- Since:
- 14.2RC1
-
setTarget
default void setTarget(Set<String> target)
- Parameters:
target- a list of entities (users, groups) that are interested by this event- Since:
- 9.2RC1
-
getTarget
default Set<String> getTarget()
- Returns:
- a list of entities (users, groups) that are interested by this event
- Since:
- 9.2RC1
-
getHidden
default boolean getHidden()
- Returns:
- if the event should be hidden or not
- Since:
- 11.1RC1
-
setHidden
default void setHidden(boolean isHidden)
- Parameters:
isHidden- if the event should be hidden or not- Since:
- 11.1RC1
-
isPrefiltered
default boolean isPrefiltered()
- Returns:
- true if the event has already been prefiltered
- Since:
- 11.5RC1
-
setPrefiltered
default void setPrefiltered(boolean prefiltered)
- Parameters:
prefiltered- true if the event has already been prefiltered- Since:
- 11.5RC1
-
getRemoteObservationId
@Unstable default String getRemoteObservationId()
- Returns:
- the unique identifier of the instance in the cluster, or
nullif the event was produced in a version of XWiki older than 14.7 - Since:
- 14.7RC1
-
-