diff --git a/src/java/com/threerings/bureau/server/BureauClientFactory.java b/src/java/com/threerings/bureau/server/BureauClientFactory.java index 1c261ac71..a5172a286 100644 --- a/src/java/com/threerings/bureau/server/BureauClientFactory.java +++ b/src/java/com/threerings/bureau/server/BureauClientFactory.java @@ -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 getClientClass (AuthRequest areq) + public Class 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); } diff --git a/src/java/com/threerings/bureau/server/BureauRegistry.java b/src/java/com/threerings/bureau/server/BureauRegistry.java index 47df599ba..0e8e39151 100644 --- a/src/java/com/threerings/bureau/server/BureauRegistry.java +++ b/src/java/com/threerings/bureau/server/BureauRegistry.java @@ -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 agentStates = Maps.newHashMap(); diff --git a/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java b/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java index efb0c825d..b1e4c8ba1 100644 --- a/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java +++ b/src/java/com/threerings/crowd/peer/server/CrowdPeerManager.java @@ -32,7 +32,7 @@ import com.threerings.presents.peer.server.PeerManager; import com.threerings.presents.peer.server.PeerNode; import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationManager; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; import com.threerings.presents.server.ShutdownManager; import com.threerings.crowd.chat.client.ChatService; @@ -130,7 +130,7 @@ public class CrowdPeerManager extends PeerManager } @Override // documentation inherited - protected void initClientInfo (PresentsClient client, ClientInfo info) + protected void initClientInfo (PresentsSession client, ClientInfo info) { super.initClientInfo(client, info); ((CrowdClientInfo)info).visibleName = diff --git a/src/java/com/threerings/crowd/server/CrowdObjectAccess.java b/src/java/com/threerings/crowd/server/CrowdObjectAccess.java index 81fa82fc9..c8f12a7bf 100644 --- a/src/java/com/threerings/crowd/server/CrowdObjectAccess.java +++ b/src/java/com/threerings/crowd/server/CrowdObjectAccess.java @@ -45,8 +45,8 @@ public class CrowdObjectAccess // documentation inherited from interface public boolean allowSubscribe (DObject object, Subscriber sub) { - if (CrowdClient.class.isInstance(sub)) { - ClientObject co = CrowdClient.class.cast(sub).getClientObject(); + if (CrowdSession.class.isInstance(sub)) { + ClientObject co = CrowdSession.class.cast(sub).getClientObject(); return ((PlaceObject)object).occupants.contains(co.getOid()); } return true; diff --git a/src/java/com/threerings/crowd/server/CrowdServer.java b/src/java/com/threerings/crowd/server/CrowdServer.java index d214e9ada..69f5a59d9 100644 --- a/src/java/com/threerings/crowd/server/CrowdServer.java +++ b/src/java/com/threerings/crowd/server/CrowdServer.java @@ -31,7 +31,7 @@ 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.presents.server.PresentsServer; import com.threerings.crowd.chat.server.ChatProvider; @@ -64,8 +64,8 @@ public class CrowdServer extends PresentsServer // configure the client manager to use our bits _clmgr.setClientFactory(new ClientFactory() { - public Class getClientClass (AuthRequest areq) { - return CrowdClient.class; + public Class getClientClass (AuthRequest areq) { + return CrowdSession.class; } public Class getClientResolverClass (Name username) { return CrowdClientResolver.class; diff --git a/src/java/com/threerings/crowd/server/CrowdClient.java b/src/java/com/threerings/crowd/server/CrowdSession.java similarity index 94% rename from src/java/com/threerings/crowd/server/CrowdClient.java rename to src/java/com/threerings/crowd/server/CrowdSession.java index 9a84a8352..0604caa43 100644 --- a/src/java/com/threerings/crowd/server/CrowdClient.java +++ b/src/java/com/threerings/crowd/server/CrowdSession.java @@ -23,16 +23,16 @@ package com.threerings.crowd.server; import com.google.inject.Inject; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; import com.threerings.crowd.chat.server.SpeakUtil; import com.threerings.crowd.data.BodyObject; import com.threerings.crowd.data.OccupantInfo; /** - * The crowd client extends the presents client with crowd-specific client handling. + * Extends the presents session with crowd-specific session handling. */ -public class CrowdClient extends PresentsClient +public class CrowdSession extends PresentsSession { @Override protected void sessionConnectionClosed () diff --git a/src/java/com/threerings/crowd/server/LocationManager.java b/src/java/com/threerings/crowd/server/LocationManager.java index fceb6385e..37e09e83f 100644 --- a/src/java/com/threerings/crowd/server/LocationManager.java +++ b/src/java/com/threerings/crowd/server/LocationManager.java @@ -29,7 +29,7 @@ import com.threerings.presents.dobj.RootDObjectManager; import com.threerings.presents.server.ClientManager; import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationManager; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; import com.threerings.crowd.client.LocationService; import com.threerings.crowd.data.BodyObject; @@ -111,7 +111,7 @@ public class LocationManager } // configure the client accordingly if the place uses a custom class loader - PresentsClient client = _clmgr.getClient(source.username); + PresentsSession client = _clmgr.getClient(source.username); if (client != null) { client.setClassLoader(pmgr.getClass().getClassLoader()); } diff --git a/src/java/com/threerings/presents/net/AuthResponse.java b/src/java/com/threerings/presents/net/AuthResponse.java index 3dc8269fc..fd6578cfc 100644 --- a/src/java/com/threerings/presents/net/AuthResponse.java +++ b/src/java/com/threerings/presents/net/AuthResponse.java @@ -31,7 +31,7 @@ package com.threerings.presents.net; public class AuthResponse extends DownstreamMessage { /** Auxilliary authentication data to be communicated to the - * PresentsClient once a session is started. This is a means by + * PresentsSession once a session is started. This is a means by * which the Authenticator can pass information loaded from, * say, an authentication database into the runtime system to be used, for * example for permissions. */ diff --git a/src/java/com/threerings/presents/peer/server/PeerClientFactory.java b/src/java/com/threerings/presents/peer/server/PeerClientFactory.java index 730837a97..3cd41f82e 100644 --- a/src/java/com/threerings/presents/peer/server/PeerClientFactory.java +++ b/src/java/com/threerings/presents/peer/server/PeerClientFactory.java @@ -27,7 +27,7 @@ import com.threerings.presents.net.AuthRequest; import com.threerings.presents.peer.net.PeerCreds; import com.threerings.presents.server.ClientFactory; import com.threerings.presents.server.ClientResolver; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; /** * Handles resolution of peer servers and passes non-peer resolution requests through to a normal @@ -41,10 +41,10 @@ public class PeerClientFactory implements ClientFactory } // documentation inherited from interface ClientFactory - public Class getClientClass (AuthRequest areq) + public Class getClientClass (AuthRequest areq) { if (areq.getCredentials() instanceof PeerCreds) { - return PeerClient.class; + return PeerSession.class; } else { return _delegate.getClientClass(areq); } diff --git a/src/java/com/threerings/presents/peer/server/PeerManager.java b/src/java/com/threerings/presents/peer/server/PeerManager.java index 93a20caad..a48b2f2e5 100644 --- a/src/java/com/threerings/presents/peer/server/PeerManager.java +++ b/src/java/com/threerings/presents/peer/server/PeerManager.java @@ -64,7 +64,7 @@ import com.threerings.presents.data.ClientObject; import com.threerings.presents.server.ClientManager; import com.threerings.presents.server.InvocationException; import com.threerings.presents.server.InvocationManager; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; import com.threerings.presents.server.PresentsDObjectMgr; import com.threerings.presents.server.ReportManager; import com.threerings.presents.server.ShutdownManager; @@ -643,7 +643,7 @@ public abstract class PeerManager } /** - * Called by {@link PeerClient}s when clients subscribe to the {@link NodeObject}. + * Called by {@link PeerSession}s when clients subscribe to the {@link NodeObject}. */ public void clientSubscribedToNode (int cloid) { @@ -651,7 +651,7 @@ public abstract class PeerManager } /** - * Called by {@link PeerClient}s when clients unsubscribe from the {@link NodeObject}. + * Called by {@link PeerSession}s when clients unsubscribe from the {@link NodeObject}. */ public void clientUnsubscribedFromNode (int cloid) { @@ -768,7 +768,7 @@ public abstract class PeerManager } // from interface ClientManager.ClientObserver - public void clientSessionDidStart (PresentsClient client) + public void clientSessionDidStart (PresentsSession client) { if (ignoreClient(client)) { return; @@ -790,7 +790,7 @@ public abstract class PeerManager } // from interface ClientManager.ClientObserver - public void clientSessionDidEnd (PresentsClient client) + public void clientSessionDidEnd (PresentsSession client) { if (ignoreClient(client)) { return; @@ -872,10 +872,10 @@ public abstract class PeerManager * the beginning and end of the client session, so this method should return the same value * both times. */ - protected boolean ignoreClient (PresentsClient client) + protected boolean ignoreClient (PresentsSession client) { // if this is another peer, don't publish their info - return (client instanceof PeerClient); + return (client instanceof PeerSession); } /** @@ -947,7 +947,7 @@ public abstract class PeerManager /** * Initializes the supplied client info for the supplied client. */ - protected void initClientInfo (PresentsClient client, ClientInfo info) + protected void initClientInfo (PresentsSession client, ClientInfo info) { info.username = client.getCredentials().getUsername(); } @@ -955,7 +955,7 @@ public abstract class PeerManager /** * Called when a client ends their session to clear their information from our node object. */ - protected void clearClientInfo (PresentsClient client, ClientInfo info) + protected void clearClientInfo (PresentsSession client, ClientInfo info) { _nodeobj.removeFromClients(info.getKey()); } diff --git a/src/java/com/threerings/presents/peer/server/PeerClient.java b/src/java/com/threerings/presents/peer/server/PeerSession.java similarity index 76% rename from src/java/com/threerings/presents/peer/server/PeerClient.java rename to src/java/com/threerings/presents/peer/server/PeerSession.java index 9de0b369a..a699d62c5 100644 --- a/src/java/com/threerings/presents/peer/server/PeerClient.java +++ b/src/java/com/threerings/presents/peer/server/PeerSession.java @@ -29,28 +29,27 @@ import com.threerings.presents.dobj.DObject; import com.threerings.presents.net.BootstrapData; import com.threerings.presents.peer.data.NodeObject; import com.threerings.presents.peer.net.PeerBootstrapData; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; import static com.threerings.presents.Log.log; /** - * Manages a peer connection. + * Manages a peer session. */ -public class PeerClient extends PresentsClient +public class PeerSession extends PresentsSession { /** - * Creates a peer client and provides it with a reference to the peer - * manager. This is only done by the {@link PeerClientFactory}. + * Creates a peer session and provides it with a reference to the peer manager. This is only + * done by the {@link PeerClientFactory}. */ - @Inject public PeerClient (PeerManager peermgr) + @Inject public PeerSession (PeerManager peermgr) { _peermgr = peermgr; } /** - * Derived client classes can override this member to create derived - * bootstrap data classes that contain extra bootstrap information, if - * desired. + * Derived classes can override this member to create derived bootstrap data classes that + * contain extra bootstrap information, if desired. */ @Override protected BootstrapData createBootstrapData () @@ -59,14 +58,12 @@ public class PeerClient extends PresentsClient } /** - * Derived client classes can override this member to populate the - * bootstrap data with additional information. They should be sure to - * call super.populateBootstrapData before doing their - * own populating, however. + * Derived classes can override this member to populate the bootstrap data with additional + * information. They should be sure to call super.populateBootstrapData before + * doing their own populating, however. * - *

Note: This function will be called on the dobjmgr - * thread which means that object manipulations are OK, but client - * instance manipulations must be done carefully. + *

Note: This function will be called on the dobjmgr thread which means that object + * manipulations are OK, but client instance manipulations must be done carefully. */ @Override protected void populateBootstrapData (BootstrapData data) @@ -87,7 +84,7 @@ public class PeerClient extends PresentsClient _cloid = _clobj.getOid(); } - @Override // from PresentsClient + @Override // from PresentsSession protected void subscribedToObject (DObject object) { super.subscribedToObject(object); @@ -96,7 +93,7 @@ public class PeerClient extends PresentsClient } } - @Override // from PresentsClient + @Override // from PresentsSession protected void unsubscribedFromObject (DObject object) { super.unsubscribedFromObject(object); @@ -105,14 +102,14 @@ public class PeerClient extends PresentsClient } } - @Override // from PresentsClient + @Override // from PresentsSession protected Throttle createIncomingMessageThrottle () { // more than 100 messages per second and we complain about it return new Throttle(100, 1000L); } - @Override // from PresentsClient + @Override // from PresentsSession protected void handleThrottleExceeded () { long now = System.currentTimeMillis(); diff --git a/src/java/com/threerings/presents/server/ClientFactory.java b/src/java/com/threerings/presents/server/ClientFactory.java index 21ea7fc42..a8322065a 100644 --- a/src/java/com/threerings/presents/server/ClientFactory.java +++ b/src/java/com/threerings/presents/server/ClientFactory.java @@ -26,15 +26,15 @@ import com.threerings.util.Name; import com.threerings.presents.net.AuthRequest; /** - * Used to determine what type of {@link PresentsClient} to use to manage an authenticated client + * Used to determine what type of {@link PresentsSession} to use to manage an authenticated client * as well the type of {@link ClientResolver} to use when resolving clients' runtime data. */ public interface ClientFactory { /** The default client factory. */ public static ClientFactory DEFAULT = new ClientFactory() { - public Class getClientClass (AuthRequest areq) { - return PresentsClient.class; + public Class getClientClass (AuthRequest areq) { + return PresentsSession.class; } public Class getClientResolverClass (Name username) { return ClientResolver.class; @@ -42,10 +42,10 @@ public interface ClientFactory }; /** - * Returns the {@link PresentsClient} derived class to use for the session that authenticated + * Returns the {@link PresentsSession} derived class to use for the session that authenticated * with the supplied request. */ - Class getClientClass (AuthRequest areq); + Class getClientClass (AuthRequest areq); /** * Returns the {@link ClientResolver} derived class to use to resolve a client with the diff --git a/src/java/com/threerings/presents/server/ClientManager.java b/src/java/com/threerings/presents/server/ClientManager.java index 9fbf827d5..cb964a100 100644 --- a/src/java/com/threerings/presents/server/ClientManager.java +++ b/src/java/com/threerings/presents/server/ClientManager.java @@ -88,13 +88,13 @@ public class ClientManager /** * Called when a client has authenticated and been resolved and has started their session. */ - void clientSessionDidStart (PresentsClient client); + void clientSessionDidStart (PresentsSession client); /** * Called when a client has logged off or been forcibly logged off due to inactivity and * has thus ended their session. */ - void clientSessionDidEnd (PresentsClient client); + void clientSessionDidEnd (PresentsSession client); } /** @@ -119,7 +119,7 @@ public class ClientManager } /** - * Configures the injector we'll use to resolve dependencies for {@link PresentsClient} + * Configures the injector we'll use to resolve dependencies for {@link PresentsSession} * instances. */ public void setInjector (Injector injector) @@ -134,7 +134,7 @@ public class ClientManager // inform all of our clients that they are being shut down synchronized (_usermap) { - for (PresentsClient pc : _usermap.values()) { + for (PresentsSession pc : _usermap.values()) { try { pc.shutdown(); } catch (Exception e) { @@ -146,7 +146,7 @@ public class ClientManager } /** - * Configures the client manager with a factory for creating {@link PresentsClient} and {@link + * Configures the client manager with a factory for creating {@link PresentsSession} and {@link * ClientResolver} classes for authenticated client connections. */ public void setClientFactory (ClientFactory factory) @@ -216,7 +216,7 @@ public class ClientManager * Returns the client instance that manages the client session for the specified authentication * username or null if that client is not currently connected to the server. */ - public PresentsClient getClient (Name authUsername) + public PresentsSession getClient (Name authUsername) { synchronized (_usermap) { return _usermap.get(authUsername); @@ -375,7 +375,7 @@ public class ClientManager Name username = creds.getUsername(); // see if a client is already registered with these credentials - PresentsClient client = getClient(username); + PresentsSession client = getClient(username); if (client != null) { log.info("Resuming session [username=" + username + ", conn=" + conn + "]."); @@ -401,7 +401,7 @@ public class ClientManager public synchronized void connectionFailed (Connection conn, IOException fault) { // remove the client from the connection map - PresentsClient client = _conmap.remove(conn); + PresentsSession client = _conmap.remove(conn); if (client != null) { log.info("Unmapped failed client [client=" + client + ", conn=" + conn + ", fault=" + fault + "]."); @@ -419,7 +419,7 @@ public class ClientManager public synchronized void connectionClosed (Connection conn) { // remove the client from the connection map - PresentsClient client = _conmap.remove(conn); + PresentsSession client = _conmap.remove(conn); if (client != null) { log.debug("Unmapped client [client=" + client + ", conn=" + conn + "]."); // let the client know the connection went away @@ -448,7 +448,7 @@ public class ClientManager * Called by the client instance when it has started its session. This is called from the * dobjmgr thread. */ - protected void clientSessionDidStart (final PresentsClient client) + protected void clientSessionDidStart (final PresentsSession client) { // let the observers know _clobservers.apply(new ObserverList.ObserverOp() { @@ -463,11 +463,11 @@ public class ClientManager * Called by the client instance when the client requests a logoff. This is called from the * dobjmgr thread. */ - protected void clientSessionDidEnd (final PresentsClient client) + protected void clientSessionDidEnd (final PresentsSession client) { // remove the client from the username map Name username = client.getCredentials().getUsername(); - PresentsClient rc; + PresentsSession rc; synchronized (_usermap) { rc = _usermap.remove(username); } @@ -497,12 +497,12 @@ public class ClientManager */ protected void flushClients () { - List victims = Lists.newArrayList(); + List victims = Lists.newArrayList(); long now = System.currentTimeMillis(); // first build a list of our victims synchronized (_usermap) { - for (PresentsClient client : _usermap.values()) { + for (PresentsSession client : _usermap.values()) { if (client.checkExpired(now)) { victims.add(client); } @@ -510,7 +510,7 @@ public class ClientManager } // now end their sessions - for (PresentsClient client : victims) { + for (PresentsSession client : victims) { try { log.info("Client expired, ending session [client=" + client + ", dtime=" + (now-client.getNetworkStamp()) + "ms]."); @@ -549,14 +549,14 @@ public class ClientManager protected ClientOp _clop; } - /** Used to resolve dependencies in {@link PresentsClient} instances that we create. */ + /** Used to resolve dependencies in {@link PresentsSession} instances that we create. */ protected Injector _injector; /** A mapping from auth username to client instances. */ - protected Map _usermap = Maps.newHashMap(); + protected Map _usermap = Maps.newHashMap(); /** A mapping from connections to client instances. */ - protected Map _conmap = Maps.newHashMap(); + protected Map _conmap = Maps.newHashMap(); /** A mapping from usernames to client object instances. */ protected Map _objmap = Maps.newHashMap(); diff --git a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java index cfa396ea6..0e706ef98 100644 --- a/src/java/com/threerings/presents/server/PresentsDObjectMgr.java +++ b/src/java/com/threerings/presents/server/PresentsDObjectMgr.java @@ -575,7 +575,7 @@ public class PresentsDObjectMgr /** * Tests if the event processing thread is still running. This is required by the - * {@link ConnectionManager} to ensure messages posted just before or during shutdown are sent. + * ConnectionManager to ensure messages posted just before or during shutdown are sent. */ public synchronized boolean isRunning () { diff --git a/src/java/com/threerings/presents/server/PresentsObjectAccess.java b/src/java/com/threerings/presents/server/PresentsObjectAccess.java index 04aef83b3..5abe65ae9 100644 --- a/src/java/com/threerings/presents/server/PresentsObjectAccess.java +++ b/src/java/com/threerings/presents/server/PresentsObjectAccess.java @@ -74,8 +74,8 @@ public class PresentsObjectAccess { boolean allowed = true; // if the subscriber is a client, ensure that they are this same user - if (PresentsClient.class.isInstance(sub)) { - PresentsClient client = PresentsClient.class.cast(sub); + if (PresentsSession.class.isInstance(sub)) { + PresentsSession client = PresentsSession.class.cast(sub); allowed = (client.getClientObject() == object); if (!allowed) { log.warning("Refusing ClientObject subscription request " + diff --git a/src/java/com/threerings/presents/server/PresentsClient.java b/src/java/com/threerings/presents/server/PresentsSession.java similarity index 97% rename from src/java/com/threerings/presents/server/PresentsClient.java rename to src/java/com/threerings/presents/server/PresentsSession.java index 1b062ddc0..fe54d70be 100644 --- a/src/java/com/threerings/presents/server/PresentsClient.java +++ b/src/java/com/threerings/presents/server/PresentsSession.java @@ -83,10 +83,10 @@ import static com.threerings.presents.Log.log; * without synchronization. This does not overlap with its other client duties which are called * from the conmgr thread and therefore also need not be synchronized. */ -public class PresentsClient +public class PresentsSession implements MessageHandler, ClientResolutionListener { - /** Used by {@link PresentsClient#setUsername} to report success or failure. */ + /** Used by {@link PresentsSession#setUsername} to report success or failure. */ public static interface UserChangeListener { /** Called when the new client object has been resolved and the new client object reported @@ -106,7 +106,7 @@ public class PresentsClient } /** - * Returns the credentials used to authenticate this client. + * Returns the credentials used to authenticate this session. */ public Credentials getCredentials () { @@ -114,7 +114,7 @@ public class PresentsClient } /** - * Returns the time zone in which this client is operating. + * Returns the time zone in which the client is operating. */ public TimeZone getTimeZone () { @@ -122,8 +122,8 @@ public class PresentsClient } /** - * Returns true if this client has been disconnected for sufficiently long that its session - * should be forcibly ended. + * Returns true if this session has been disconnected for sufficiently long that it should be + * forcibly ended. */ public boolean checkExpired (long now) { @@ -164,7 +164,7 @@ public class PresentsClient } /** - * Configures this client with a custom class loader that will be used when unserializing + * Configures this session with a custom class loader that will be used when unserializing * classes from the network. */ public void setClassLoader (ClassLoader loader) @@ -966,7 +966,7 @@ public class PresentsClient /** * Dispatch the supplied message for the specified client. */ - void dispatch (PresentsClient client, UpstreamMessage mge); + void dispatch (PresentsSession client, UpstreamMessage mge); } /** @@ -974,7 +974,7 @@ public class PresentsClient */ protected static class SubscribeDispatcher implements MessageDispatcher { - public void dispatch (PresentsClient client, UpstreamMessage msg) + public void dispatch (PresentsSession client, UpstreamMessage msg) { SubscribeRequest req = (SubscribeRequest)msg; // log.info("Subscribing [client=" + client + ", oid=" + req.getOid() + "]."); @@ -989,7 +989,7 @@ public class PresentsClient */ protected static class UnsubscribeDispatcher implements MessageDispatcher { - public void dispatch (PresentsClient client, UpstreamMessage msg) + public void dispatch (PresentsSession client, UpstreamMessage msg) { UnsubscribeRequest req = (UnsubscribeRequest)msg; int oid = req.getOid(); @@ -1009,7 +1009,7 @@ public class PresentsClient */ protected static class ForwardEventDispatcher implements MessageDispatcher { - public void dispatch (PresentsClient client, UpstreamMessage msg) + public void dispatch (PresentsSession client, UpstreamMessage msg) { ForwardEventRequest req = (ForwardEventRequest)msg; DEvent fevt = req.getEvent(); @@ -1036,7 +1036,7 @@ public class PresentsClient */ protected static class PingDispatcher implements MessageDispatcher { - public void dispatch (PresentsClient client, UpstreamMessage msg) + public void dispatch (PresentsSession client, UpstreamMessage msg) { // send a pong response using the transport with which the message was received PingRequest req = (PingRequest)msg; @@ -1049,7 +1049,7 @@ public class PresentsClient */ protected static class ThrottleUpdatedDispatcher implements MessageDispatcher { - public void dispatch (final PresentsClient client, UpstreamMessage msg) + public void dispatch (final PresentsSession client, UpstreamMessage msg) { log.debug("Client ACKed throttle update", "client", client); client.throttleUpdated(); @@ -1061,7 +1061,7 @@ public class PresentsClient */ protected static class LogoffDispatcher implements MessageDispatcher { - public void dispatch (final PresentsClient client, UpstreamMessage msg) + public void dispatch (final PresentsSession client, UpstreamMessage msg) { log.debug("Client requested logoff", "client", client); client.safeEndSession(); diff --git a/tests/src/java/com/threerings/bureau/server/RegistryTester.java b/tests/src/java/com/threerings/bureau/server/RegistryTester.java index e3cec8655..8ca178785 100644 --- a/tests/src/java/com/threerings/bureau/server/RegistryTester.java +++ b/tests/src/java/com/threerings/bureau/server/RegistryTester.java @@ -32,7 +32,7 @@ import com.google.inject.Injector; import com.google.inject.Singleton; import com.threerings.presents.dobj.RootDObjectManager; -import com.threerings.presents.server.PresentsClient; +import com.threerings.presents.server.PresentsSession; import com.threerings.presents.server.ShutdownManager; import com.threerings.bureau.data.AgentObject; @@ -199,7 +199,7 @@ public class RegistryTester { if (_rng1.nextInt(100) < _killBureauChance) { log.info("Killing a bureau"); - PresentsClient bureau = getRandomBureau(); + PresentsSession bureau = getRandomBureau(); if (bureau == null) { log.info("No bureaus to kill right now"); return; @@ -221,7 +221,7 @@ public class RegistryTester } } - protected PresentsClient getRandomBureau () + protected PresentsSession getRandomBureau () { boolean[] tried = new boolean[_numBureaus]; for (int dead = 0; dead < _numBureaus;) { @@ -230,7 +230,7 @@ public class RegistryTester continue; } String id = "test-" + (index + 1); - PresentsClient client = _bureauReg.lookupClient(id); + PresentsSession client = _bureauReg.lookupClient(id); if (client == null) { ++dead; } else {