Commit f3f3dc67 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added support for retrieving IP address of connection managers. JM-666

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4024 b35dd754-fafc-0310-a699-88a17e54d16e
parent f3f9c171
......@@ -35,6 +35,7 @@ import org.xmpp.packet.Message;
import org.xmpp.packet.Packet;
import org.xmpp.packet.Presence;
import java.net.InetAddress;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
......@@ -243,6 +244,21 @@ public class SessionManager extends BasicModule {
return new ArrayList<ConnectionMultiplexerSession>(sessions);
}
/**
* Returns the IP address of the connection manager whose domain matches the
* specified domain.
*
* @param domain the domain of the connection manager.
* @return the IP address of the connection manager.
*/
public InetAddress getConnectionMultiplexerInetAddress(String domain) {
List<ConnectionMultiplexerSession> sessions = connnectionManagerSessions.get(domain);
if (sessions == null || sessions.isEmpty()) {
return null;
}
return sessions.get(0).getConnection().getInetAddress();
}
/**
* Creates a new <tt>ConnectionMultiplexerSession</tt>.
*
......
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