]> WPIA git - gigi.git/blob - lib/servlet-api/javax/servlet/annotation/ServletSecurity.java
adding servlet api (from tomcat)
[gigi.git] / lib / servlet-api / javax / servlet / annotation / ServletSecurity.java
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements.  See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License.  You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 package javax.servlet.annotation;
18
19 import java.lang.annotation.Documented;
20 import java.lang.annotation.ElementType;
21 import java.lang.annotation.Inherited;
22 import java.lang.annotation.Retention;
23 import java.lang.annotation.RetentionPolicy;
24 import java.lang.annotation.Target;
25
26 /**
27  * Declare this annotation on a {@link javax.servlet.Servlet} implementation
28  * class to enforce security constraints on HTTP protocol requests.<br />
29  * The container applies constraints to the URL patterns mapped to each Servlet
30  * which declares this annotation.<br />
31  * <br />
32  *
33  * @since Servlet 3.0
34  */
35 @Inherited
36 @Target({ElementType.TYPE})
37 @Retention(RetentionPolicy.RUNTIME)
38 @Documented
39 public @interface ServletSecurity {
40
41     /**
42      * Represents the two possible values of the empty role semantic, active
43      * when a list of role names is empty.
44      */
45     enum EmptyRoleSemantic {
46
47         /**
48          * Access MUST be permitted, regardless of authentication state or
49          * identity
50          */
51         PERMIT,
52
53         /**
54          * Access MUST be denied, regardless of authentication state or identity
55          */
56         DENY
57     }
58
59     /**
60      * Represents the two possible values of data transport, encrypted or not.
61      */
62     enum TransportGuarantee {
63
64         /**
65          * User data must not be encrypted by the container during transport
66          */
67         NONE,
68
69         /**
70          * The container MUST encrypt user data during transport
71          */
72         CONFIDENTIAL
73     }
74
75     /**
76      * The default constraint to apply to requests not handled by specific
77      * method constraints
78      *
79      * @return http constraint
80      */
81     HttpConstraint value() default @HttpConstraint;
82
83     /**
84      * An array of HttpMethodContraint objects to which the security constraint
85      * will be applied
86      *
87      * @return array of http method constraint
88      */
89     HttpMethodConstraint[] httpMethodConstraints() default {};
90 }