Commit 4d82f8ab authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

1. Replaces #printStackTrace with Log.error

2. Removes unused code


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@65 b35dd754-fafc-0310-a699-88a17e54d16e
parent d323df3c
......@@ -19,7 +19,6 @@ import org.jivesoftware.util.*;
import org.jivesoftware.messenger.*;
import org.jivesoftware.messenger.auth.UnauthorizedException;
import org.jivesoftware.messenger.chatbot.ChatbotManager;
import org.jivesoftware.messenger.user.RosterItem;
import org.jivesoftware.messenger.user.User;
import org.jivesoftware.messenger.user.UserManager;
import org.jivesoftware.messenger.user.UserNotFoundException;
......@@ -32,13 +31,6 @@ import java.util.*;
*/
public class PresenceManagerImpl extends BasicModule implements PresenceManager {
/**
* Query for roster subscribers
*/
private static final String GET_ROSTER_SUBS =
"SELECT userID FROM jiveRoster WHERE jid=? AND (sub=" +
RosterItem.SUB_BOTH + " OR sub=" + RosterItem.SUB_TO + ")";
/**
* table: key Presence ID (Long); value Presence
*/
......@@ -57,7 +49,6 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
public SessionManager sessionManager;
public RoutingTable routingTable;
public XMPPServer server;
private String serverName;
public PacketDeliverer deliverer;
public PresenceManagerImpl() {
......@@ -363,7 +354,7 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
sessionManager.userBroadcast(prober, presencePacket);
}
catch (Exception e) {
e.printStackTrace();
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
}
......@@ -378,7 +369,7 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
sessionManager.userBroadcast(prober, presencePacket);
}
catch (Exception e) {
e.printStackTrace();
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
}
......@@ -415,7 +406,7 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
deliverer.deliver(presencePacket);
}
catch (Exception e) {
e.printStackTrace();
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
}
......@@ -429,7 +420,7 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
deliverer.deliver(presencePacket);
}
catch (Exception e) {
e.printStackTrace();
Log.error(LocaleUtils.getLocalizedString("admin.error"), e);
}
}
}
......@@ -458,16 +449,4 @@ public class PresenceManagerImpl extends BasicModule implements PresenceManager
trackInfo.getTrackerClasses().put(RoutingTable.class, "routingTable");
return trackInfo;
}
public void serviceAdded(Object service) {
if (service instanceof XMPPServer && server != null) {
serverName = server.getServerInfo().getName();
}
}
public void serviceRemoved(Object service) {
if (server == null) {
serverName = null;
}
}
}
\ No newline at end of file
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