com.threerings.presents.server.net
Class AuthingConnection

java.lang.Object
  extended by com.threerings.nio.conman.Connection
      extended by com.threerings.presents.server.net.PresentsConnection
          extended by com.threerings.presents.server.net.AuthingConnection
All Implemented Interfaces:
NetEventHandler

public class AuthingConnection
extends PresentsConnection

The authing connection manages the client connection until authentication has completed (for better or for worse).


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.presents.server.net.PresentsConnection
PresentsConnection.MessageHandler
 
Field Summary
protected  Name _authname
           
protected  AuthRequest _authreq
           
protected  AuthResponse _authrsp
           
protected  int _clientSecureVersion
          The secure version for our connecting client.
protected  byte[] _serverSecret
          The random secret generating for this connection.
 
Fields inherited from class com.threerings.presents.server.net.PresentsConnection
_datagramAddress, _datagramChannel, _datagramSecret, _digest, _fin, _handler, _loader, _oin, _oout, _pcmgr, _sequencer, _transmitDatagrams
 
Fields inherited from class com.threerings.nio.conman.Connection
_channel, _cmgr, _connectionId, _lastConnectionId, _lastEvent, selkey
 
Constructor Summary
AuthingConnection()
           
 
Method Summary
 Name getAuthName()
          Returns the username that uniquely identifies this authenticated session.
 AuthRequest getAuthRequest()
          Returns a reference to the auth request currently being processed.
 AuthResponse getAuthResponse()
          Returns the auth response delivered to the client (only valid after the auth request has been processed.
protected  void safePostMessage(DownstreamMessage msg)
          Callable from non-dobjmgr thread, this queues up a runnable on the dobjmgr thread to post the supplied message to this client.
 void setAuthName(Name authname)
          During the authentication process, the authenticator must establish the client's authentication username and configure it via this method.
 void setAuthResponse(AuthResponse authrsp)
          Stores a reference to the auth response delivered to this connection.
 String toString()
           
 
Methods inherited from class com.threerings.presents.server.net.PresentsConnection
clearMessageHandler, createObjectInputStream, getDatagramAddress, getDatagramChannel, getDatagramSequencer, getObjectInputStream, getObjectOutputStream, getTransmitDatagrams, handleDatagram, handleEvent, inheritStreams, init, postMessage, setClassLoader, setDatagramSecret, setMessageHandler, setObjectOutputStream, setTransmitDatagrams
 
Methods inherited from class com.threerings.nio.conman.Connection
asyncClose, becameIdle, checkIdle, close, closeSocket, connectFailure, getChannel, getConnectionId, getInetAddress, isClosed, networkFailure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_authreq

protected AuthRequest _authreq

_authrsp

protected AuthResponse _authrsp

_authname

protected Name _authname

_serverSecret

protected byte[] _serverSecret
The random secret generating for this connection.


_clientSecureVersion

protected int _clientSecureVersion
The secure version for our connecting client.

Constructor Detail

AuthingConnection

public AuthingConnection()
Method Detail

getAuthRequest

public AuthRequest getAuthRequest()
Returns a reference to the auth request currently being processed.


getAuthResponse

public AuthResponse getAuthResponse()
Returns the auth response delivered to the client (only valid after the auth request has been processed.


setAuthResponse

public void setAuthResponse(AuthResponse authrsp)
Stores a reference to the auth response delivered to this connection. This is called by the auth manager after delivering the auth response to the client.


getAuthName

public Name getAuthName()
Returns the username that uniquely identifies this authenticated session. This will be used to map Name -> PresentsSession in the ClientManager and used elsewhere.


setAuthName

public void setAuthName(Name authname)
During the authentication process, the authenticator must establish the client's authentication username and configure it via this method.


toString

public String toString()
Overrides:
toString in class Connection

safePostMessage

protected final void safePostMessage(DownstreamMessage msg)
Callable from non-dobjmgr thread, this queues up a runnable on the dobjmgr thread to post the supplied message to this client.