org.eclipse.jetty.annotations
Class ServletSecurityAnnotationHandler
java.lang.Object
org.eclipse.jetty.annotations.AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
org.eclipse.jetty.annotations.ServletSecurityAnnotationHandler
- All Implemented Interfaces:
- AnnotationIntrospector.IntrospectableAnnotationHandler
public class ServletSecurityAnnotationHandler
- extends AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
ServletSecurityAnnotationHandler
Inspect a class to see if it has an @ServletSecurity annotation on it,
setting up the s.
A servlet can be defined in:
- web.xml
- web-fragment.xml
- @WebServlet annotation discovered
- ServletContext.createServlet
The ServletSecurity annotation for a servlet should only be processed
iff metadata-complete == false.
Method Summary |
protected boolean |
constraintsExist(List<ServletMapping> servletMappings,
List<ConstraintMapping> constraintMappings)
Check if there are already elements defined that match the url-patterns for
the servlet. |
void |
doHandle(Class clazz)
|
protected List<ServletMapping> |
getServletMappings(String className)
Get the ServletMappings for the servlet's class. |
protected Constraint |
makeConstraint(Class servlet,
String[] rolesAllowed,
ServletSecurity.EmptyRoleSemantic permitOrDeny,
ServletSecurity.TransportGuarantee transport)
Make a jetty Constraint object, which represents the and
elements, based on the security annotation. |
protected ConstraintMapping |
makeConstraintMapping(Constraint constraint,
String url,
String method,
String[] omissions)
Make a ConstraintMapping which captures the or elements for a particular url pattern,
and relates it to a Constraint object ( and ). |
protected List<ConstraintMapping> |
makeMethodMappings(Class servlet,
Constraint defaultConstraint,
List<ServletMapping> servletMappings,
HttpMethodConstraint[] annotations)
Make the Jetty Constraints and ConstraintMapping objects that correspond to the HttpMethodConstraint
annotations for each url pattern for the servlet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServletSecurityAnnotationHandler
public ServletSecurityAnnotationHandler(WebAppContext wac)
doHandle
public void doHandle(Class clazz)
- Specified by:
doHandle
in class AnnotationIntrospector.AbstractIntrospectableAnnotationHandler
- See Also:
AnnotationIntrospector.IntrospectableAnnotationHandler.handle(java.lang.Class)
makeConstraint
protected Constraint makeConstraint(Class servlet,
String[] rolesAllowed,
ServletSecurity.EmptyRoleSemantic permitOrDeny,
ServletSecurity.TransportGuarantee transport)
- Make a jetty Constraint object, which represents the and
elements, based on the security annotation.
- Parameters:
servlet
- rolesAllowed
- permitOrDeny
- transport
-
- Returns:
makeConstraintMapping
protected ConstraintMapping makeConstraintMapping(Constraint constraint,
String url,
String method,
String[] omissions)
- Make a ConstraintMapping which captures the or elements for a particular url pattern,
and relates it to a Constraint object ( and ).
- Parameters:
constraint
- url
- method
- omissions
-
- Returns:
makeMethodMappings
protected List<ConstraintMapping> makeMethodMappings(Class servlet,
Constraint defaultConstraint,
List<ServletMapping> servletMappings,
HttpMethodConstraint[] annotations)
- Make the Jetty Constraints and ConstraintMapping objects that correspond to the HttpMethodConstraint
annotations for each url pattern for the servlet.
- Parameters:
servlet
- defaultConstraint
- servletMappings
- annotations
-
- Returns:
getServletMappings
protected List<ServletMapping> getServletMappings(String className)
- Get the ServletMappings for the servlet's class.
- Parameters:
className
-
- Returns:
constraintsExist
protected boolean constraintsExist(List<ServletMapping> servletMappings,
List<ConstraintMapping> constraintMappings)
- Check if there are already elements defined that match the url-patterns for
the servlet.
- Parameters:
servletMappings
-
- Returns:
Copyright © 1995-2010 Mort Bay Consulting. All Rights Reserved.