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
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringprivate booleanprivate booleanprivate booleanprivate intprivate Stringprivate String[]static final Stringstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanintgetName()String[]getRoles()booleanbooleanbooleanServlet Spec 3.1, pg 140booleanbooleanvoidsetAuthenticate(boolean authenticate) voidsetDataConstraint(int c) voidvoidtoString()static booleanvalidateMethod(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:
-
_name
-
_roles
-
_dataConstraint
private int _dataConstraint -
_anyRole
private boolean _anyRole -
_anyAuth
private boolean _anyAuth -
_authenticate
private boolean _authenticate
-
-
Constructor Details
-
Constraint
public Constraint()Constructor. -
Constraint
-
-
Method Details
-
validateMethod
-
clone
- Overrides:
clonein 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
-