01: /**
02: * $RCSfile$
03: * $Revision: $
04: * $Date: $
05: *
06: * Copyright (C) 2007 Jive Software. All rights reserved.
07: *
08: * This software is published under the terms of the GNU Public License (GPL),
09: * a copy of which is included in this distribution.
10: */package org.jivesoftware.openfire.muc.cluster;
11:
12: import org.jivesoftware.openfire.XMPPServer;
13: import org.jivesoftware.openfire.muc.spi.MultiUserChatServerImpl;
14: import org.jivesoftware.util.cache.ClusterTask;
15: import org.jivesoftware.util.cache.ExternalizableUtil;
16:
17: import java.io.IOException;
18: import java.io.ObjectInput;
19: import java.io.ObjectOutput;
20:
21: /**
22: * Task that will remove a local room from the cluster node. When a room is destroyed
23: * in a cluster node the rest of the cluster nodes will need to destroy their copy
24: * and send notifications to the room occupants hosted in the local cluster node.
25: *
26: * @author Gaston Dombiak
27: */
28: public class RoomRemovedEvent implements ClusterTask {
29: private String roomName;
30:
31: public RoomRemovedEvent() {
32: }
33:
34: public RoomRemovedEvent(String roomName) {
35: this .roomName = roomName;
36: }
37:
38: public Object getResult() {
39: return null;
40: }
41:
42: public void run() {
43: MultiUserChatServerImpl mucServer = (MultiUserChatServerImpl) XMPPServer
44: .getInstance().getMultiUserChatServer();
45: mucServer.chatRoomRemoved(roomName);
46: }
47:
48: public void writeExternal(ObjectOutput out) throws IOException {
49: ExternalizableUtil.getInstance().writeSafeUTF(out, roomName);
50: }
51:
52: public void readExternal(ObjectInput in) throws IOException,
53: ClassNotFoundException {
54: roomName = ExternalizableUtil.getInstance().readSafeUTF(in);
55: }
56: }
|