| java.lang.Object org.esupportail.cas.server.util.log.Debug org.esupportail.cas.server.util.Server
All known Subclasses: org.esupportail.cas.server.handlers.ldap.LdapServer, org.esupportail.cas.server.handlers.database.DatabaseServer, org.esupportail.cas.server.handlers.nt.NtServer, org.esupportail.cas.server.handlers.nis.multiple.NisServer,
Server | abstract public class Server extends Debug (Code) | | This abstract class implements a generic server class, inherited
by DatabaseServer and LDAPServer.
author: Pascal Aubry |
Field Summary | |
final protected static int | AUTHENTICATE_FAILURE The result of the authenticate() method on failure (when the server
could not be accessed for instance). | final protected static int | AUTHENTICATE_NOAUTH The result of the authenticate() method when the user could not
be authenticated (but the server was accessed without any problem). | final protected static int | AUTHENTICATE_SUCCESS The result of the authenticate() method on success (when the
user has been authenticated). | final protected static int | CONNECT_FAILURE The error code set by the connect() method when the connection
with the server could not be achieved because of a service failure. | final protected static int | CONNECT_NOAUTH The error code set by the connect() method when the connection
with the server could not be achieved because of the bind
information provided (the server responded but refused the
connection). | final protected static int | CONNECT_SUCCESS The error set by the connect() method on success. |
AUTHENTICATE_FAILURE | final protected static int AUTHENTICATE_FAILURE(Code) | | The result of the authenticate() method on failure (when the server
could not be accessed for instance). When testing many servers, the
next server will be called.
|
AUTHENTICATE_NOAUTH | final protected static int AUTHENTICATE_NOAUTH(Code) | | The result of the authenticate() method when the user could not
be authenticated (but the server was accessed without any problem).
When testing many servers, the next servers will not be called.
|
AUTHENTICATE_SUCCESS | final protected static int AUTHENTICATE_SUCCESS(Code) | | The result of the authenticate() method on success (when the
user has been authenticated).
|
CONNECT_FAILURE | final protected static int CONNECT_FAILURE(Code) | | The error code set by the connect() method when the connection
with the server could not be achieved because of a service failure.
Returned by getConnectError().
|
CONNECT_NOAUTH | final protected static int CONNECT_NOAUTH(Code) | | The error code set by the connect() method when the connection
with the server could not be achieved because of the bind
information provided (the server responded but refused the
connection). Returned by getConnectError().
|
CONNECT_SUCCESS | final protected static int CONNECT_SUCCESS(Code) | | The error set by the connect() method on success.
|
Server | public Server(Boolean handlerDebug, RedundantHandler parentHandler, Element serverElement)(Code) | | Constructor.
Parameters: handlerDebug - debugging mode Parameters: parentHandler - the handler the server will be used by Parameters: serverElement - an XML element corresponding to the server configuration |
authenticate | abstract protected int authenticate(String username, String password)(Code) | | Try to authenticate a user.
Parameters: username - the user's name Parameters: password - the user's password Server.AUTHENTICATE_SUCCESS, Server.AUTHENTICATE_NOAUTHor Server.AUTHENTICATE_FAILURE. |
getConnectError | final protected int getConnectError()(Code) | | Retrieve the error code of the last connect() call.
Server.CONNECT_SUCCESS, Server.CONNECT_NOAUTHor Server.CONNECT_FAILURE. |
getHandler | final protected RedundantHandler getHandler()(Code) | | Get the handler the server will be used by.
a RedundantHandler object. |
getServerSubElementContent | final protected String getServerSubElementContent(Element serverElement, String elementName, boolean needed) throws Exception(Code) | | Retrieve the content of a server sub-element.
Parameters: serverElement - the XML element representing the server in the configuration Parameters: elementName - the name of the XML element to look for Parameters: needed - false if the element can be absent or empty, true otherwise a String throws: Exception - Exception |
setConnectError | final protected void setConnectError(int errCode)(Code) | | Set the error code of the last connect() call.
Parameters: errCode - an integer equal to Server.CONNECT_SUCCESS, Server.CONNECT_NOAUTH or Server.CONNECT_FAILURE. |
|
|