Commit 953d8828 authored by Matt Tucker's avatar Matt Tucker Committed by matt

Removed chat service.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@160 b35dd754-fafc-0310-a699-88a17e54d16e
parent 29306759
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
package org.jivesoftware.messenger; package org.jivesoftware.messenger;
import org.jivesoftware.messenger.chat.spi.ChatServerImpl;
import org.jivesoftware.messenger.container.spi.BootstrapContainer; import org.jivesoftware.messenger.container.spi.BootstrapContainer;
import org.jivesoftware.messenger.disco.IQDiscoInfoHandler; import org.jivesoftware.messenger.disco.IQDiscoInfoHandler;
import org.jivesoftware.messenger.disco.IQDiscoItemsHandler; import org.jivesoftware.messenger.disco.IQDiscoItemsHandler;
...@@ -72,7 +71,6 @@ public class XMPPBootContainer extends BootstrapContainer { ...@@ -72,7 +71,6 @@ public class XMPPBootContainer extends BootstrapContainer {
protected String[] getStandardModuleNames() { protected String[] getStandardModuleNames() {
return new String[]{ return new String[]{
IQAgentsHandler.class.getName(),
IQAuthHandler.class.getName(), IQAuthHandler.class.getName(),
IQPrivateHandler.class.getName(), IQPrivateHandler.class.getName(),
IQRegisterHandler.class.getName(), IQRegisterHandler.class.getName(),
...@@ -83,7 +81,6 @@ public class XMPPBootContainer extends BootstrapContainer { ...@@ -83,7 +81,6 @@ public class XMPPBootContainer extends BootstrapContainer {
PresenceSubscribeHandler.class.getName(), PresenceSubscribeHandler.class.getName(),
PresenceUpdateHandler.class.getName(), PresenceUpdateHandler.class.getName(),
ChatServerImpl.class.getName(),
IQDiscoInfoHandler.class.getName(), IQDiscoInfoHandler.class.getName(),
IQDiscoItemsHandler.class.getName(), IQDiscoItemsHandler.class.getName(),
MultiUserChatServerImpl.class.getName()}; MultiUserChatServerImpl.class.getName()};
......
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.IQ;
import org.jivesoftware.messenger.Message;
import org.jivesoftware.messenger.Presence;
import org.jivesoftware.messenger.XMPPAddress;
import org.jivesoftware.messenger.auth.UnauthorizedException;
/**
* A basic bot user for easy creation of chatbots. This bot is invisible
* and has no backing user.
*
* @author Iain Shigeoka
* @author Derek DeMoro
*/
class BasicBot implements ChatRole {
/**
* The chatroom this bot belongs to.
*/
private ChatRoom chatRoom;
/**
* The current presence of this bot.
*/
private Presence presence;
/**
* Create a chatbot for the given chat chatRoom.
*
* @param chatRoom the chatroom the bot monitors
* @throws UnauthorizedException if the bot doesn't have permission to enter the chatroom
*/
public BasicBot(ChatRoom chatRoom) throws UnauthorizedException {
this.chatRoom = chatRoom;
presence = this.chatRoom.createPresence(Presence.STATUS_INVISIBLE);
}
public Presence getPresence() throws UnauthorizedException {
return presence;
}
public void setPresence(Presence newPresence) throws UnauthorizedException {
this.presence = newPresence;
}
public void setRole(int newRole) throws UnauthorizedException {
throw new UnauthorizedException("This bot is read-only");
}
public int getRole() throws UnauthorizedException {
return ChatRole.OBSERVER;
}
public String getNickname() throws UnauthorizedException {
return "BasicBot";
}
public void kick() throws UnauthorizedException {
throw new UnauthorizedException("This bot can't be kicked");
}
public ChatUser getChatUser() {
ChatUser user = null;
try {
user = chatRoom.getRole().getChatUser();
}
catch (UnauthorizedException e) {
Log.error(e);
}
return user;
}
public ChatRoom getChatRoom() {
return chatRoom;
}
public XMPPAddress getRoleAddress() {
XMPPAddress addr = null;
try {
addr = chatRoom.getRole().getRoleAddress();
}
catch (UnauthorizedException e) {
Log.error(e);
}
return addr;
}
public void send(Message packet) throws UnauthorizedException {
}
public void send(Presence packet) throws UnauthorizedException {
}
public void send(IQ packet) throws UnauthorizedException {
}
public String toString() {
return "Chat Bot in chatRoom " + chatRoom.getName();
}
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import java.util.*;
/**
* Manages event handling with the opening and closing of chat rooms.
*
* @author Derek DeMoro
*/
public final class ChatAuditManager {
private static ChatAuditManager singleton;
private static final Object LOCK = new Object();
private final Map roomMap = new HashMap();
private final List listeners = new LinkedList();
/**
* Returns the singleton instance of <CODE>ChatAuditManager</CODE>,
* creating it if necessary.
* <p/>
*
* @return the singleton instance of <Code>ChatAuditManager</CODE>
*/
public static ChatAuditManager getInstance() {
// Synchronize on LOCK to ensure that we don't end up creating
// two singletons.
synchronized (LOCK) {
if (null == singleton) {
ChatAuditManager controller = new ChatAuditManager();
singleton = controller;
return controller;
}
}
return singleton;
}
private ChatAuditManager() {
}
/**
* Adds an <code>ChatRoomListener</code> to the manager.
*
* @param listener the <code>ChatRoomListener</code> to be added
*/
public void addChatRoomListener(ChatRoomListener listener) {
listeners.add(listener);
}
/**
* Removes an <code>ChatRoomListener</code> from the manager.
*
* @param listener the <code>ChatRoomListener</code> to be removed
*/
public void removeChatRoomListener(ChatRoomListener listener) {
listeners.remove(listener);
}
/**
* Notifies all ChatRoomListeners that a ChatRoom has been opened.
*
* @param room the <code>ChatRoom</code> that was opened.
* @see ChatRoomListener
*/
public void fireChatRoomOpened(ChatRoom room) {
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
((ChatRoomListener)iter.next()).roomOpened(room);
}
}
/**
* Notifies all ChatRoomListeners that a ChatRoom has been closed.
*
* @param room the <code>ChatRoom</code> that was closed.
* @see ChatRoomListener
*/
public void fireChatRoomClosed(ChatRoom room) {
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
((ChatRoomListener)iter.next()).roomClosed(room);
}
}
/**
* Notifies all ChatRoomListeners that a member has joined the room.
*
* @param room the <code>ChatRoom</code> that the member just joined.
* @param user the <code>ChatUser</code> who just joined the room.
* @see ChatRoomListener
* @see ChatRoom
* @see ChatUser
*/
public void fireMemberJoined(ChatRoom room, ChatUser user) {
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
((ChatRoomListener)iter.next()).memberJoinedRoom(room, user);
}
}
/**
* Notifies all ChatRoomListeners that a member has left the room.
*
* @param room the <code>ChatRoom</code> that the member just left.
* @param user the <code>ChatUser</code> who just left the room.
* @see ChatRoomListener
* @see ChatRoom
* @see ChatUser
*/
public void fireMemberLeftRoom(ChatRoom room, ChatUser user) {
Iterator iter = listeners.iterator();
while (iter.hasNext()) {
((ChatRoomListener)iter.next()).memberLeftRoom(room, user);
}
}
/**
* Adds a <code>ChatRoomHistory</code>.
*
* @param history the <code>ChatRoomHistory</code> to add.
*/
public void addChatHistory(ChatRoomHistory history) {
roomMap.put(history.getRoomname(), history);
}
/**
* Returns a <code>ChatRoomHistory</code> for a given room.
*
* @param roomname the name of the <code>ChatRoom</code>
* @return the <code>ChatRoomHistory</code> for the given room.
*/
public ChatRoomHistory getChatHistory(String roomname) {
return (ChatRoomHistory)roomMap.get(roomname);
}
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.messenger.IQ;
import org.jivesoftware.messenger.Message;
import org.jivesoftware.messenger.Presence;
import org.jivesoftware.messenger.auth.UnauthorizedException;
/**
* Interface for any object that can accept chat messages and presence
* for delivery.
*
* @author Iain Shigeoka
*/
public interface ChatDeliverer {
/**
* Sends a packet to the user.
*
* @param packet The packet to send
* @throws UnauthorizedException Thrown if unauthorized
*/
void send(Message packet) throws UnauthorizedException;
/**
* Sends a packet to the user.
*
* @param packet The packet to send
* @throws UnauthorizedException Thrown if unauthorized
*/
void send(Presence packet) throws UnauthorizedException;
/**
* Sends a packet to the user.
*
* @param packet The packet to send
* @throws UnauthorizedException Thrown if unauthorized
*/
void send(IQ packet) throws UnauthorizedException;
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.messenger.Presence;
import org.jivesoftware.messenger.XMPPAddress;
import org.jivesoftware.messenger.auth.UnauthorizedException;
/**
* Defines the permissions and actions that a ChatUser may use in
* a particular room. Each ChatRole defines the relationship between
* a ChatRoom and a ChatUser.
* <p/>
* ChatUsers can play different roles in different chatrooms.
*
* @author Iain Shigeoka
*/
public interface ChatRole extends ChatDeliverer {
/**
* A silent observer of the room (can't speak in the room)
*/
int OBSERVER = 0;
/**
* A normal occupant of the room
*/
int OCCUPANT = 1;
/**
* Administrator of the room
*/
int OWNER = 10;
/**
* Runs moderated discussions
*/
int MODERATOR = 20;
/**
* The guest speaker in a moderated discussion
*/
int GUEST_SPEAKER = 30;
/**
* Obtain the current presence status of a user in a chatroom.
*
* @return The presence of the user in the room
* @throws UnauthorizedException Thrown if the caller doesn't have
* permission to know this user's presence
*/
Presence getPresence() throws UnauthorizedException;
/**
* Set the current presence status of a user in a chatroom.
*
* @param presence The presence of the user in the room
* @throws UnauthorizedException Thrown if the caller doesn't have
* permission to know this user's presence
*/
void setPresence(Presence presence) throws UnauthorizedException;
/**
* Call this method to promote or demote a user's role in a chatroom.
* It is common for the chatroom or other chat room members to change
* the role of users (a moderator promoting another user to moderator
* status for example).
* <p/>
* Owning ChatUsers should have their membership roles updated.
*
* @param newRole The new role that the user will play
* @throws UnauthorizedException Thrown if the caller doesn't have
* permission to know this user's presence
*/
void setRole(int newRole) throws UnauthorizedException;
/**
* Obtain the role state of the user.
*
* @return The role status of this user
* @throws UnauthorizedException Thrown if the caller doesn't have
* permission to know this user's presence
*/
int getRole() throws UnauthorizedException;
/**
* Obtain the nickname for the user in the chatroom.
*
* @return The user's nickname in the room or null if invisible
* @throws UnauthorizedException Thrown if the caller doesn't have
* permission to know this user's presence
*/
String getNickname() throws UnauthorizedException;
/**
* An event callback for kicks (being removed from a room). This
* provides the user an opportunity to react to the kick (although the
* chat user has already been kicked when this method is called). Remove
* users from a chatroom by calling ChatRoom.leaveRoom().
*
* @throws UnauthorizedException Thrown if the caller doesn't have
* permission to know this user's presence
*/
void kick() throws UnauthorizedException;
/**
* Obtain the chat user that plays this role.
*
* @return The chatuser playing this role
*/
ChatUser getChatUser();
/**
* Obtain the chat room that hosts this user's role.
*
* @return The chatroom hosting this role.
*/
ChatRoom getChatRoom();
/**
* Obtain the XMPPAddress representing this role in a room:
* room@server/nickname
*
* @return The Jabber ID that represents this role in the room
*/
XMPPAddress getRoleAddress();
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.messenger.Presence;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.user.UserAlreadyExistsException;
import org.jivesoftware.messenger.user.UserNotFoundException;
import java.util.Iterator;
/**
* A chat room on the chat server manages its users, and
* enforces it's own security rules.
*
* @author Iain Shigeoka
*/
public interface ChatRoom extends ChatDeliverer {
/**
* Get the name of this room.
*
* @return The name for this room
*/
String getName();
/**
* Obtain a unique numerical id for this room.
* Useful for storing rooms in databases
* (TBD: persistent rooms do not exist yet)
*
* @return The unique id for this room or -1 if no id has been set.
*/
long getID();
/**
* <p>Obtain the room specific message history settings.</p>
*
* @return The message history strategy defaults for the room
*/
HistoryStrategy getHistoryStrategy();
/**
* <p>Obtain the role of the chat server (mainly for addressing
* messages and presence).</p>
*
* @return The role for the chat room itself
* @throws UnauthorizedException If you don't have permission
*/
ChatRole getRole() throws UnauthorizedException;
/**
* Obtain the role of a given user by nickname.
*
* @param nickname The nickname of the user you'd like to obtain
* @return The user's role in the room
* @throws UnauthorizedException If you don't have permission to
* access the user
* @throws UserNotFoundException If there is no user with the given nickname
*/
ChatRole getMember(String nickname)
throws UnauthorizedException, UserNotFoundException;
/**
* Obtain the roles of all users in the chatroom.
*
* @return Iterator over all users in the chatroom
* @throws UnauthorizedException If you don't have permission to access
* the user
*/
Iterator getMembers() throws UnauthorizedException;
/**
* Determine if a given nickname is taken.
*
* @param nickname The nickname of the user you'd like to obtain
* @return True if a nickname is taken
* @throws UnauthorizedException If you don't have permission to access
* the user
*/
boolean hasMember(String nickname) throws UnauthorizedException;
/**
* Joins the room using the given nickname.
*
* @param nickname The nickname the user wants to use in the chatroom
* @param user The user joining
* @return The role created for the user
* @throws UnauthorizedException If the user doesn't have permision
* to join the room
* @throws UserAlreadyExistsException If the nickname is already taken
*/
ChatRole joinRoom(String nickname, ChatUser user)
throws UnauthorizedException, UserAlreadyExistsException;
/**
* Remove a member from the chat room.
*
* @param nickname The user to remove
* @throws UnauthorizedException If the user doesn't have permission
* to leave the room
* @throws UserNotFoundException If the nickname is not found
*/
void leaveRoom(String nickname)
throws UnauthorizedException, UserNotFoundException;
/**
* Create a new presence in this room for the given role.
*
* @return The new presence
* @throws UnauthorizedException If the user doesn't have permission to
* leave the room
*/
Presence createPresence(int presenceStatus) throws UnauthorizedException;
/**
* Broadcast a given message to all members of this chat room.
* The sender is always set to be the chatroom.
*
* @param msg The message to broadcast
*/
void serverBroadcast(String msg) throws UnauthorizedException;
/**
* Returns the total length of the chat session.
*
* @return length of chat session in milliseconds.
*/
public long getChatLength();
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* Represent the data model for one <code>ChatRoom</code> history.
* Including chat transcript, joining and leaving times.
*/
public final class ChatRoomHistory {
private String roomname;
private HistoryStrategy history;
private Map userJoinMap = new LinkedHashMap();
private Map userLeftMap = new LinkedHashMap();
private long startTime;
private long endTime;
private long waitTime;
private int state;
public long getWaitTime() {
return waitTime;
}
public void setWaitTime(long waitTime) {
this.waitTime = waitTime;
}
private long sessionID;
public String getUserID() {
return userID;
}
public void setUserID(String userID) {
this.userID = userID;
}
private String userID;
public ChatRoomHistory(String name) {
setRoomname(name);
}
public void setRoomname(String roomname) {
this.roomname = roomname;
}
public String getRoomname() {
return roomname;
}
public void setHistory(HistoryStrategy history) {
this.history = history;
}
public HistoryStrategy getHistory() {
return history;
}
public void userJoined(ChatUser user, Date timeJoined) {
userJoinMap.put(user, timeJoined);
}
public void userLeft(ChatUser user, Date timeLeft) {
userLeftMap.put(user, timeLeft);
}
public void setStartTime(long startTime) {
this.startTime = startTime;
}
public long getStartTime() {
return startTime;
}
public void setEndTime(long endTime) {
this.endTime = endTime;
}
public long getEndTime() {
return endTime;
}
public long getSessionID() {
return sessionID;
}
public void setSessionID(long sessionID) {
this.sessionID = sessionID;
}
public Map getJoinedMap() {
return userJoinMap;
}
public Map getLeftMap() {
return userLeftMap;
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
}
\ No newline at end of file
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
/**
* Used to receive event notifications from <code>ChatRooms</code>.
*
* @author Derek DeMoro
* @see ChatAuditManager
*/
public interface ChatRoomListener {
/**
* Called whenever a <code>ChatRoom</code> has been opened.
*
* @param room the <code>ChatRoom</code> that was opened.
*/
void roomOpened(ChatRoom room);
/**
* Called whenever a <code>ChatRoom</code> has been closed.
*
* @param room the <code>ChatRoom</code> that was closed.
*/
void roomClosed(ChatRoom room);
/**
* Called when a user has left a <code>ChatRoom</code>
*
* @param room the <code>ChatRoom</code> that was left.
* @param user the <code>ChatUser</code> who left the room.
*/
void memberLeftRoom(ChatRoom room, ChatUser user);
/**
* Called when a user has left a <code>ChatRoom</code>
*
* @param room the <code>ChatRoom</code> that was just joined.
* @param user the <code>ChatUser</code> that has joined the room.
*/
void memberJoinedRoom(ChatRoom room, ChatUser user);
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.messenger.XMPPAddress;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.user.UserNotFoundException;
/**
* Manages groupchat conversations, chatrooms, and users.
* This class is designed to operate independently from the
* rest of the Jive server infrastruture. This theoretically
* allows deployment of the groupchat on a separate server from
* the main IM server.
* <p/>
* TODO Enforce chat security and authorization using proxies
*
* @author Iain Shigeoka
*/
public interface ChatServer {
/**
* Obtain the name of this chat server.
*
* @return The chat server name (host name)
*/
String getChatServerName();
/**
* Indicate if the server supports anonymous rooms (default is true).
* Non-anonymous rooms is a JEP-0045 Multi-User Chat (MUC) feature
* that causes the server to send the real JID of all participants in
* room presence updates.
*/
boolean isUseAnonymousRooms();
/**
* Set the name of this chat server. The new name won't go
* into effect until the server is restarted.
*
* @param name The chat server name (host name)
*/
void setChatServerName(String name);
/**
* <p>Obtain the server-wide default message history settings.</p>
*
* @return The message history strategy defaults for the server
*/
HistoryStrategy getHistoryStrategy();
/**
* Obtains a chatroom by name. A chatroom is created for
* that name if none exists and the user has permission.
*
* @param roomName Name of the room to get
* @return The chatroom for the given name
* @throws UnauthorizedException If the caller doesn't have permission to
* access this room
*/
ChatRoom getChatRoom(String roomName) throws UnauthorizedException;
/**
* Removes the room associated with the given name.
*
* @param roomName The room to remove
* @throws UnauthorizedException If the caller doesn't have permission
*/
void removeChatRoom(String roomName) throws UnauthorizedException;
/**
* Removes a user from all chat rooms.
*
* @param jabberID The user's normal jid, not the chat nickname jid
* @throws UnauthorizedException If the caller doesn't have permission
*/
void removeUser(XMPPAddress jabberID) throws UnauthorizedException;
/**
* Obtain a chat user by XMPPAddress
*
* @param userjid The XMPPAddress of the user
* @return The chatuser corresponding to that XMPPAddress
* @throws UnauthorizedException If the caller doesn't have permission
* @throws UserNotFoundException If the user is not found and can't be
* auto-created
*/
ChatUser getChatUser(XMPPAddress userjid)
throws UnauthorizedException, UserNotFoundException;
/**
* Broadcast a given message to all members of this chat room.
* The sender is always set to be the chatroom.
*
* @param msg The message to broadcast
*/
void serverBroadcast(String msg) throws UnauthorizedException;
/**
* Returns the total chat time of all rooms combined.
*
* @return total chat time in milliseconds
*/
public long getTotalChatTime();
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.util.NotFoundException;
import org.jivesoftware.messenger.XMPPAddress;
import org.jivesoftware.messenger.ChannelHandler;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import java.util.Iterator;
/**
* The chat user is a separate user abstraction for interacting with
* the chat server. Centralizing chat users to the Jabber entity that
* sends and receives the chat messages allows us to create quality of
* service, authorization, and resource decisions on a real-user basis.
* <p/>
* Most chat users in a typical s2s scenario will not be local users.
* </p><p>
* ChatUsers play one or more roles in one or more chat rooms on the
* server.
*
* @author Iain Shigeoka
*/
public interface ChatUser extends ChannelHandler {
/**
* Obtain a user ID (useful for database indexing).
*
* @return The user's id number if any (-1 indicates the implementation
* doesn't support ids)
* @throws UnauthorizedException If the caller doesn't have appropriate
* permissions
*/
long getID() throws UnauthorizedException;
/**
* Obtain the address of the user. The address is used by services like the core
* server packet router to determine if a packet should be sent to the handler.
* Handlers that are working on behalf of the server should use the generic server
* hostname address (e.g. server.com).
*
* @return the address of the packet handler.
*/
public XMPPAddress getAddress();
/**
* Obtain the role of the user in a particular room.
*
* @param roomName The name of the room we're interested in
* @return The role the user plays in that room
* @throws UnauthorizedException If the caller doesn't have appropriate
* permissions
* @throws NotFoundException if the user does not have a role in the given
* room
*/
ChatRole getRole(String roomName)
throws UnauthorizedException, NotFoundException;
/**
* Get all roles for this user.
*
* @return Iterator over all roles for this user
* @throws UnauthorizedException If the caller doesn't have permission
*/
Iterator getRoles() throws UnauthorizedException;
/**
* <p>Get time (in milliseconds from System currentTimeMillis())
* since last packet.</p>
*
* @return The time when the last packet was sent from this user
*/
long getLastPacketTime();
}
\ No newline at end of file
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat;
import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.Message;
import org.jivesoftware.messenger.JiveGlobals;
import java.util.*;
/**
* <p>Chat rooms may cache history of the conversations in the room in order to
* play them back to newly arriving members.</p>
* <p>This class describes the strategy that can be used, and provides a method
* of administering the history behaviro.</p>
*
* @author Iain Shigeoka
* @author Derek DeMoro
*/
public class HistoryStrategy {
/**
* Default max number.
*/
private static final int DEFAULT_MAX_NUMBER = 25;
private Type type = Type.number;
private LinkedList history = new LinkedList();
private int maxNumber;
private HistoryStrategy parent;
private Message roomSubject = null;
/**
* <p>The string prefix to be used on the context property names
* (do not include trailing dot).</p>
*/
private String contextPrefix = null;
/**
* <p>Create a history strategy with the given parent strategy (for defaults)
* or null if no parent exists.</p>
*
* @param parentStrategy The parent strategy of this strategy or null if none exists
*/
public HistoryStrategy(HistoryStrategy parentStrategy) {
this.parent = parentStrategy;
if (parent == null) {
maxNumber = DEFAULT_MAX_NUMBER;
}
else {
type = Type.defaulType;
maxNumber = parent.getMaxNumber();
}
}
/**
* <p>Obtain the maximum number of messages for strategies using message number
* limitations.</p>
*
* @return The maximum number of messages to store in applicable strategies
*/
public int getMaxNumber() {
return maxNumber;
}
/**
* <p>Set the maximum number of messages for strategies using message number
* limitations.</p>
*
* @param max The maximum number of messages to store in applicable strategies
*/
public void setMaxNumber(int max) {
this.maxNumber = max;
if (contextPrefix != null) {
JiveGlobals.setProperty(contextPrefix + ".maxNumber",
Integer.toString(maxNumber));
}
}
/**
* Sets the type of history strategy being used.
*
* @param newType The new type of chat history to use
*/
public void setType(Type newType) {
if (newType != null) {
type = newType;
}
if (contextPrefix != null) {
JiveGlobals.setProperty(contextPrefix + ".type", type.toString());
}
}
/**
* Returns the type of history strategy being used.
*
* @return The current type of strategy being used
*/
public Type getType() {
return type;
}
/**
* Adds a message to this chat history. The strategy type will
* determine what actually happens to the message.
*
* @param packet the packet to add to the chatroom's history.
*/
public void addMessage(Message packet) {
// get the conditions based on default or not
Type strategyType;
int strategyMaxNumber;
if (type == Type.defaulType && parent != null) {
strategyType = parent.getType();
strategyMaxNumber = parent.getMaxNumber();
}
else {
strategyType = type;
strategyMaxNumber = maxNumber;
}
// Room subject change messages are special
boolean subjectChange = false;
if (packet.getSubject() != null && packet.getSubject().length() > 0) {
subjectChange = true;
roomSubject = packet;
}
// store message according to active strategy
if (strategyType == Type.none) {
if (subjectChange) {
history.clear();
history.add(packet);
}
}
else if (strategyType == Type.all) {
history.addLast(packet);
}
else if (strategyType == Type.number) {
if (history.size() >= strategyMaxNumber) {
// We have to remove messages so the new message won't exceed
// the max history size
// This is complicated somewhat because we must skip over the
// last room subject
// message because we want to preserve the room subject if
// possible.
ListIterator historyIter = history.listIterator();
while (historyIter.hasNext()
&& history.size() > strategyMaxNumber) {
if (historyIter.next() != roomSubject) {
historyIter.remove();
}
}
}
history.addLast(packet);
}
}
/**
* Returns the current history as an iterator of messages to play
* back to a new room member.
*
* @return an iterator of Message objects to be sent to the new room member
*/
public Iterator getMessageHistory() {
List list = new ArrayList(history);
return list.iterator();
}
/**
* Strategy type.
*/
public enum Type {
defaulType, none, all, number;
}
/**
* Obtain the strategy type from string name. See the Type enumeration name
* strings for the names strings supported. If nothing matches
* and parent != null DEFAULT is used, otherwise, NUMBER is used.
*
* @param typeName The text name of the strategy type
*/
public void setTypeFromString(String typeName) {
try {
setType(Type.valueOf(typeName));
}
catch (IllegalArgumentException ie) {
if (parent != null) {
setType(Type.defaulType);
}
else {
setType(Type.number);
}
}
}
/**
* Set the prefix to use for retrieving and saving settings
*
* @param prefix the prefix to use (without trailing dot) on property names
*/
public void setContext(String prefix) {
this.contextPrefix = prefix;
setTypeFromString(JiveGlobals.getProperty(prefix + ".type"));
String maxNumberString = JiveGlobals.getProperty(prefix + ".maxNumber");
if (maxNumberString != null && maxNumberString.trim().length() > 0) {
try {
setMaxNumber(Integer.parseInt(maxNumberString));
}
catch (Exception e) {
Log.info("Jive property "
+ prefix + ".maxNumber not a valid number.");
}
}
}
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat.spi;
import org.jivesoftware.messenger.chat.ChatRole;
import org.jivesoftware.messenger.chat.ChatRoom;
import org.jivesoftware.messenger.chat.ChatServer;
import org.jivesoftware.messenger.chat.ChatUser;
import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException;
/**
* Simple in-memory implementation of a role in a chatroom
*
* @author Iain Shigeoka
*/
public class ChatRoleImpl implements ChatRole {
/**
* The room this role is valid in.
*/
private ChatRoomImpl room;
/**
* The user of the role.
*/
private ChatUserImpl user;
/**
* The user's nickname in the room.
*/
private String nick;
/**
* The user's presence in the room.
*/
private Presence presence;
/**
* The chatserver that hosts this role.
*/
private ChatServer server;
/**
* The role ID.
*/
private int role;
/**
* The router used to send packets from this role.
*/
private PacketRouter router;
/**
* The address of the person masquerading in this role.
*/
private XMPPAddress rJID;
/**
* A fragment containing the x-extension for non-anonymous rooms.
*/
private MetaDataFragment nonAnonFragment;
/**
* Create a new role.
*
* @param chatserver the server hosting the role.
* @param chatroom the room the role is valid in.
* @param nickname the nickname of the user in the role.
* @param chatuser the user on the chat server.
* @param packetRouter the packet router for sending messages from this role.
* @throws UnauthorizedException if the role could not be created due to
* security or permission violations
*/
public ChatRoleImpl(ChatServer chatserver,
ChatRoomImpl chatroom,
String nickname,
ChatUserImpl chatuser,
PacketRouter packetRouter) throws UnauthorizedException {
this.room = chatroom;
this.nick = nickname;
this.user = chatuser;
this.server = chatserver;
this.router = packetRouter;
role = ChatRole.OCCUPANT;
rJID = new XMPPAddress(room.getName(), server.getChatServerName(), nick);
if (server.isUseAnonymousRooms()) {
nonAnonFragment = null;
}
else {
nonAnonFragment = new MetaDataFragment("http://jabber.org/protocol/muc#user", "x");
nonAnonFragment.setProperty("x.item:jid", user.getAddress().toString());
nonAnonFragment.setProperty("x.item:affiliation", "none");
nonAnonFragment.setProperty("x.item:role", "participant");
}
setPresence(room.createPresence(Presence.STATUS_ONLINE));
}
public Presence getPresence() throws UnauthorizedException {
return presence;
}
public void setPresence(Presence newPresence) throws UnauthorizedException {
this.presence = newPresence;
if (nonAnonFragment != null) {
presence.addFragment(nonAnonFragment);
}
}
public void setRole(int newRole) throws UnauthorizedException {
role = newRole;
}
public int getRole() throws UnauthorizedException {
return role;
}
public String getNickname() throws UnauthorizedException {
return nick;
}
public void kick() throws UnauthorizedException {
}
public ChatUser getChatUser() {
return user;
}
public ChatRoom getChatRoom() {
return room;
}
public XMPPAddress getRoleAddress() {
return rJID;
}
public void send(Presence packet) throws UnauthorizedException {
presence = room.createPresence(Presence.UNAVAILABLE == packet.getType()
? Presence.STATUS_OFFLINE
: Presence.STATUS_ONLINE);
packet.setRecipient(user.getAddress());
if (nonAnonFragment != null) {
presence.addFragment(nonAnonFragment);
}
router.route(packet);
}
public void send(Message packet) throws UnauthorizedException {
packet.setRecipient(user.getAddress());
router.route(packet);
}
public void send(IQ packet) throws UnauthorizedException {
packet.setRecipient(user.getAddress());
router.route(packet);
}
}
/*
* $RCSfile$
* $Revision$
* $Date$
*
* Copyright (C) 1999-2003 CoolServlets, Inc. All rights reserved.
*
* This software is the proprietary information of CoolServlets, Inc.
* Use is subject to license terms.
*/
package org.jivesoftware.messenger.chat.spi;
import org.jivesoftware.messenger.chat.*;
import org.jivesoftware.messenger.container.BasicModule;
import org.jivesoftware.messenger.container.Container;
import org.jivesoftware.messenger.container.TrackInfo;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log;
import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.user.UserNotFoundException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
/**
* Implements the chat server as a cached memory resident
* chat server. It should be easy to extend the cache to create
* persistent versions of some of the entities (such as persistent
* rooms) using a database in the future.
*
* @author Derek DeMoro
* @author Iain Shigeoka
*/
public class ChatServerImpl extends BasicModule implements ChatServer, RoutableChannelHandler {
/**
* The time to elapse between clearing of idle chat users.
*/
private static final int USER_TIMEOUT = 300000;
/**
* the chat server's hostname
*/
private String chatServerName = null;
private XMPPAddress chatServerAddress = null;
/**
* chatrooms managed by this manager, table: key room name (String); value ChatRoom
*/
private Map<String, ChatRoom> rooms = new ConcurrentHashMap<String, ChatRoom>();
/**
* chat users managed by this manager, table: key user jid (XMPPAddress); value ChatUser
*/
private Map<XMPPAddress, ChatUser> users = new ConcurrentHashMap<XMPPAddress, ChatUser>();
private HistoryStrategy historyStrategy;
private RoutingTable routingTable = null;
/**
* The packet deliverer for the server.
*/
public PacketDeliverer deliverer = null;
/**
* The packet router for the server.
*/
public PacketRouter router = null;
/**
* The packet manager for the server.
*/
public PresenceManager presenceManager = null;
/**
* The total time all agents took to chat *
*/
public long totalChatTime;
/**
* Flag indicating if rooms should use anonymous presence (default).
* If false, all presence updates in all rooms will send the true JID
* of the room participants according to JEP-0045 (MUC) for non-anonyomus
* rooms.
*/
private boolean useAnonRooms = true;
/**
* <p>Timer to monitor chatroom participants. If they've been idle for too long, probe for presence.</p>
*/
private Timer timer = new Timer();
/**
* <p>Create a new group chat server.</p>
*/
public ChatServerImpl() {
super("Basic chat server");
historyStrategy = new HistoryStrategy(null);
// Run through the users every 5 minutes after a 1 minute server startup delay
timer.schedule(new UserTimeoutTask(), USER_TIMEOUT, USER_TIMEOUT);
}
/**
* <p>Probes the presence of any user who's last packet was sent more than 5 minute ago.</p>
*/
private class UserTimeoutTask extends TimerTask {
/**
* Remove any user that has been idle for longer than the user timeout time.
*/
public void run() {
synchronized (users) {
try {
checkForTimedOutUsers();
}
catch (ConcurrentModificationException e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
}
}
private void checkForTimedOutUsers() throws ConcurrentModificationException {
final long deadline = System.currentTimeMillis() - USER_TIMEOUT;
final Map userMap = new HashMap(users);
final Iterator userIter = userMap.values().iterator();
while (userIter.hasNext()) {
try {
ChatUser user = (ChatUser)userIter.next();
if (user.getLastPacketTime() < deadline) {
presenceManager.probePresence(chatServerAddress, user.getAddress());
}
}
catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
}
public ChatRoom getChatRoom(String roomName) throws UnauthorizedException {
ChatRoom room = null;
synchronized (rooms) {
room = (ChatRoom)rooms.get(roomName.toLowerCase());
if (room == null) {
room = new ChatRoomImpl(this, roomName, router);
rooms.put(roomName.toLowerCase(), room);
}
}
return room;
}
public void removeChatRoom(String roomName) throws UnauthorizedException {
synchronized (rooms) {
final ChatRoom room = (ChatRoom)rooms.get(roomName.toLowerCase());
final long chatLength = room.getChatLength();
totalChatTime += chatLength;
rooms.remove(roomName.toLowerCase());
}
}
public String getChatServerName() {
return chatServerName;
}
public HistoryStrategy getHistoryStrategy() {
return historyStrategy;
}
public void removeUser(XMPPAddress jabberID) throws UnauthorizedException {
synchronized (users) {
ChatUser user = (ChatUser)users.remove(jabberID);
if (user != null) {
Iterator roles = user.getRoles();
while (roles.hasNext()) {
ChatRole role = (ChatRole)roles.next();
try {
role.getChatRoom().leaveRoom(role.getNickname());
}
catch (Exception e) {
Log.error(e);
}
}
}
}
}
public ChatUser getChatUser(XMPPAddress userjid) throws UnauthorizedException, UserNotFoundException {
if (router == null) {
throw new IllegalStateException("Not initialized");
}
ChatUser user = null;
synchronized (users) {
user = (ChatUser)users.get(userjid);
if (user == null) {
user = new ChatUserImpl(this, router, userjid);
users.put(userjid, user);
}
}
return user;
}
public void serverBroadcast(String msg) throws UnauthorizedException {
synchronized (rooms) {
Iterator itr = rooms.values().iterator();
while (itr.hasNext()) {
((ChatRoom)itr.next()).serverBroadcast(msg);
}
}
}
/**
* Initialize the track info for the server.
*
* @return the track information for this server
*/
protected TrackInfo getTrackInfo() {
TrackInfo trackInfo = new TrackInfo();
trackInfo.getTrackerClasses().put(PacketRouter.class, "router");
trackInfo.getTrackerClasses().put(PacketDeliverer.class, "deliverer");
trackInfo.getTrackerClasses().put(PresenceManager.class, "presenceManager");
return trackInfo;
}
public void serviceAdded(Object service) {
if (service instanceof RoutingTable) {
((RoutingTable)service).addRoute(chatServerAddress, this);
ArrayList params = new ArrayList();
params.clear();
params.add(chatServerName);
Log.info(LocaleUtils.getLocalizedString("startup.starting.chat", params));
}
}
/**
* Set the address of the server.
*
* @param name the new server address.
*/
public void setChatServerName(String name) {
JiveGlobals.setProperty("xmpp.chat.domain", name);
}
public void initialize(Container container) {
chatServerName = JiveGlobals.getProperty("xmpp.chat.domain");
// Trigger the strategy to load itself from the context
historyStrategy.setContext("xmpp.chat.history");
// Pseudo MUC support for non-anonymous rooms - all or nothing setting
useAnonRooms = JiveGlobals.getBooleanProperty("xmpp.chat.anonymous_rooms");
if (chatServerName == null) {
chatServerName = "chat.127.0.0.1";
}
chatServerAddress = new XMPPAddress(null, chatServerName, null);
super.initialize(container);
}
public void start() {
super.start();
routingTable = (RoutingTable)lookup.lookup(RoutingTable.class);
routingTable.addRoute(chatServerAddress, this);
ArrayList params = new ArrayList();
params.clear();
params.add(chatServerName);
Log.info(LocaleUtils.getLocalizedString("startup.starting.chat", params));
}
public XMPPAddress getAddress() {
if (chatServerAddress == null) {
throw new IllegalStateException("Not initialized");
}
return chatServerAddress;
}
public void process(XMPPPacket packet) throws UnauthorizedException, PacketException {
try {
ChatUser user = getChatUser(packet.getSender());
user.process(packet);
}
catch (Exception e) {
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
public boolean isUseAnonymousRooms() {
return useAnonRooms;
}
public long getTotalChatTime() {
return totalChatTime;
}
}
...@@ -73,6 +73,7 @@ public class JettyModule implements Module { ...@@ -73,6 +73,7 @@ public class JettyModule implements Module {
webAppContext = jetty.addWebApplication("/", JiveGlobals.getMessengerHome() + webAppContext = jetty.addWebApplication("/", JiveGlobals.getMessengerHome() +
File.separator + "plugins" + File.separator + "admin" + File.separator + "plugins" + File.separator + "admin" +
File.separator + "webapp"); File.separator + "webapp");
webAppContext.setWelcomeFiles(new String[]{"index.jsp"});
} }
catch (Exception e) { catch (Exception e) {
Log.error("Trouble initializing Jetty", e); Log.error("Trouble initializing Jetty", e);
...@@ -82,7 +83,7 @@ public class JettyModule implements Module { ...@@ -82,7 +83,7 @@ public class JettyModule implements Module {
public void start() { public void start() {
try { try {
jetty.start(); jetty.start();
webAppContext.setWelcomeFiles(new String[]{"index.jsp", "index.html"});
ServiceItem serverItem = new ServiceItem(null, this, null); ServiceItem serverItem = new ServiceItem(null, this, null);
reg = serverContainer.getServiceLookup().register(serverItem); reg = serverContainer.getServiceLookup().register(serverItem);
Log.info("Started embedded web server on port: " + port); Log.info("Started embedded web server on port: " + port);
......
...@@ -49,8 +49,7 @@ public class BasicServer extends BasicModule implements XMPPServer, BasicServerM ...@@ -49,8 +49,7 @@ public class BasicServer extends BasicModule implements XMPPServer, BasicServerM
public XMPPServerInfo getServerInfo() { public XMPPServerInfo getServerInfo() {
Iterator ports; Iterator ports;
if (connectionManager == null) { if (connectionManager == null) {
connectionManager = connectionManager = (ConnectionManager)lookup.lookup(ConnectionManager.class);
(ConnectionManager)lookup.lookup(ConnectionManager.class);
} }
if (connectionManager == null) { if (connectionManager == null) {
ports = Collections.EMPTY_LIST.iterator(); ports = Collections.EMPTY_LIST.iterator();
...@@ -76,9 +75,8 @@ public class BasicServer extends BasicModule implements XMPPServer, BasicServerM ...@@ -76,9 +75,8 @@ public class BasicServer extends BasicModule implements XMPPServer, BasicServerM
return new XMPPAddress(username, name, resource); return new XMPPAddress(username, name, resource);
} }
private Session serverSession = private Session serverSession = new ServerSession(new XMPPAddress(null, name, null),
new ServerSession(new XMPPAddress(null, name, null), new BasicStreamIDFactory().createStreamID(name));
new BasicStreamIDFactory().createStreamID(name));
public Session getSession() { public Session getSession() {
return serverSession; return serverSession;
...@@ -113,9 +111,7 @@ public class BasicServer extends BasicModule implements XMPPServer, BasicServerM ...@@ -113,9 +111,7 @@ public class BasicServer extends BasicModule implements XMPPServer, BasicServerM
params.add(version.getVersionString()); params.add(version.getVersionString());
params.add(formatter.format(new Date())); params.add(formatter.format(new Date()));
String startupBanner = LocaleUtils.getLocalizedString("startup.name", params); String startupBanner = LocaleUtils.getLocalizedString("startup.name", params);
Log.info("####################################################################");
Log.info(startupBanner); Log.info(startupBanner);
Log.info("--------------------------------------------------------------------");
System.out.println(startupBanner); System.out.println(startupBanner);
// params.clear(); // params.clear();
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
package org.jivesoftware.messenger.spi; package org.jivesoftware.messenger.spi;
import org.jivesoftware.messenger.chat.ChatServer;
import org.jivesoftware.messenger.container.*; import org.jivesoftware.messenger.container.*;
import org.jivesoftware.util.LocaleUtils; import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log; import org.jivesoftware.util.Log;
...@@ -40,10 +39,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -40,10 +39,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
* Total number of sessions being managed * Total number of sessions being managed
*/ */
private int sessionCount = 0; private int sessionCount = 0;
/**
* Message for users logging in with too many users
*/
private Message sessionMaxExceededMessagePacket;
public XMPPServer server; public XMPPServer server;
/** /**
...@@ -55,7 +50,7 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -55,7 +50,7 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
*/ */
public PacketTransporter transporter; public PacketTransporter transporter;
/** /**
* Name of the local server * * Name of the local server
*/ */
private String serverName; private String serverName;
private XMPPAddress serverAddress; private XMPPAddress serverAddress;
...@@ -65,11 +60,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -65,11 +60,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
*/ */
private int conflictLimit; private int conflictLimit;
/**
* Set of all known chat servers
*/
public List chatServers = new LinkedList();
/** /**
* Random resource name generation * Random resource name generation
*/ */
...@@ -270,14 +260,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -270,14 +260,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
return session; return session;
} }
private void validateMaxExceededPacket() {
if (sessionMaxExceededMessagePacket == null) {
sessionMaxExceededMessagePacket = packetFactory.getMessage();
sessionMaxExceededMessagePacket.setBody(LocaleUtils.getLocalizedString("user.license"));
sessionMaxExceededMessagePacket.setError(XMPPError.Code.SERVICE_UNAVAILABLE);
}
}
/** /**
* Add a new session to be managed. * Add a new session to be managed.
*/ */
...@@ -814,22 +796,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -814,22 +796,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
Presence presence = session.getPresence(); Presence presence = session.getPresence();
if (presence == null || presence.isAvailable()) { if (presence == null || presence.isAvailable()) {
Iterator servers = chatServers.iterator();
while (servers.hasNext()) {
Presence packet = packetFactory.getPresence();
packet.setOriginatingSession(session);
packet.setSender(session.getAddress());
packet.setRecipient(new XMPPAddress(null, ((ChatServer)servers.next()).getChatServerName(), null));
packet.setAvailable(false);
try {
transporter.deliver(packet);
}
catch (XMLStreamException e) {
// do nothing
}
}
Presence offline = packetFactory.getPresence(); Presence offline = packetFactory.getPresence();
offline.setOriginatingSession(session); offline.setOriginatingSession(session);
offline.setSender(session.getAddress()); offline.setSender(session.getAddress());
...@@ -906,7 +872,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager, ...@@ -906,7 +872,6 @@ public class SessionManagerImpl extends BasicModule implements SessionManager,
protected TrackInfo getTrackInfo() { protected TrackInfo getTrackInfo() {
TrackInfo trackInfo = new TrackInfo(); TrackInfo trackInfo = new TrackInfo();
trackInfo.getTrackerClasses().put(XMPPServer.class, "server"); trackInfo.getTrackerClasses().put(XMPPServer.class, "server");
trackInfo.getTrackerClasses().put(ChatServer.class, "chatServers");
trackInfo.getTrackerClasses().put(PacketTransporter.class, "transporter"); trackInfo.getTrackerClasses().put(PacketTransporter.class, "transporter");
trackInfo.getTrackerClasses().put(PacketRouter.class, "router"); trackInfo.getTrackerClasses().put(PacketRouter.class, "router");
trackInfo.getTrackerClasses().put(UserManager.class, "userManager"); trackInfo.getTrackerClasses().put(UserManager.class, "userManager");
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
package org.jivesoftware.util; package org.jivesoftware.util;
import org.jivesoftware.messenger.chat.ChatServer;
import org.jivesoftware.messenger.container.Container; import org.jivesoftware.messenger.container.Container;
import org.jivesoftware.messenger.container.ServiceLookup; import org.jivesoftware.messenger.container.ServiceLookup;
import org.jivesoftware.messenger.container.ServiceLookupFactory; import org.jivesoftware.messenger.container.ServiceLookupFactory;
...@@ -95,10 +94,6 @@ public class WebManager extends WebBean { ...@@ -95,10 +94,6 @@ public class WebManager extends WebBean {
return (SessionManager)getServiceLookup().lookup(SessionManager.class); return (SessionManager)getServiceLookup().lookup(SessionManager.class);
} }
public ChatServer getChatServer() {
return (ChatServer)getServiceLookup().lookup(ChatServer.class);
}
public MultiUserChatServer getMultiUserChatServer() { public MultiUserChatServer getMultiUserChatServer() {
return (MultiUserChatServer)getServiceLookup().lookup(MultiUserChatServer.class); return (MultiUserChatServer)getServiceLookup().lookup(MultiUserChatServer.class);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment