Overview | Package | Class | Tree | Deprecated | Index | Help
| J2EE1.4 SDK
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.appserv.web.cache.mapping
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.

Field Summary

Fields inherited from class com.sun.appserv.web.cache.mapping.Field
`name, scope`

Constructor Summary
`ConstraintField(java.lang.String name, java.lang.String scope)` create a new cache field, given a string representation of the scope

Method Summary
`void` | `addConstraint(ValueConstraint constraint)` add a constraint for this field
`boolean` | `applyConstraints(ServletContext context, 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 pass
`void` | `setCacheOnMatchFailure(boolean cacheOnMatchFailure)` set whether to cache should there be a failure forcing the constraint
`void` | `setValueConstraints(ValueConstraint[] vcs)` add an array of constraints for this field

Methods inherited from class com.sun.appserv.web.cache.mapping.Field
`getName, getScope, getValue, setName, setScope`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConstraintField

    public ConstraintField(java.lang.String name,
                           java.lang.String scope)
                    throws java.lang.IllegalArgumentException

  create a new cache field, given a string representation of the scope

Parameters:
  `name` - name of this field
  `scope` - scope of this field

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

### applyConstraints

    public boolean applyConstraints(ServletContext context,
                                    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.

Overview | Package | Class | Tree | Deprecated | Index | Help
| J2EE1.4 SDK
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Submit a bug or feature

Copyright 2003 Sun Microsystems, Inc. All rights reserved.