com.noelios.restlet.ext.oauth
Class AuthorizationResource

java.lang.Object
  extended by org.restlet.Handler
      extended by org.restlet.resource.Resource
          extended by com.noelios.restlet.ext.oauth.AuthorizationResource

public abstract class AuthorizationResource
extends Resource

Handles user authorization of an OAuth request token.

Author:
Adam Rosien

Constructor Summary
AuthorizationResource(Context context, Request request, Response response)
          Constructor.
 
Method Summary
 void acceptRepresentation(Representation entity)
           
 boolean allowPost()
           
protected  void handleFailedAuthorization()
          Handle if the user has denied authorization of a client.
protected abstract  boolean isAuthorized()
          Return true if the request has been authorized by the user, false otherwise.
abstract  Representation represent(Variant variant)
          Return a user-accessible page asking if the user wants to authorize the client.
 
Methods inherited from class org.restlet.resource.Resource
allowDelete, allowGet, allowPut, delete, getPreferredRepresentation, getPreferredVariant, getRepresentation, getVariants, handleDelete, handleGet, handlePost, handlePut, init, isAvailable, isModifiable, isNegotiateContent, isReadable, post, put, removeRepresentations, represent, setAvailable, setModifiable, setNegotiateContent, setReadable, setVariants, storeRepresentation
 
Methods inherited from class org.restlet.Handler
allowHead, allowOptions, generateRef, getAllowedMethods, getApplication, getContext, getLogger, getMatrix, getQuery, getRequest, getResponse, handleHead, handleOptions, setContext, setRequest, setResponse, updateAllowedMethods
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthorizationResource

public AuthorizationResource(Context context,
                             Request request,
                             Response response)
Constructor.

Parameters:
context - The parent context.
request - The current request.
response - The current response.
Method Detail

acceptRepresentation

public void acceptRepresentation(Representation entity)
Overrides:
acceptRepresentation in class Resource

allowPost

public boolean allowPost()
Overrides:
allowPost in class Resource

handleFailedAuthorization

protected void handleFailedAuthorization()
Handle if the user has denied authorization of a client. By default it sets the response entity to the message "You have DENIED authorization." to the client.


isAuthorized

protected abstract boolean isAuthorized()
Return true if the request has been authorized by the user, false otherwise.

Returns:
True if the request has been authorized by the user, false otherwise.

represent

public abstract Representation represent(Variant variant)
Return a user-accessible page asking if the user wants to authorize the client.

Overrides:
represent in class Resource


Copyright © 2005-2008 Noelios Technologies.