Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jivesoftware.openfire.roster
Class RosterEventDispatcher

    java.lang.Object
      org.jivesoftware.openfire.roster.RosterEventDispatcher

    public class RosterEventDispatcher

extends Object

Dispatches roster events. The following events are supported:

- rosterLoaded --> A roster has just been loaded.
- contactAdded --> A contact has been added to a roster.
- contactUpdated --> A contact has been updated of a roster.
- contactDeleted --> A contact has been deleted from a roster.

Use `addListener(RosterEventListener)` and `removeListener(RosterEventListener)` to add or remove `RosterEventListener`.

Author:
  Gaston Dombiak

Constructor Summary
`RosterEventDispatcher()`

Method Summary
`static boolean` | `addingContact(Roster roster, RosterItem item, boolean persistent)` Notifies listeners that a contact is about to be added to a roster.
`static void` | `addListener(RosterEventListener listener)` Registers a listener to receive events.
`static void` | `contactAdded(Roster roster, RosterItem item)` Notifies the listeners that a contact has been added to a roster.
`static void` | `contactDeleted(Roster roster, RosterItem item)` Notifies the listeners that a contact has been deleted from a roster.
`static void` | `contactUpdated(Roster roster, RosterItem item)` Notifies the listeners that a contact has been updated.
`static void` | `removeListener(RosterEventListener listener)` Unregisters a listener to receive events.
`static void` | `rosterLoaded(Roster roster)` Notifies the listeners that a roster has just been loaded.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RosterEventDispatcher

    public RosterEventDispatcher()

Method Detail

### addListener

    public static void addListener(RosterEventListener listener)

  Registers a listener to receive events.

  Parameters:
    `listener` - the listener.

### removeListener

    public static void removeListener(RosterEventListener listener)

  Unregisters a listener to receive events.

  Parameters:
    `listener` - the listener.

### rosterLoaded

    public static void rosterLoaded(Roster roster)

  Notifies the listeners that a roster has just been loaded.

  Parameters:
    `roster` - the loaded roster.

### addingContact

    public static boolean addingContact(Roster roster,
                                        RosterItem item,
                                        boolean persistent)

  Notifies listeners that a contact is about to be added to a roster. New contacts may be persisted to the database or not. Listeners may indicate that contact about to be persisted should not be persisted. Only one listener is needed to return `false` so that the contact is not persisted.

  Parameters:
    `roster` - the roster that was updated.
    `item` - the new roster item.
    `persistent` - true if the new contact is going to be saved to the database.
  Returns:
    false if the contact should not be persisted to the database.

### contactAdded

    public static void contactAdded(Roster roster,
                                    RosterItem item)

  Notifies the listeners that a contact has been added to a roster.

  Parameters:
    `roster` - the roster that was updated.
    `item` - the new roster item.

### contactUpdated

    public static void contactUpdated(Roster roster,
                                      RosterItem item)

  Notifies the listeners that a contact has been updated.

  Parameters:
    `roster` - the roster that was updated.
    `item` - the updated roster item.

### contactDeleted

    public static void contactDeleted(Roster roster,
                                      RosterItem item)

  Notifies the listeners that a contact has been deleted from a roster.

  Parameters:
    `roster` - the roster that was updated.
    `item` - the roster item that was deleted.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Openfire 3.8.2 Javadoc
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2008 Jive Software.