Package org.eclipse.jetty.ee9.nested
Class ServletConstraint
java.lang.Object
org.eclipse.jetty.ee9.nested.ServletConstraint
- All Implemented Interfaces:
Serializable
,Cloneable
Constraint
Describe an auth and/or data constraint.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.ServletConstraint
(String name, String role) Convenience Constructor. -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
int
getName()
String[]
getRoles()
boolean
Servlet Spec 3.1, pg 140boolean
boolean
void
setAuthenticate
(boolean authenticate) void
setDataConstraint
(int c) void
Set the name.void
toString()
-
Field Details
-
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:
-
NONE
- See Also:
-
ANY_ROLE
- See Also:
-
ANY_AUTH
- See Also:
-
-
Constructor Details
-
ServletConstraint
public ServletConstraint()Constructor. -
ServletConstraint
Convenience Constructor.- Parameters:
name
- the namerole
- the role
-
-
Method Details
-
clone
- Overrides:
clone
in classObject
- Throws:
CloneNotSupportedException
-
setName
Set the name.- 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:
- String array of roles for this constraint.
-
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
-
toString
-