Class ConstraintField
- java.lang.Object
-
- com.sun.appserv.web.cache.mapping.Field
-
- com.sun.appserv.web.cache.mapping.ConstraintField
-
public class ConstraintField extends Field
ConstraintField class represents a single Field and constraints on its values; Field name and its scope are inherited from the Field class.
-
-
Constructor Summary
Constructors Constructor Description ConstraintField(String name, String scope)
create a new cache field, given a string representation of the scope
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraint(ValueConstraint constraint)
add a constraint for this fieldboolean
applyConstraints(jakarta.servlet.ServletContext context, jakarta.servlet.http.HttpServletRequest request)
apply the constraints on the value of the field in the given request.boolean
getCacheOnMatch()
boolean
getCacheOnMatchFailure()
void
setCacheOnMatch(boolean cacheOnMatch)
set whether to cache should the constraints check passvoid
setCacheOnMatchFailure(boolean cacheOnMatchFailure)
set whether to cache should there be a failure forcing the constraintvoid
setValueConstraints(ValueConstraint[] vcs)
add an array of constraints for this field
-
-
-
Constructor Detail
-
ConstraintField
public ConstraintField(String name, String scope) throws IllegalArgumentException
create a new cache field, given a string representation of the scope- Parameters:
name
- name of this fieldscope
- scope of this field- Throws:
IllegalArgumentException
-
-
Method Detail
-
setCacheOnMatch
public void setCacheOnMatch(boolean cacheOnMatch)
set whether to cache should the constraints check pass- Parameters:
cacheOnMatch
- should the constraint check pass, should we cache?
-
getCacheOnMatch
public boolean getCacheOnMatch()
- Returns:
- cache-on-match setting
-
setCacheOnMatchFailure
public void setCacheOnMatchFailure(boolean cacheOnMatchFailure)
set whether to cache should there be a failure forcing the constraint- Parameters:
cacheOnMatchFailure
- should there be a constraint check failure, enable cache?
-
getCacheOnMatchFailure
public boolean getCacheOnMatchFailure()
- Returns:
- cache-on-match-failure setting
-
addConstraint
public void addConstraint(ValueConstraint constraint)
add a constraint for this field- Parameters:
constraint
- one constraint associated with this field
-
setValueConstraints
public void setValueConstraints(ValueConstraint[] vcs)
add an array of constraints for this field- Parameters:
vcs
- constraints associated with this field
-
applyConstraints
public boolean applyConstraints(jakarta.servlet.ServletContext context, jakarta.servlet.http.HttpServletRequest request)
apply the constraints on the value of the field in the given request. return a true if all the constraints pass; false when the field is not found or the field value doesn't pass the caching constraints.
-
-