| java.lang.Object org.nemesis.forum.AuthorizationFactory
All known Subclasses: org.nemesis.forum.impl.DbAuthorizationFactory,
AuthorizationFactory | abstract public class AuthorizationFactory (Code) | | An abstract class that defines a framework for providing authorization
services. The static getAuthorization(String,String) and
getAnonymousAuthorization() methods should be called directly from
applications using in order to obtain Authorization tokens.
Users that wish to change the AuthorizationFactory implementation
used to generate tokens can set the AuthorizationFactory.className
property. For example, if you have altered to use LDAP for user
information, you'd want to write a custom implementation of
AuthorizationFactory to make LDAP authorization queries. After changing the
AuthorizationFactory.className property, you must restart
your application server.
|
Field Summary | |
protected static Log | log |
log | protected static Log log(Code) | | |
createAnonymousAuthorization | abstract public Authorization createAnonymousAuthorization()(Code) | | Creates anonymous Authorization tokens. This method is implemented by
concrete subclasses AuthorizationFactory.
an anonymous Authorization token. |
createAuthorization | abstract public Authorization createAuthorization(String username, String password) throws UnauthorizedException(Code) | | Creates Authorization tokens for users. This method is implemented by
concrete subclasses of AuthorizationFactory.
Parameters: username - the username to create an Authorization with. Parameters: password - the password to create an Authorization with. an Authorization token if the username and password are correct. throws: UnauthorizedException - if the username and password do not matchany existing user. |
getAnonymousAuthorization | public static Authorization getAnonymousAuthorization()(Code) | | Returns the anonymous user Authorization.
an anonymous Authorization token. |
getAuthorization | public static Authorization getAuthorization(String username, String password) throws UnauthorizedException(Code) | | Returns the Authorization token associated with the specified username
and password. If the username and password do not match the record of
any user in the system, the method throws an UnauthorizedException.
When using most implementations of this class, authorization tokens
should be cached. A convenient place to store a token is often in the
HttpSession.
Parameters: username - the username to create an Authorization with. Parameters: password - the password to create an Authorization with. an Authorization token if the username and password are correct. throws: UnauthorizedException - if the username and password do not matchany existing user. |
|
|