Class GroupEventDispatcher


  • public class GroupEventDispatcher
    extends Object
    Dispatches group events. Each event has a type and optional parameters, as follows:
    The params for each event type
    Event TypeExtra Params
    group_createdNone
    group_deletingNone
    member_addedA param named member with a String username as a payload
    member_removedA param named member with a String username as a payload
    admin_addedA param named admin with a String username as a payload
    admin_removedA param named admin with a String username as a payload
    group_modified
    The params for a group modified event
    ReasonKeyValue
    Name modified
     typenameModified
     originalValue(Name before it was modified)

    Description modified
     typedescriptionModified
     originalValue(Description 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​(GroupEventListener listener)
        Registers a listener to receive events.
        Parameters:
        listener - the listener.
      • removeListener

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

        public static void dispatchEvent​(Group group,
                                         GroupEventDispatcher.EventType eventType,
                                         Map params)
        Dispatches an event to all listeners.
        Parameters:
        group - the group.
        eventType - the event type.
        params - event parameters.