org.xwiki.eventstream.internal
Class DefaultEvent

java.lang.Object
  extended by org.xwiki.eventstream.internal.DefaultEvent
All Implemented Interfaces:
Event

public class DefaultEvent
extends java.lang.Object
implements Event

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

Version:
$Id$

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.xwiki.eventstream.Event
Event.Importance
 
Constructor Summary
DefaultEvent()
           
 
Method Summary
 java.lang.String getApplication()
          Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...
 java.lang.String getBody()
          A larger section of text where the event can store some data.
 java.util.Date getDate()
          An event happens at a precise date.
 DocumentReference getDocument()
          Document-related events target a certain document.
 java.lang.String getDocumentTitle()
          The document title is usually more important than the document name.
 java.lang.String getDocumentVersion()
          For events related to documents, this field records the version of the document at the time when the event occurred.
 java.lang.String getGroupId()
          Multiple events can correspond to the same activity, so events can be grouped under the same GroupID.
 java.lang.String getId()
          Each event has a unique ID.
 Event.Importance getImportance()
          Different events can have a different importance.
 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.
 java.lang.String getStream()
          Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.
 java.lang.String getTitle()
          A name for the event.
 java.lang.String getType()
          Events have different types: adding a comment, updating an attachment, importing an application, etc.
 java.net.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(java.lang.String application)
          
 void setBody(java.lang.String body)
          
 void setDate(java.util.Date date)
          
 void setDocument(DocumentReference document)
          
 void setDocumentTitle(java.lang.String title)
          
 void setDocumentVersion(java.lang.String version)
          
 void setGroupId(java.lang.String id)
          
 void setId(java.lang.String id)
          
 void setImportance(Event.Importance importance)
          
 void setRelatedEntity(EntityReference entity)
          
 void setSpace(SpaceReference space)
          
 void setStream(java.lang.String stream)
          
 void setTitle(java.lang.String title)
          
 void setType(java.lang.String type)
          
 void setUrl(java.net.URL url)
          
 void setUser(DocumentReference user)
          
 void setWiki(WikiReference wiki)
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultEvent

public DefaultEvent()
Method Detail

getId

public java.lang.String getId()
Each event has a unique ID.

Specified by:
getId in interface Event
Returns:
the unique ID of the event
See Also:
Event.getId()

setId

public void setId(java.lang.String id)

Specified by:
setId in interface Event
Parameters:
id - the unique ID of the event to set
See Also:
Event.setId(String), getId()

getGroupId

public java.lang.String getGroupId()
Multiple events can correspond to the same activity, so events can be grouped under the same GroupID.

Specified by:
getGroupId in interface Event
Returns:
the event group ID
See Also:
Event.getGroupId()

setGroupId

public void setGroupId(java.lang.String id)

Specified by:
setGroupId in interface Event
Parameters:
id - the event group ID
See Also:
Event.setGroupId(String), getGroupId()

getType

public java.lang.String getType()
Events have different types: adding a comment, updating an attachment, importing an application, etc.

Specified by:
getType in interface Event
Returns:
The type of the event
See Also:
Event.getType()

setType

public void setType(java.lang.String type)

Specified by:
setType in interface Event
Parameters:
type - The type of the event
See Also:
Event.setType(String), getType()

getDate

public java.util.Date getDate()
An event happens at a precise date.

Specified by:
getDate in interface Event
Returns:
the event date
See Also:
Event.getDate()

setDate

public void setDate(java.util.Date date)

Specified by:
setDate in interface Event
Parameters:
date - the event date
See Also:
Event.setDate(Date), getDate()

getImportance

public 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.

Specified by:
getImportance in interface Event
Returns:
the importance of the event
See Also:
Event.getImportance()

setImportance

public void setImportance(Event.Importance importance)

Specified by:
setImportance in interface Event
Parameters:
importance - the importance of the event
See Also:
Event.setImportance(org.xwiki.eventstream.Event.Importance), getImportance()

getApplication

public java.lang.String getApplication()
Events can be triggered by different applications, not only the main wiki update events: user statuses, blog pingbacks, new extension added...

Specified by:
getApplication in interface Event
Returns:
the application name
See Also:
Event.getApplication()

setApplication

public void setApplication(java.lang.String application)

Specified by:
setApplication in interface Event
Parameters:
application - the application Name
See Also:
Event.setApplication(String), getApplication()

getStream

public java.lang.String getStream()
Events can happen in different contexts; for example, wiki activity events happen in different spaces, user statuses are targeted to different groups.

Specified by:
getStream in interface Event
Returns:
the stream name
See Also:
Event.getStream()

setStream

public void setStream(java.lang.String stream)

Specified by:
setStream in interface Event
Parameters:
stream - the stream Name
See Also:
Event.setStream(String), getStream()

getWiki

public WikiReference getWiki()
In a wiki farm, each event happens in one of the wikis.

Specified by:
getWiki in interface Event
Returns:
the wiki name in which the event was created
See Also:
Event.getWiki()

setWiki

public void setWiki(WikiReference wiki)

Specified by:
setWiki in interface Event
Parameters:
wiki - the wiki name in which the event was created
See Also:
Event.setWiki(WikiReference), getWiki()

getSpace

public SpaceReference getSpace()
Document-related events target a certain document, and documents belong to a space; this is the space of the target document.

Specified by:
getSpace in interface Event
Returns:
the space in which the event was created
See Also:
Event.getSpace()

setSpace

public void setSpace(SpaceReference space)

Specified by:
setSpace in interface Event
Parameters:
space - the space in which the event was created
See Also:
Event.setSpace(SpaceReference), getSpace()

getDocument

public DocumentReference getDocument()
Document-related events target a certain document.

Specified by:
getDocument in interface Event
Returns:
the document related to the event
See Also:
Event.getDocument()

setDocument

public void setDocument(DocumentReference document)

Specified by:
setDocument in interface Event
Parameters:
document - the document related to the event
See Also:
Event.setDocument(DocumentReference), getDocument()

getDocumentVersion

public java.lang.String getDocumentVersion()
For events related to documents, this field records the version of the document at the time when the event occurred.

Specified by:
getDocumentVersion in interface Event
Returns:
the document version when the event occurred
See Also:
Event.getDocumentVersion()

setDocumentVersion

public void setDocumentVersion(java.lang.String version)

Specified by:
setDocumentVersion in interface Event
Parameters:
version - the document version when the event occurred
See Also:
Event.setDocumentVersion(String), getDocumentVersion()

getRelatedEntity

public 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.

Specified by:
getRelatedEntity in interface Event
Returns:
the eventual entity related to the event, may be null
See Also:
Event.getRelatedEntity()

setRelatedEntity

public void setRelatedEntity(EntityReference entity)

Specified by:
setRelatedEntity in interface Event
Parameters:
entity - the eventual entity related to the event
See Also:
Event.setRelatedEntity(EntityReference), getRelatedEntity()

getUser

public DocumentReference getUser()
Event usually occur as the result of a registered user activity.

Specified by:
getUser in interface Event
Returns:
the user creating the event
See Also:
Event.getUser()

setUser

public void setUser(DocumentReference user)

Specified by:
setUser in interface Event
Parameters:
user - the user creating the event
See Also:
Event.setUser(DocumentReference), getUser()

getUrl

public java.net.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.

Specified by:
getUrl in interface Event
Returns:
the URL related to the event
See Also:
Event.getUrl()

setUrl

public void setUrl(java.net.URL url)

Specified by:
setUrl in interface Event
Parameters:
url - the URL related to the event
See Also:
Event.setUrl(URL), getUrl()

getTitle

public java.lang.String getTitle()
A name for the event.

Specified by:
getTitle in interface Event
Returns:
the title of the event
See Also:
Event.getTitle()

setTitle

public void setTitle(java.lang.String title)

Specified by:
setTitle in interface Event
Parameters:
title - the title of the event
See Also:
Event.setTitle(String), getTitle()

getBody

public java.lang.String getBody()
A larger section of text where the event can store some data.

Specified by:
getBody in interface Event
Returns:
the body of the event
See Also:
Event.getBody()

setBody

public void setBody(java.lang.String body)

Specified by:
setBody in interface Event
Parameters:
body - the body of the event
See Also:
Event.setBody(String), getBody()

getDocumentTitle

public java.lang.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.

Specified by:
getDocumentTitle in interface Event
Returns:
the title of the related document when the event occurred.
See Also:
Event.getDocumentTitle()

setDocumentTitle

public void setDocumentTitle(java.lang.String title)

Specified by:
setDocumentTitle in interface Event
Parameters:
title - the title of the related document when the event occurred.
See Also:
Event.setDocumentTitle(String), getDocumentTitle()

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


Copyright © 2004-2011 XWiki. All Rights Reserved.