Search in sources :

Example 1 with OccupantRemovedTask

use of org.jivesoftware.openfire.muc.cluster.OccupantRemovedTask in project Openfire by igniterealtime.

the class OccupantManager method occupantLeft.

/**
 * When an XMPP entity / user is removed as an occupant of a room, this event handler will ensure that this
 * instance of OccupantManager, as well as all instances for the same server on every other cluster node, updates
 * the relevant data that it maintains to perform post-cluster event maintenance.
 *
 * @param roomJID the JID of the room where the occupant has left.
 * @param userJID The 'real' JID (not room-at-service-slash-nickname) of the XMPP user that left.
 * @param nickname nickname that the user used in the room.
 */
@Override
public void occupantLeft(JID roomJID, JID userJID, String nickname) {
    if (!isForThisService(roomJID)) {
        return;
    }
    Log.debug("Removed local occupancy in room '{}' of service '{}': entity '{}' using nickname '{}'", roomJID.getNode(), serviceName, userJID, nickname);
    final OccupantRemovedTask task = new OccupantRemovedTask(serviceName, roomJID.getNode(), nickname, userJID, XMPPServer.getInstance().getNodeID());
    // On this cluster node.
    process(task);
    // On all other cluster nodes
    if (PROPERTY_USE_NONBLOCKING_CLUSTERTASKS.getValue()) {
        CacheFactory.doClusterTask(task);
    } else {
        CacheFactory.doSynchronousClusterTask(task, false);
    }
}
Also used : OccupantRemovedTask(org.jivesoftware.openfire.muc.cluster.OccupantRemovedTask)

Aggregations

OccupantRemovedTask (org.jivesoftware.openfire.muc.cluster.OccupantRemovedTask)1