<security-constraint> element in the
deployment descriptor.Warning
It is assumed that instances of this class will be created and modified only within the context of a single thread, before the instance is made visible to the remainder of the application. After that, only read access is expected. Therefore, none of the read and write access within this class is synchronized.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | allRoles
Was the "all roles" wildcard - |
| private boolean | authConstraint
Was an authorization constraint included in this security constraint? |
| private boolean | authenticatedUsers
Was the "all authenticated users" wildcard -
|
| private String[] | authRoles
The set of roles permitted to access resources protected by this security constraint. |
| private SecurityCollection[] | collections
The set of web resource collections protected by this security constraint. |
| private String | displayName
The display name of this security constraint. |
| public static final String | |
| public static final String | |
| private static final long | |
| private static final StringManager | |
| private String | userConstraint
The user data constraint for this security constraint. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addAuthRole(String
Role name to be added authRole)Add an authorization role, which is a role name that will be permitted access to the resources protected by this security constraint. |
| public void | addCollection(SecurityCollection
The new web resource collection collection)Add a new web resource collection to those protected by this security constraint. |
| private static SecurityConstraint | |
| public static SecurityConstraint[] | Returns: The (possibly zero length) array of constraints that are the equivalent to the inputThe element to be converted element, String The url pattern that the element should be applied
to urlPattern)Convert a |
| public boolean | Returns: true if the specified role is permitted access to
the resources protected by this security constraint.Role name to be checked role)Check a role. |
| public String[] | Returns: the roles arrayReturn the set of roles that are permitted access to the resources protected by this security constraint. |
| public SecurityCollection | Returns: the collectionWeb resource collection name to return name)Return the web resource collection for the specified name, if any;
otherwise, return |
| public SecurityCollection[] | Returns: the collections arrayReturn all of the web resource collections protected by this security constraint. |
| public static SecurityConstraint[] | findUncoveredHttpMethods(SecurityConstraint[] constraints, boolean denyUncoveredHttpMethods, Log log)
|
| public boolean | Returns: true if all rolesWas the "all roles" wildcard included in this authentication constraint? |
| public boolean | Returns: true if this needs authorizationReturn the authorization constraint present flag for this security constraint. |
| public boolean | Returns: true if all authenticated usersWas the "all authenticated users" wildcard included in this authentication constraint? |
| public String | |
| public String | Returns: the user constraintReturn the user data constraint for this security constraint. |
| private static void | handleOmittedMethods(Set<String> omittedMethods, String pattern, boolean denyUncoveredHttpMethods, List<SecurityConstraint> newConstraints, Log log)
|
| public boolean | |
| private boolean | matchPattern(String
Context-relative request path to be checked
(must start with '/') path, String URL pattern to be compared against pattern)Does the specified request path match the specified URL pattern? |
| public void | removeAuthRole(String
Role name to be removed authRole)Remove the specified role from the set of roles permitted to access the resources protected by this security constraint. |
| public void | removeCollection(SecurityCollection
Web resource collection to be removed collection)Remove the specified web resource collection from those protected by this security constraint. |
| public void | setAuthConstraint(boolean
The new value authConstraint)Set the authorization constraint present flag for this security constraint. |
| public void | setCharset(Charset charset)
Overrides org.
|
| public void | |
| public void | setUserConstraint(String
The new user data constraint userConstraint)Set the user data constraint for this security constraint. |
| public String | toString()
Overrides java. Return a String representation of this security constraint. |
| public void | treatAllAuthenticatedUsersAsApplicationRole()
Called in the unlikely event that an application defines a role named "**". |
| allRoles | back to summary |
|---|---|
| private boolean allRoles Was the "all roles" wildcard - | |
| authConstraint | back to summary |
|---|---|
| private boolean authConstraint Was an authorization constraint included in this security constraint? This is necessary to distinguish the case where an auth-constraint with no roles (signifying no direct access at all) was requested, versus a lack of auth-constraint which implies no access control checking. | |
| authenticatedUsers | back to summary |
|---|---|
| private boolean authenticatedUsers Was the "all authenticated users" wildcard -
| |
| authRoles | back to summary |
|---|---|
| private String[] authRoles The set of roles permitted to access resources protected by this security constraint. | |
| collections | back to summary |
|---|---|
| private SecurityCollection[] collections The set of web resource collections protected by this security constraint. | |
| displayName | back to summary |
|---|---|
| private String displayName The display name of this security constraint. | |
| ROLE_ALL_AUTHENTICATED_USERS | back to summary |
|---|---|
| public static final String ROLE_ALL_AUTHENTICATED_USERS | |
| ROLE_ALL_ROLES | back to summary |
|---|---|
| public static final String ROLE_ALL_ROLES | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| sm | back to summary |
|---|---|
| private static final StringManager sm | |
| userConstraint | back to summary |
|---|---|
| private String userConstraint The user data constraint for this security constraint. Must be NONE, INTEGRAL, or CONFIDENTIAL. | |
| SecurityConstraint | back to summary |
|---|---|
| public SecurityConstraint() Construct a new security constraint instance with default values. | |
| addAuthRole | back to summary |
|---|---|
| public void addAuthRole(String authRole) Add an authorization role, which is a role name that will be permitted access to the resources protected by this security constraint.
| |
| addCollection | back to summary |
|---|---|
| public void addCollection(SecurityCollection collection) Add a new web resource collection to those protected by this security constraint.
| |
| createConstraint | back to summary |
|---|---|
| private static SecurityConstraint createConstraint(HttpConstraintElement element, String urlPattern, boolean alwaysCreate) | |
| createConstraints | back to summary |
|---|---|
| public static SecurityConstraint[] createConstraints(ServletSecurityElement element, String urlPattern) Convert a
| |
| findAuthRole | back to summary |
|---|---|
| public boolean findAuthRole(String role) Check a role.
| |
| findAuthRoles | back to summary |
|---|---|
| public String[] findAuthRoles() Return the set of roles that are permitted access to the resources protected by this security constraint. If none have been defined, a zero-length array is returned (which implies that all authenticated users are permitted access).
| |
| findCollection | back to summary |
|---|---|
| public SecurityCollection findCollection(String name) Return the web resource collection for the specified name, if any;
otherwise, return
| |
| findCollections | back to summary |
|---|---|
| public SecurityCollection[] findCollections() Return all of the web resource collections protected by this security constraint. If there are none, a zero-length array is returned.
| |
| findUncoveredHttpMethods | back to summary |
|---|---|
| public static SecurityConstraint[] findUncoveredHttpMethods(SecurityConstraint[] constraints, boolean denyUncoveredHttpMethods, Log log) | |
| getAllRoles | back to summary |
|---|---|
| public boolean getAllRoles() Was the "all roles" wildcard included in this authentication constraint?
| |
| getAuthConstraint | back to summary |
|---|---|
| public boolean getAuthConstraint() Return the authorization constraint present flag for this security constraint.
| |
| getAuthenticatedUsers | back to summary |
|---|---|
| public boolean getAuthenticatedUsers() Was the "all authenticated users" wildcard included in this authentication constraint?
| |
| getDisplayName | back to summary |
|---|---|
public String getDisplayName()
| |
| getUserConstraint | back to summary |
|---|---|
| public String getUserConstraint() Return the user data constraint for this security constraint.
| |
| handleOmittedMethods | back to summary |
|---|---|
| private static void handleOmittedMethods(Set<String> omittedMethods, String pattern, boolean denyUncoveredHttpMethods, List<SecurityConstraint> newConstraints, Log log) | |
| included | back to summary |
|---|---|
| public boolean included(String uri, String method) Check if the constraint applies to a URI and method. | |
| matchPattern | back to summary |
|---|---|
| private boolean matchPattern(String path, String pattern) Does the specified request path match the specified URL pattern? This method follows the same rules (in the same order) as those used for mapping requests to servlets. | |
| removeAuthRole | back to summary |
|---|---|
| public void removeAuthRole(String authRole) Remove the specified role from the set of roles permitted to access the resources protected by this security constraint.
| |
| removeCollection | back to summary |
|---|---|
| public void removeCollection(SecurityCollection collection) Remove the specified web resource collection from those protected by this security constraint.
| |
| setAuthConstraint | back to summary |
|---|---|
| public void setAuthConstraint(boolean authConstraint) Set the authorization constraint present flag for this security constraint.
| |
| setCharset | back to summary |
|---|---|
| public void setCharset(Charset charset) Overrides org.
| |
| setDisplayName | back to summary |
|---|---|
| public void setDisplayName(String displayName) Set the display name of this security constraint.
| |
| setUserConstraint | back to summary |
|---|---|
| public void setUserConstraint(String userConstraint) Set the user data constraint for this security constraint.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Return a String representation of this security constraint.
| |
| treatAllAuthenticatedUsersAsApplicationRole | back to summary |
|---|---|
| public void treatAllAuthenticatedUsersAsApplicationRole() Called in the unlikely event that an application defines a role named "**". | |