Class UserEventDispatcher


  • public class UserEventDispatcher
    extends Object
    Dispatches user events. Each event has a type and optional parameters, as follows:
    The params per event type
    Event TypeExtra Params
    user_createdNone
    user_deletingNone
    user_modified
    The params for a user modified event
    ReasonKeyValue
    Name modified
     typenameModified
     originalValue(Name before it was modified)

    Email modified
     typeemailModified
     originalValue(Email before it was modified)

    Password modified
     typepasswordModified

    Creation date modified
     typecreationDateModified
     originalValue(Creation date before it was modified)

    Modification date modified
     typemodificationDateModified
     originalValue(Modification date before it was modified)

    Property modified
     typepropertyModified
     propertyKey(Name of the property)
     originalValue(Property value before it was modified)

    Property added
     typepropertyAdded
     propertyKey(Name of the new property)

    Property deleted
     typepropertyDeleted
     propertyKey(Name of the property deleted)
    Author:
    Matt Tucker
    • Method Detail

      • addListener

        public static void addListener​(UserEventListener listener)
        Registers a listener to receive events.
        Parameters:
        listener - the listener.
      • removeListener

        public static void removeListener​(UserEventListener listener)
        Unregisters a listener to receive events.
        Parameters:
        listener - the listener.
      • dispatchEvent

        public static void dispatchEvent​(User user,
                                         UserEventDispatcher.EventType eventType,
                                         Map<String,​Object> params)
        Dispatches an event to all listeners.
        Parameters:
        user - the user.
        eventType - the event type.
        params - event parameters.