Added locateClient().

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4771 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2007-07-18 06:18:16 +00:00
parent 6b67de9fca
commit 7cf24684a7
@@ -222,6 +222,19 @@ public class PeerManager
} }
} }
/**
* Locates the client with the specified name. Returns null if the client is not logged onto
* any peer.
*/
public ClientInfo locateClient (final Name key)
{
return lookupNodeDatum(new Lookup<ClientInfo>() {
public ClientInfo lookup (NodeObject nodeobj) {
return nodeobj.clients.get(key);
}
});
}
/** /**
* Locates a datum from among the set of peer {@link NodeObject}s. Objects are searched in * Locates a datum from among the set of peer {@link NodeObject}s. Objects are searched in
* arbitrary order and the first non-null value returned by the supplied lookup operation is * arbitrary order and the first non-null value returned by the supplied lookup operation is