Package org.xwiki.eventstream
Interface Event
-
public interface Event
A recorded event that occurred at some point in the wiki.Events are identified by:
- an
identifier
unique for each event - a
group identifier
used for all the events caused during the same action - the
exact date and time
when the event occurred - an
importance
which allows to order events in the same group, or in the same stream
- a
title
- a
body
- and a map of
parameters
- the
the application
that created them, like blog, user statuses, or the general wiki - an
eventual sub-stream
inside the application, for example a space for wiki events, or a certain group for user statuses - the
particular type
of event, like adding a comment, updating an attachment, setting a new user status
- the
wiki
, - the
space
, - and the
document
affected by the event, - and an eventual
entity
inside the document, for example an individual attachment for attachment events, or an individual object for comment events.
- the
user
that caused the event - the
version
of the target document at the time that the event occurred - the
display title
of the target document at the time that the event occurred - the
requested URL
that caused the event
EventFactory
to create a newEvent
instance.- Since:
- 3.0M2
- Version:
- $Id: 8cd712c8a54c6deeadd91da01c41b2e5dc862637 $
- an
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Event.Importance
The importance of an event.
-
Field Summary
Fields Modifier and Type Field Description static String
FIELD_APPLICATION
static String
FIELD_BODY
static String
FIELD_DATE
static String
FIELD_DOCUMENT
static String
FIELD_DOCUMENTTITLE
static String
FIELD_DOCUMENTVERSION
static String
FIELD_GROUPID
static String
FIELD_HIDDEN
static String
FIELD_ID
static String
FIELD_IMPORTANCE
static String
FIELD_PREFILTERED
static String
FIELD_RELATEDENTITY
static String
FIELD_REMOTE_OBSERVATION_ID
static String
FIELD_SPACE
static String
FIELD_STREAM
static String
FIELD_TARGET
static String
FIELD_TITLE
static String
FIELD_TYPE
static String
FIELD_URL
static String
FIELD_USER
static String
FIELD_WIKI
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description String
getApplication()
Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...String
getBody()
A larger section of text where the event can store some data.default Map<String,Object>
getCustom()
Date
getDate()
An event happens at a precise date.DocumentReference
getDocument()
Document-related events target a certain document.String
getDocumentTitle()
The document title is usually more important than the document name.String
getDocumentVersion()
For events related to documents, this field records the version of the document at the time when the event occurred.String
getGroupId()
Multiple events can correspond to the same activity, so events can be grouped under the same GroupID.default boolean
getHidden()
String
getId()
Each event has a unique ID.Event.Importance
getImportance()
Different events can have a different importance.Map<String,String>
getParameters()
Deprecated.usegetCustom()
insteadEntityReference
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
.default String
getRemoteObservationId()
SpaceReference
getSpace()
Document-related events target a certain document, and documents belong to a space; this is the space of the target document.String
getStream()
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()
String
getTitle()
A name for the event.String
getType()
Events have different types: adding a comment, updating an attachment, importing an application, etc.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.DocumentReference
getUser()
Event usually occur as the result of a registered user activity.WikiReference
getWiki()
In a wiki farm, each event happens in one of the wikis.default boolean
isPrefiltered()
void
setApplication(String application)
void
setBody(String body)
default void
setCustom(Map<String,?> custom)
Associate the event with custom named values.void
setDate(Date date)
void
setDocument(DocumentReference document)
void
setDocumentTitle(String title)
void
setDocumentVersion(String version)
void
setGroupId(String id)
default void
setHidden(boolean isHidden)
void
setId(String id)
void
setImportance(Event.Importance importance)
void
setParameters(Map<String,String> parameters)
Deprecated.usesetCustom(Map)
insteaddefault void
setPrefiltered(boolean prefiltered)
void
setRelatedEntity(EntityReference entity)
void
setSpace(SpaceReference space)
void
setStream(String stream)
default void
setTarget(Set<String> target)
void
setTitle(String title)
void
setType(String type)
void
setUrl(URL url)
void
setUser(DocumentReference user)
void
setWiki(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
EventStore
implementation 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
null
if the event was produced in a version of XWiki older than 14.7 - Since:
- 14.7RC1
-
-