com.threerings.presents.server
Class ServiceAuthenticator<T extends ServiceCreds>
java.lang.Object
com.threerings.presents.server.Authenticator
com.threerings.presents.server.ChainedAuthenticator
com.threerings.presents.server.ServiceAuthenticator<T>
public abstract class ServiceAuthenticator<T extends ServiceCreds>
- extends ChainedAuthenticator
Works in conjunction with ServiceCreds to handle the authentication of service clients
(bureaus, peers, etc.).
|
Constructor Summary |
ServiceAuthenticator(Class<T> credsClass,
Class<? extends Name> authNameClass)
Creates an authenticator that will handle requests using the supplied credentials class and
which will create instances of the supplied auth name class to identify those clients. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_credsClass
protected Class<T extends ServiceCreds> _credsClass
_authNamer
protected Constructor<? extends Name> _authNamer
ServiceAuthenticator
public ServiceAuthenticator(Class<T> credsClass,
Class<? extends Name> authNameClass)
- Creates an authenticator that will handle requests using the supplied credentials class and
which will create instances of the supplied auth name class to identify those clients. Note
that the auth name class must have a public constructor that takes a single string.
shouldHandleConnection
public boolean shouldHandleConnection(AuthingConnection conn)
- Description copied from class:
ChainedAuthenticator
- Derived classes should implement this method and return true if the supplied connection is
one that they should authenticate.
- Specified by:
shouldHandleConnection in class ChainedAuthenticator
processAuthentication
protected void processAuthentication(AuthingConnection conn,
AuthResponse rsp)
throws Exception
- Description copied from class:
Authenticator
- Process the authentication for the specified connection. The method may return after it has
stuffed a valid response code in rsp.getData().code.
- Specified by:
processAuthentication in class Authenticator
- Parameters:
conn - The client connection.rsp - The response to the client, which will already contain an AuthResponseData
created by Authenticator.createResponseData().
- Throws:
Exception
areValid
protected abstract boolean areValid(T creds)
- Returns true if the creds in question are valid.