Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community.event
Class MessageEvent

java.lang.Object
  extended by com.jivesoftware.community.event.MessageEvent
All Implemented Interfaces:
com.jivesoftware.community.JiveEvent

public class MessageEvent
extends Object
implements com.jivesoftware.community.JiveEvent

A class for ForumMessage events. This class will be passed to MessageListeners whenever a forum message event is fired and contains all the pertinent information to the event.

Certain event types will populate the params Map with additional objects as outlined below:

Event Type Extra Params
MESSAGE_ADDED None
MESSAGE_DELETED None
MESSAGE_MOVED oldThreadID (Long) -- the ID of the thread the message used to belong to.
oldCommunityID (Long) -- the ID of the community the message used to belong to.
MESSAGE_MODIFIEDNone
MESSAGE_MODERATION_MODIFIEDoldModerationValue (Integer) -- the old moderation value of the message.
moderatorID (Long) -- the userID of user that made the moderation change, or -1 if userID is unknown or not present.
MESSAGE_RATEDNone


Field Summary
static int MESSAGE_ADDED
          Message was added to the system.
static int MESSAGE_DELETING
          Message was deleted.
static int MESSAGE_MODERATION_MODIFIED
          The moderation value of the message was changed.
static int MESSAGE_MODIFIED
          The message was modified.
static int MESSAGE_MOVED
          The message was moved by becoming the root message of a new thread.
static int MESSAGE_RATED
          The message was rated.
 
Constructor Summary
MessageEvent(int eventType, ForumMessage message, JiveContainer container, Map<String,? extends Object> params)
          Creates a new message event.
 
Method Summary
 Date getDate()
           
 int getEventType()
           
 JiveObject getIdentifiedObject()
          Return an EntityDescriptor if message is null and messageID is not.
 JiveContainer getJiveContainer()
           
 ForumMessage getMessage()
          Returns the ForumMessage that the event corresponds to.
 Map<String,? extends Object> getParams()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGE_ADDED

public static final int MESSAGE_ADDED
Message was added to the system.

See Also:
Constant Field Values

MESSAGE_DELETING

public static final int MESSAGE_DELETING
Message was deleted.

See Also:
Constant Field Values

MESSAGE_MODIFIED

public static final int MESSAGE_MODIFIED
The message was modified. This will happen when a message subject, body, or extended properties are changed. This event will not be fired until a message has been added to the system.

See Also:
Constant Field Values

MESSAGE_MODERATION_MODIFIED

public static final int MESSAGE_MODERATION_MODIFIED
The moderation value of the message was changed.

See Also:
Constant Field Values

MESSAGE_RATED

public static final int MESSAGE_RATED
The message was rated.

See Also:
Constant Field Values

MESSAGE_MOVED

public static final int MESSAGE_MOVED
The message was moved by becoming the root message of a new thread.

See Also:
Constant Field Values
Constructor Detail

MessageEvent

public MessageEvent(int eventType,
                    ForumMessage message,
                    JiveContainer container,
                    Map<String,? extends Object> params)
Creates a new message event.

Parameters:
eventType - the type of the message event.
message - the message the event corresponds to.
container - the parenxt container
params - parameters corresponding to the event.
Method Detail

getEventType

public int getEventType()
Specified by:
getEventType in interface com.jivesoftware.community.JiveEvent

getMessage

public ForumMessage getMessage()
Returns the ForumMessage that the event corresponds to.

Returns:
the message the event corresponds to.

getJiveContainer

public JiveContainer getJiveContainer()

getParams

public Map<String,? extends Object> getParams()
Specified by:
getParams in interface com.jivesoftware.community.JiveEvent

getDate

public Date getDate()
Specified by:
getDate in interface com.jivesoftware.community.JiveEvent

getIdentifiedObject

public JiveObject getIdentifiedObject()
Return an EntityDescriptor if message is null and messageID is not.

Returns:
if message is null, an EntityDescriptor, otherwise the message itself.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.