Package org.eclipse.jetty.util.security
Class Constraint
java.lang.Object
org.eclipse.jetty.util.security.Constraint
- All Implemented Interfaces:
Serializable
,Cloneable
Constraint
Describe an auth and/or data constraint.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final int
static final int
static final int
static final int
static final int
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
int
getName()
String[]
getRoles()
boolean
boolean
boolean
Servlet Spec 3.1, pg 140boolean
boolean
void
setAuthenticate
(boolean authenticate) void
setDataConstraint
(int c) void
void
toString()
static boolean
validateMethod
(String method)
-
Field Details
-
__BASIC_AUTH
- See Also:
-
__FORM_AUTH
- See Also:
-
__DIGEST_AUTH
- See Also:
-
__CERT_AUTH
- See Also:
-
__CERT_AUTH2
- See Also:
-
__SPNEGO_AUTH
- See Also:
-
__NEGOTIATE_AUTH
- See Also:
-
__OPENID_AUTH
- See Also:
-
DC_UNSET
public static final int DC_UNSET- See Also:
-
DC_NONE
public static final int DC_NONE- See Also:
-
DC_INTEGRAL
public static final int DC_INTEGRAL- See Also:
-
DC_CONFIDENTIAL
public static final int DC_CONFIDENTIAL- See Also:
-
DC_FORBIDDEN
public static final int DC_FORBIDDEN- See Also:
-
NONE
- See Also:
-
ANY_ROLE
- See Also:
-
ANY_AUTH
- See Also:
-
-
Constructor Details
-
Constraint
public Constraint()Constructor. -
Constraint
Convenience Constructor.- Parameters:
name
- the namerole
- the role
-
-
Method Details
-
validateMethod
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
setName
- Parameters:
name
- the name
-
getName
-
setRoles
-
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
- Returns:
- List of roles for this constraint.
-
hasRole
- 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
-