Top Description Fields Constructors Methods
org.mortbay.jetty.security

public Class Constraint

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Imports
java.io.Serializable

Describe an auth and/or data constraint.
Author
Greg Wilkins (gregw)

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
public static final String
public static final String
public static final String
private boolean
private boolean
private int
private String
private String[]
public static final String
public static final int
public static final int
public static final int
public static final int
public static final String

Constructor Summary

AccessConstructor and Description
public
Constraint()

Constructor.

public
Constraint(String name, String role)

Conveniance Constructor.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public boolean

Returns:

True if the constraint requires request authentication
getAuthenticate
()

public int

Returns:

Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
getDataConstraint
()

public String[]

Returns:

List of roles for this constraint.
getRoles
()

public boolean

Returns:

True if a data constraint has been set.
hasDataConstraint
()

public boolean

Returns:

True if the constraint contains the role.
hasRole
(String role)

public boolean

Returns:

True if any user role is permitted.
isAnyRole
()

public boolean

Returns:

True if authentication required but no roles set
isForbidden
()

public void
setAuthenticate(boolean
True if users must be authenticated
authenticate
)

public void
setDataConstraint(int
Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL
c
)

public void
public void
setRoles(String[] roles)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

__BASIC_AUTHback to summary
public static final String __BASIC_AUTH
__CERT_AUTHback to summary
public static final String __CERT_AUTH
__CERT_AUTH2back to summary
public static final String __CERT_AUTH2
__DIGEST_AUTHback to summary
public static final String __DIGEST_AUTH
__FORM_AUTHback to summary
public static final String __FORM_AUTH
_anyRoleback to summary
private boolean _anyRole
_authenticateback to summary
private boolean _authenticate
_dataConstraintback to summary
private int _dataConstraint
_nameback to summary
private String _name
_rolesback to summary
private String[] _roles
ANY_ROLEback to summary
public static final String ANY_ROLE
DC_CONFIDENTIALback to summary
public static final int DC_CONFIDENTIAL
DC_INTEGRALback to summary
public static final int DC_INTEGRAL
DC_NONEback to summary
public static final int DC_NONE
DC_UNSETback to summary
public static final int DC_UNSET
NONEback to summary
public static final String NONE

Constructor Detail

Constraintback to summary
public Constraint()

Constructor.

Constraintback to summary
public Constraint(String name, String role)

Conveniance Constructor.

Method Detail

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
getAuthenticateback to summary
public boolean getAuthenticate()
Returns:boolean

True if the constraint requires request authentication

getDataConstraintback to summary
public int getDataConstraint()
Returns:int

Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL

getRolesback to summary
public String[] getRoles()
Returns:String[]

List of roles for this constraint.

hasDataConstraintback to summary
public boolean hasDataConstraint()
Returns:boolean

True if a data constraint has been set.

hasRoleback to summary
public boolean hasRole(String role)
Returns:boolean

True if the constraint contains the role.

isAnyRoleback to summary
public boolean isAnyRole()
Returns:boolean

True if any user role is permitted.

isForbiddenback to summary
public boolean isForbidden()
Returns:boolean

True if authentication required but no roles set

setAuthenticateback to summary
public void setAuthenticate(boolean authenticate)
Parameters
authenticate:boolean

True if users must be authenticated

setDataConstraintback to summary
public void setDataConstraint(int c)
Parameters
c:int

Data constrain indicator: 0=DC+NONE, 1=DC_INTEGRAL & 2=DC_CONFIDENTIAL

setNameback to summary
public void setName(String name)
setRolesback to summary
public void setRoles(String[] roles)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.