public abstract class Authorizer extends Filter
Restlet
and ServerResource
objects.Modifier and Type | Field and Description |
---|---|
static Authorizer |
ALWAYS
Authorizer returning true all the time.
|
static Authorizer |
AUTHENTICATED
Authorizer returning true for all authenticated requests.
|
static Authorizer |
NEVER
Authorizer returning false all the time.
|
Constructor and Description |
---|
Authorizer()
Default constructor.
|
Authorizer(java.lang.String identifier)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
authorize(Request request,
Response response)
Attempts to authorize the request.
|
protected int |
authorized(Request request,
Response response)
Invoked upon successful authorization.
|
protected int |
beforeHandle(Request request,
Response response)
Allows filtering before processing by the next Restlet.
|
java.lang.String |
getIdentifier()
Returns the identifier unique within an application.
|
void |
setIdentifier(java.lang.String identifier)
Sets the identifier unique within an application.
|
protected int |
unauthorized(Request request,
Response response)
Invoked upon failed authorization.
|
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner
public static final Authorizer ALWAYS
public static final Authorizer AUTHENTICATED
Status.CLIENT_ERROR_UNAUTHORIZED
instead of the default
Status.CLIENT_ERROR_FORBIDDEN
.ClientInfo.isAuthenticated()
public static final Authorizer NEVER
public Authorizer()
public Authorizer(java.lang.String identifier)
identifier
- The identifier unique within an application.protected abstract boolean authorize(Request request, Response response)
request
- The request sent.response
- The response to update.protected int authorized(Request request, Response response)
Filter.CONTINUE
by
default.request
- The request sent.response
- The response to update.protected int beforeHandle(Request request, Response response)
Filter
Filter.CONTINUE
by default.beforeHandle
in class Filter
request
- The request to handle.response
- The response to update.Filter.CONTINUE
or
Filter.SKIP
or Filter.STOP
.public java.lang.String getIdentifier()
public void setIdentifier(java.lang.String identifier)
identifier
- The identifier unique within an application.protected int unauthorized(Request request, Response response)
Status.CLIENT_ERROR_FORBIDDEN
and returns Filter.STOP
by
default.request
- The request sent.response
- The response to update.Copyright © 2005-2024 Restlet.