org.xwiki.eventstream
Interface Event


public interface Event

A recorded event that occurred at some point in the wiki.

Events are identified by:

Events contain:

Events are categorized into:

  1. the the application that created them, like blog, user statuses, or the general wiki
  2. an eventual sub-stream inside the application, for example a space for wiki events, or a certain group for user statuses
  3. the particular type of event, like adding a comment, updating an attachment, setting a new user status

Events target:

  1. the wiki,
  2. the space,
  3. and the document affected by the event,
  4. and an eventual entity inside the document, for example an individual attachment for attachment events, or an individual object for comment events.

Events can store some more information about the context in which they occur:

Since:
3.0M2
Version:
$Id: f94ef72a778cad0362960da4d1f0abb5ce5b6538 $

Nested Class Summary
static class Event.Importance
          The importance of an event.
 
Method Summary
 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.
 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.
 String getId()
          Each event has a unique ID.
 Event.Importance getImportance()
          Different events can have a different importance.
 Map<String,String> getParameters()
           
 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 the main related document.
 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.
 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.
 void setApplication(String application)
           
 void setBody(String body)
           
 void setDate(Date date)
           
 void setDocument(DocumentReference document)
           
 void setDocumentTitle(String title)
           
 void setDocumentVersion(String version)
           
 void setGroupId(String id)
           
 void setId(String id)
           
 void setImportance(Event.Importance importance)
           
 void setParameters(Map<String,String> parameters)
           
 void setRelatedEntity(EntityReference entity)
           
 void setSpace(SpaceReference space)
           
 void setStream(String stream)
           
 void setTitle(String title)
           
 void setType(String type)
           
 void setUrl(URL url)
           
 void setUser(DocumentReference user)
           
 void setWiki(WikiReference wiki)
           
 

Method Detail

getId

String getId()
Each event has a unique ID.

Returns:
the unique ID of the event

setId

void setId(String id)
Parameters:
id - the unique ID of the event to set
See Also:
getId()

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

setDate

void setDate(Date date)
Parameters:
date - the event date
See Also:
getDate()

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

setBody

void setBody(String body)
Parameters:
body - the body of the event
See Also:
getBody()

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

setType

void setType(String type)
Parameters:
type - The type of the event
See Also:
getType()

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 the main 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

setUrl

void setUrl(URL url)
Parameters:
url - the URL related to the event
See Also:
getUrl()

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

Map<String,String> getParameters()
Returns:
the named parameters associated with this event as key/value pairs.

setParameters

void setParameters(Map<String,String> parameters)
Parameters:
parameters - the parameters to associate to the event.
See Also:
getParameters()


Copyright © 2004-2013 XWiki. All Rights Reserved.