org.mortbay.http
public class SecurityConstraint extends Object implements Cloneable, Serializable
Version: $Revision: 1.44 $
| Nested Class Summary | |
|---|---|
| static class | SecurityConstraint.Nobody Nobody user.
|
| Field Summary | |
|---|---|
| static String | ANY_ROLE |
| static int | DC_CONFIDENTIAL |
| static int | DC_INTEGRAL |
| static int | DC_NONE |
| static int | DC_UNSET |
| static String | NONE |
| static String | __BASIC_AUTH |
| static String | __CERT_AUTH |
| static String | __CERT_AUTH2 |
| static String | __DIGEST_AUTH |
| static String | __FORM_AUTH |
| static SecurityConstraint.Nobody | __NOBODY |
| Constructor Summary | |
|---|---|
| SecurityConstraint() Constructor. | |
| SecurityConstraint(String name, String role) Conveniance Constructor. | |
| Method Summary | |
|---|---|
| void | addMethod(String method) |
| void | addRole(String role) |
| static boolean | check(List constraints, Authenticator authenticator, UserRealm realm, String pathInContext, HttpRequest request, HttpResponse response) Check security contraints |
| Object | clone() |
| boolean | forMethod(String method) |
| boolean | getAuthenticate() |
| int | getDataConstraint() |
| List | getMethods() |
| List | getRoles() |
| boolean | hasDataConstraint() |
| boolean | hasRole(String role) |
| boolean | isAnyRole() |
| boolean | isForbidden() |
| void | setAuthenticate(boolean authenticate) |
| void | setDataConstraint(int c) |
| void | setName(String name) |
| String | toString() |
Parameters: name role
Parameters: method
Parameters: role The rolename. If the rolename is '*' all other roles are removed and anyRole is set true and subsequent addRole calls are ignored. Authenticate is forced true by this call.
Parameters: constraints authenticator realm pathInContext request response
Returns: false if the request has failed a security constraint or the authenticator has already sent a response.
Throws: HttpException IOException
Parameters: method Method name.
Returns: True if this constraint applies to the method. If no method has been set, then the constraint applies to all methods.
Returns: True if the constraint requires request authentication
Returns: Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
Returns: List of roles for this constraint.
Returns: True if a data constraint has been set.
Parameters: role
Returns: True if the constraint contains the role.
Returns: True if any user role is permitted.
Returns: True if authentication required but no roles set
Parameters: authenticate True if users must be authenticated
Parameters: c
Parameters: name