public class SecurityConstraint
extends java.lang.Object
A security constraint which allows you to place restrictions on a number of paths.
Given a single or multiple paths, you can set the roles that allow access.
By default we set a single path to "/". The list of paths can easily be overridden.
In the adapter configuration file this class is aliased as jetty-security-constraint which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
SecurityConstraint() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
constraintName() |
java.lang.String |
getConstraintName() |
java.lang.Boolean |
getMustAuthenticate() |
java.util.List<java.lang.String> |
getPaths() |
java.lang.String |
getRoles() |
boolean |
isMustAuthenticate() |
void |
setConstraintName(java.lang.String constraintName)
Set the name of the constraint
|
void |
setMustAuthenticate(java.lang.Boolean b)
Whether or not we must authenticate.
|
void |
setPaths(java.util.List<java.lang.String> paths) |
void |
setRoles(java.lang.String roles)
A comma separated list of roles that the user must have to satisfy the constraint.
|
public java.lang.String getRoles()
public void setRoles(java.lang.String roles)
roles
- a comma separated list of rolespublic java.lang.Boolean getMustAuthenticate()
public boolean isMustAuthenticate()
public void setMustAuthenticate(java.lang.Boolean b)
b
- true or false, the default is true if not explicitly specified.public java.lang.String getConstraintName()
public void setConstraintName(java.lang.String constraintName)
constraintName
- the name of the constraint; if not specified then defaults to 'BASIC' Constraint.__BASIC_AUTH
.Constraint
public java.lang.String constraintName()
public java.util.List<java.lang.String> getPaths()
public void setPaths(java.util.List<java.lang.String> paths)