com.caucho.server.security
Class ContainerConstraint

java.lang.Object
  extended by com.caucho.server.security.AbstractConstraint
      extended by com.caucho.server.security.ContainerConstraint

public class ContainerConstraint
extends AbstractConstraint


Constructor Summary
ContainerConstraint()
           
 
Method Summary
 void addConstraint(AbstractConstraint constraint)
          Adds a constraint.
 void init()
           
 AuthorizationResult isAuthorized(HttpServletRequest request, HttpServletResponse response, ServletContext application)
          Returns true if the user is authorized for the resource.
 boolean needsAuthentication()
          Returns true if the constraint requires authentication.
protected  AbstractConstraint[] toArray()
          converts the sub constraints to an array.
 
Methods inherited from class com.caucho.server.security.AbstractConstraint
isPrivateCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerConstraint

public ContainerConstraint()
Method Detail

init

public void init()

addConstraint

public void addConstraint(AbstractConstraint constraint)
Adds a constraint.


needsAuthentication

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

Overrides:
needsAuthentication in class AbstractConstraint

isAuthorized

public 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().

Specified by:
isAuthorized in class AbstractConstraint
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.

Overrides:
toArray in class AbstractConstraint