public class SecurityConstraint extends Object implements Cloneable, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SecurityConstraint.Nobody
Nobody user.
|
Modifier and Type | Field and Description |
---|---|
static String |
__BASIC_AUTH |
static String |
__CERT_AUTH |
static String |
__CERT_AUTH2 |
static String |
__DIGEST_AUTH |
static String |
__FORM_AUTH |
static SecurityConstraint.Nobody |
__NOBODY |
static String |
ANY_ROLE |
static int |
DC_CONFIDENTIAL |
static int |
DC_INTEGRAL |
static int |
DC_NONE |
static int |
DC_UNSET |
static String |
NONE |
Constructor and Description |
---|
SecurityConstraint()
Constructor.
|
SecurityConstraint(String name,
String role)
Conveniance Constructor.
|
Modifier and Type | Method and Description |
---|---|
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() |
public static final String __BASIC_AUTH
public static final String __FORM_AUTH
public static final String __DIGEST_AUTH
public static final String __CERT_AUTH
public static final String __CERT_AUTH2
public static final int DC_UNSET
public static final int DC_NONE
public static final int DC_INTEGRAL
public static final int DC_CONFIDENTIAL
public static final String NONE
public static final String ANY_ROLE
public static final SecurityConstraint.Nobody __NOBODY
public void setName(String name)
name
- public void addMethod(String method)
method
- public List getMethods()
public boolean forMethod(String method)
method
- Method name.public void addRole(String role)
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.public boolean isAnyRole()
public List getRoles()
public boolean hasRole(String role)
role
- public void setAuthenticate(boolean authenticate)
authenticate
- True if users must be authenticatedpublic boolean getAuthenticate()
public boolean isForbidden()
public void setDataConstraint(int c)
c
- public int getDataConstraint()
public boolean hasDataConstraint()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public static boolean check(List constraints, Authenticator authenticator, UserRealm realm, String pathInContext, HttpRequest request, HttpResponse response) throws HttpException, IOException
constraints
- authenticator
- realm
- pathInContext
- request
- response
- HttpException
IOException
Copyright © 2013. All rights reserved.