Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.event
Class GroupEvent

java.lang.Object
  extended by com.jivesoftware.base.event.GroupEvent
All Implemented Interfaces:
JiveEvent

public class GroupEvent
extends java.lang.Object
implements JiveEvent

A class for group events. This class will be passed to GroupListeners whenever a group 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 TypeExtra Params
GROUP_CREATEDNone
GROUP_DELETEDNone
GROUP_USER_ADDEDA param named 'User' with a 'User' object as a payload
GROUP_USER_DELETEDA param named 'User' with a 'User' object as a payload
GROUP_ADMINISTRATOR_ADDEDA param named 'Administrator' with a 'User' object as a payload
GROUP_ADMINISTRATOR_DELETEDA param named 'Administrator' with a 'User' object as a payload
GROUP_MODIFIED
ReasonNameValue
Name was modifiedTypenameModify
Name was modifiedoriginalValueThe name before it was modified

Description was modifiedTypedescriptionModify
Description was modifiedoriginalValueThe description before it was modified

Property was modifiedTypepropertyModify
Property was modifiedPropertyKeyThe name of the property
Property was modifiedoriginalValueThe property value before it was modified

Property was addedTypepropertyAdd
Property was addedPropertyKeyThe name of the new property

Property was deletedTypepropertyDelete
Property was deletedPropertyKeyThe name of the property that is going to be deleted


Field Summary
static int GROUP_ADMINISTRATOR_ADDED
          Event type for whenever an administrator is added to a group.
static int GROUP_ADMINISTRATOR_DELETED
          Event type for whenever an administrator is deleted from a group.
static int GROUP_CREATED
          Event type for whenever a group is created.
static int GROUP_DELETED
          Event type for whenever a group is deleted.
static int GROUP_MODIFIED
          Event type for whenever a group is modified (properties added, etc).
static int GROUP_USER_ADDED
          Event type for whenever a user is added to a group.
static int GROUP_USER_DELETED
          Event type for whenever a user is deleted from a group.
 
Constructor Summary
GroupEvent(int eventType, Group group, java.util.Map params)
           
 
Method Summary
 java.util.Date getDate()
          Returns the date (as a Date object) that the event was created.
 int getEventType()
          Returns the event type corresponding to the event.
 java.lang.Exception getFailureException()
          Returns the exception that indicates why a listener failed to handle an event.
 Group getGroup()
           
 java.util.Map getParams()
          Returns a map of parameters which can be used to pass data to a listener.
 void setFailureException(java.lang.Exception e)
          Sets the exception that indicates why a listener failed to handle an event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GROUP_CREATED

public static final int GROUP_CREATED
Event type for whenever a group is created.

See Also:
Constant Field Values

GROUP_DELETED

public static final int GROUP_DELETED
Event type for whenever a group is deleted.

See Also:
Constant Field Values

GROUP_USER_ADDED

public static final int GROUP_USER_ADDED
Event type for whenever a user is added to a group.

See Also:
Constant Field Values

GROUP_USER_DELETED

public static final int GROUP_USER_DELETED
Event type for whenever a user is deleted from a group.

See Also:
Constant Field Values

GROUP_ADMINISTRATOR_ADDED

public static final int GROUP_ADMINISTRATOR_ADDED
Event type for whenever an administrator is added to a group.

See Also:
Constant Field Values

GROUP_ADMINISTRATOR_DELETED

public static final int GROUP_ADMINISTRATOR_DELETED
Event type for whenever an administrator is deleted from a group.

See Also:
Constant Field Values

GROUP_MODIFIED

public static final int GROUP_MODIFIED
Event type for whenever a group is modified (properties added, etc).

See Also:
Constant Field Values
Constructor Detail

GroupEvent

public GroupEvent(int eventType,
                  Group group,
                  java.util.Map params)
Method Detail

getEventType

public int getEventType()
Description copied from interface: JiveEvent
Returns the event type corresponding to the event.

Specified by:
getEventType in interface JiveEvent
Returns:
the event type corresponding to the event.

getGroup

public Group getGroup()

getParams

public java.util.Map getParams()
Description copied from interface: JiveEvent
Returns a map of parameters which can be used to pass data to a listener.

Specified by:
getParams in interface JiveEvent
Returns:
map of parameters which can be used to pass data to a listener.

getDate

public java.util.Date getDate()
Description copied from interface: JiveEvent
Returns the date (as a Date object) that the event was created.

Specified by:
getDate in interface JiveEvent
Returns:
the date (as a Date object) that the event was created.

getFailureException

public java.lang.Exception getFailureException()
Returns the exception that indicates why a listener failed to handle an event. This will return null if no exception occurred.

Sometimes the class triggering the event needs to know if any listeners for the event were unsuccessful for any reason. This is used internally by Jive classes and should be ignored by listener authors.

Returns:
the failure exception.

setFailureException

public void setFailureException(java.lang.Exception e)
Sets the exception that indicates why a listener failed to handle an event.

Sometimes the class triggering the event needs to know if any listeners for the event were unsuccessful for any reason. Listeners can call this method to indicate that the event was not handled successfully in all cases. This is used internally by Jive classes ashould be ignored by listener authors.

Parameters:
e - the exception.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.