|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.restlet.Restlet
org.restlet.routing.Filter
org.restlet.security.Authorizer
public abstract class Authorizer
Filter authorizing inbound request. It can be attached to protect a set of
downstream Restlet and ServerResource objects.
| Field Summary | |
|---|---|
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. |
| Fields inherited from class org.restlet.routing.Filter |
|---|
CONTINUE, SKIP, STOP |
| Constructor Summary | |
|---|---|
Authorizer()
Default constructor. |
|
Authorizer(String identifier)
Constructor. |
|
| Method Summary | |
|---|---|
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. |
String |
getIdentifier()
Returns the identifier unique within an application. |
void |
setIdentifier(String identifier)
Sets the identifier unique within an application. |
protected int |
unauthorized(Request request,
Response response)
Invoked upon failed authorization. |
| Methods inherited from class org.restlet.routing.Filter |
|---|
afterHandle, doHandle, getNext, handle, hasNext, setNext, setNext, start, stop |
| Methods inherited from class org.restlet.Restlet |
|---|
createFinder, finalize, getApplication, getAuthor, getContext, getDescription, getFinderClass, getLogger, getName, getOwner, handle, handle, handle, isStarted, isStopped, setAuthor, setContext, setDescription, setFinderClass, setName, setOwner |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public Authorizer()
public Authorizer(String identifier)
identifier - The identifier unique within an application.| Method Detail |
|---|
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)
FilterFilter.CONTINUE by default.
beforeHandle in class Filterrequest - The request to handle.response - The response to update.
Filter.CONTINUE or
Filter.SKIP or Filter.STOP.public String getIdentifier()
public void setIdentifier(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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||