Package org.eclipse.jetty.util.security
Class Constraint
- java.lang.Object
-
- org.eclipse.jetty.util.security.Constraint
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class Constraint extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable
Constraint Describe an auth and/or data constraint.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
__BASIC_AUTH
static java.lang.String
__CERT_AUTH
static java.lang.String
__CERT_AUTH2
static java.lang.String
__DIGEST_AUTH
static java.lang.String
__FORM_AUTH
static java.lang.String
__NEGOTIATE_AUTH
static java.lang.String
__OPENID_AUTH
static java.lang.String
__SPNEGO_AUTH
static java.lang.String
ANY_AUTH
static java.lang.String
ANY_ROLE
static int
DC_CONFIDENTIAL
static int
DC_FORBIDDEN
static int
DC_INTEGRAL
static int
DC_NONE
static int
DC_UNSET
static java.lang.String
NONE
-
Constructor Summary
Constructors Constructor Description Constraint()
Constructor.Constraint(java.lang.String name, java.lang.String role)
Convenience Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
boolean
getAuthenticate()
int
getDataConstraint()
java.lang.String
getName()
java.lang.String[]
getRoles()
boolean
hasDataConstraint()
boolean
hasRole(java.lang.String role)
boolean
isAnyAuth()
Servlet Spec 3.1, pg 140boolean
isAnyRole()
boolean
isForbidden()
void
setAuthenticate(boolean authenticate)
void
setDataConstraint(int c)
void
setName(java.lang.String name)
void
setRoles(java.lang.String[] roles)
java.lang.String
toString()
static boolean
validateMethod(java.lang.String method)
-
-
-
Field Detail
-
__BASIC_AUTH
public static final java.lang.String __BASIC_AUTH
- See Also:
- Constant Field Values
-
__FORM_AUTH
public static final java.lang.String __FORM_AUTH
- See Also:
- Constant Field Values
-
__DIGEST_AUTH
public static final java.lang.String __DIGEST_AUTH
- See Also:
- Constant Field Values
-
__CERT_AUTH
public static final java.lang.String __CERT_AUTH
- See Also:
- Constant Field Values
-
__CERT_AUTH2
public static final java.lang.String __CERT_AUTH2
- See Also:
- Constant Field Values
-
__SPNEGO_AUTH
public static final java.lang.String __SPNEGO_AUTH
- See Also:
- Constant Field Values
-
__NEGOTIATE_AUTH
public static final java.lang.String __NEGOTIATE_AUTH
- See Also:
- Constant Field Values
-
__OPENID_AUTH
public static final java.lang.String __OPENID_AUTH
- See Also:
- Constant Field Values
-
DC_UNSET
public static final int DC_UNSET
- See Also:
- Constant Field Values
-
DC_NONE
public static final int DC_NONE
- See Also:
- Constant Field Values
-
DC_INTEGRAL
public static final int DC_INTEGRAL
- See Also:
- Constant Field Values
-
DC_CONFIDENTIAL
public static final int DC_CONFIDENTIAL
- See Also:
- Constant Field Values
-
DC_FORBIDDEN
public static final int DC_FORBIDDEN
- See Also:
- Constant Field Values
-
NONE
public static final java.lang.String NONE
- See Also:
- Constant Field Values
-
ANY_ROLE
public static final java.lang.String ANY_ROLE
- See Also:
- Constant Field Values
-
ANY_AUTH
public static final java.lang.String ANY_AUTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateMethod
public static boolean validateMethod(java.lang.String method)
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
setName
public void setName(java.lang.String name)
- Parameters:
name
- the name
-
getName
public java.lang.String getName()
-
setRoles
public void setRoles(java.lang.String[] roles)
-
isAnyRole
public boolean isAnyRole()
- Returns:
- True if any user role is permitted.
-
isAnyAuth
public boolean isAnyAuth()
Servlet Spec 3.1, pg 140- Returns:
- True if any authenticated user is permitted (ie a role "**" was specified in the constraint).
-
getRoles
public java.lang.String[] getRoles()
- Returns:
- List of roles for this constraint.
-
hasRole
public boolean hasRole(java.lang.String role)
- Parameters:
role
- the role- Returns:
- True if the constraint contains the role.
-
setAuthenticate
public void setAuthenticate(boolean authenticate)
- Parameters:
authenticate
- True if users must be authenticated
-
getAuthenticate
public boolean getAuthenticate()
- Returns:
- True if the constraint requires request authentication
-
isForbidden
public boolean isForbidden()
- Returns:
- True if authentication required but no roles set
-
setDataConstraint
public void setDataConstraint(int c)
- Parameters:
c
- Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
-
getDataConstraint
public int getDataConstraint()
- Returns:
- Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
-
hasDataConstraint
public boolean hasDataConstraint()
- Returns:
- True if a data constraint has been set.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-