com.caucho.server.security
Class AbstractConstraint

java.lang.Object
  extended by com.caucho.server.security.AbstractConstraint
Direct Known Subclasses:
ContainerConstraint, IPConstraint, PermitEmptyRolesConstraint, RoleConstraint, TransportConstraint

public abstract class AbstractConstraint
extends java.lang.Object


Constructor Summary
AbstractConstraint()
           
 
Method Summary
abstract  AuthorizationResult isAuthorized(HttpServletRequest request, HttpServletResponse response, ServletContext application)
          Returns true if the user is authorized for the resource.
 boolean isPrivateCache()
          Returns true if any cache needs to be private.
 boolean needsAuthentication()
          Returns true if the constraint requires authentication.
protected  AbstractConstraint[] toArray()
          converts the sub constraints to an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConstraint

public AbstractConstraint()
Method Detail

needsAuthentication

public boolean needsAuthentication()
Returns true if the constraint requires authentication.


isPrivateCache

public boolean isPrivateCache()
Returns true if any cache needs to be private.


isAuthorized

public abstract AuthorizationResult isAuthorized(HttpServletRequest request,
                                                 HttpServletResponse response,
                                                 ServletContext application)
                                          throws ServletException,
                                                 java.io.IOException
Returns true if the user is authorized for the resource.

isAuthorized must provide the response if the user is not authorized. Typically this will just call sendError.

isAuthorized will be called after all the other filters, but before the servlet.service().

Parameters:
request - the servlet request
response - the servlet response
Returns:
true if the request is authorized.
Throws:
ServletException
java.io.IOException

toArray

protected AbstractConstraint[] toArray()
converts the sub constraints to an array.