PresentsClient -> PresentsSession (Jamie's suggestion) and associated changes

on down the client.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5508 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-11-06 18:04:42 +00:00
parent a9f7175d2f
commit c69630b7e0
17 changed files with 98 additions and 101 deletions
@@ -26,13 +26,13 @@ import com.threerings.util.Name;
import com.threerings.presents.net.AuthRequest;
import com.threerings.presents.server.ClientFactory;
import com.threerings.presents.server.ClientResolver;
import com.threerings.presents.server.PresentsClient;
import com.threerings.presents.server.PresentsSession;
import com.threerings.bureau.data.BureauCredentials;
/**
* Handles resolution of bureaus and passes non-bureau resolution requests through to a normal
* factory. For bureaus, creates base class instances {@link PresentsClient} and
* factory. For bureaus, creates base class instances {@link PresentsSession} and
* {@link ClientResolver}.
* @see BureauRegistry#setDefaultClientFactory()
*/
@@ -44,12 +44,12 @@ public class BureauClientFactory implements ClientFactory
}
// from interface ClientFactory
public Class<? extends PresentsClient> getClientClass (AuthRequest areq)
public Class<? extends PresentsSession> getClientClass (AuthRequest areq)
{
// Just give bureaus a vanilla PresentsClient client for now.
// Just give bureaus a vanilla PresentsSession client for now.
// TODO: will bureaus need a more tailored client?
if (areq.getCredentials() instanceof BureauCredentials) {
return PresentsClient.class;
return PresentsSession.class;
} else {
return _delegate.getClientClass(areq);
}
@@ -41,7 +41,7 @@ import com.threerings.presents.data.ClientObject;
import com.threerings.presents.dobj.RootDObjectManager;
import com.threerings.presents.server.ClientManager;
import com.threerings.presents.server.InvocationManager;
import com.threerings.presents.server.PresentsClient;
import com.threerings.presents.server.PresentsSession;
import com.threerings.bureau.data.AgentObject;
import com.threerings.bureau.data.BureauCodes;
@@ -125,13 +125,13 @@ public class BureauRegistry
public void init ()
{
_clmgr.addClientObserver(new ClientManager.ClientObserver() {
public void clientSessionDidStart (PresentsClient client) {
public void clientSessionDidStart (PresentsSession client) {
String id = BureauCredentials.extractBureauId(client.getUsername());
if (id != null) {
sessionDidStart(client, id);
}
}
public void clientSessionDidEnd (PresentsClient client) {
public void clientSessionDidEnd (PresentsSession client) {
String id = BureauCredentials.extractBureauId(client.getUsername());
if (id != null) {
sessionDidEnd(client, id);
@@ -323,7 +323,7 @@ public class BureauRegistry
/**
* Returns the active session for a bureau of the given id.
*/
public PresentsClient lookupClient (String bureauId)
public PresentsSession lookupClient (String bureauId)
{
Bureau bureau = _bureaus.get(bureauId);
if (bureau == null) {
@@ -332,7 +332,7 @@ public class BureauRegistry
return bureau.client;
}
protected void sessionDidStart (PresentsClient client, String id)
protected void sessionDidStart (PresentsSession client, String id)
{
Bureau bureau = _bureaus.get(id);
if (bureau == null) {
@@ -346,7 +346,7 @@ public class BureauRegistry
bureau.client = client;
}
protected void sessionDidEnd (PresentsClient client, String id)
protected void sessionDidEnd (PresentsSession client, String id)
{
Bureau bureau = _bureaus.get(id);
if (bureau == null) {
@@ -691,7 +691,7 @@ public class BureauRegistry
ClientObject clientObj;
// The client session
PresentsClient client;
PresentsSession client;
// The states of the various agents allocated to this bureau
Map<AgentObject, AgentState> agentStates = Maps.newHashMap();