Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.base.event
Class UserEvent

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

public class UserEvent
extends java.lang.Object
implements JiveEvent

A class for user events. This class will be passed to UserListeners whenever a user 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
USER_CREATEDNone
USER_DELETEDNone
USER_MODIFIED
ReasonNameValue
Name was modifiedTypenameModify
Name was modifiedoriginalValueThe name before it was modified


Password was modifiedTypepasswordModify
Password was modifiedpasswordThe unencrypted new password

Email was modifiedTypeemailModify
Email was modifiedoriginalValueThe email 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 USER_CREATED
          Event type for whenever a user is created.
static int USER_DELETED
          Event type for whenever a user is deleted.
static int USER_MODIFIED
          Event type for whenever a user is modified.
 
Constructor Summary
UserEvent(int eventType, User user, 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.
 java.util.Map getParams()
          Returns a map of parameters which can be used to pass data to a listener.
 User getUser()
           
 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

USER_CREATED

public static final int USER_CREATED
Event type for whenever a user is created.

See Also:
Constant Field Values

USER_DELETED

public static final int USER_DELETED
Event type for whenever a user is deleted.

See Also:
Constant Field Values

USER_MODIFIED

public static final int USER_MODIFIED
Event type for whenever a user is modified.

See Also:
Constant Field Values
Constructor Detail

UserEvent

public UserEvent(int eventType,
                 User user,
                 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.

getUser

public User getUser()

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.