Class CacheMapping
- java.lang.Object
-
- com.sun.appserv.web.cache.mapping.CacheMapping
-
public class CacheMapping extends Object
CacheMapping represents a cache target specified via servlet-name or a url-pattern, a timeout, allowed methods, a set of key fields to be used to construct the key into the cache, and a set of constraints on the field values.
-
-
Constructor Summary
Constructors Constructor Description CacheMapping()
default cache mapping
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraintField(ConstraintField field)
add a constraint key fieldvoid
addKeyField(Field field)
add a key fieldvoid
addMethod(String method)
add an allowable HTTP methodboolean
findMethod(String method)
Returntrue
if the specified HTTP request method is allowed for cachingConstraintField[]
getConstraintFields()
get the constraint fieldsString
getHelperNameRef()
get helper-name-ref associated with this mappingField[]
getKeyFields()
get the key fieldsField
getRefreshField()
get the refresh fieldString
getServletName()
get the underlying servlet-nameint
getTimeout()
get the timeoutField
getTimeoutField()
get the timeout fieldString
getURLPattern()
get the underlying url-pattern this mapping applicablevoid
setHelperNameRef(String helperNameRef)
set the helper name ref associated with this cache mappingvoid
setMethods(String[] methods)
set allowable HTTP methodsvoid
setRefreshField(Field field)
set the refresh fieldvoid
setServletName(String servletName)
set the servlet-name this mapping appliesvoid
setTimeout(int timeout)
set the timeoutvoid
setTimeoutField(Field field)
set the timeout fieldvoid
setURLPattern(String urlPattern)
set the url-pattern this mapping applies
-
-
-
Method Detail
-
setHelperNameRef
public void setHelperNameRef(String helperNameRef)
set the helper name ref associated with this cache mapping- Parameters:
helperNameRef
- helper name ref for this cache mapping
-
setServletName
public void setServletName(String servletName)
set the servlet-name this mapping applies- Parameters:
servletName
- name of the servlet
-
setURLPattern
public void setURLPattern(String urlPattern)
set the url-pattern this mapping applies- Parameters:
urlPattern
- url pattern this mapping applies
-
setTimeout
public void setTimeout(int timeout)
set the timeout- Parameters:
timeout
- specific timeout of the cacheable entries
-
setTimeoutField
public void setTimeoutField(Field field)
set the timeout field- Parameters:
field
- default timeout of the cacheable entries
-
setRefreshField
public void setRefreshField(Field field)
set the refresh field- Parameters:
field
- Boolean field for controlling when a refresh is needed
-
getRefreshField
public Field getRefreshField()
get the refresh field- Returns:
- Configured refresh field
-
setMethods
public void setMethods(String[] methods)
set allowable HTTP methods- Parameters:
methods
- allowable methods
-
addMethod
public void addMethod(String method)
add an allowable HTTP method- Parameters:
method
- allowable method
-
addKeyField
public void addKeyField(Field field)
add a key field- Parameters:
field
- key Field to add
-
addConstraintField
public void addConstraintField(ConstraintField field)
add a constraint key field- Parameters:
field
- ConstraintField to add
-
getHelperNameRef
public String getHelperNameRef()
get helper-name-ref associated with this mapping- Returns:
- helper name associated
-
getServletName
public String getServletName()
get the underlying servlet-name- Returns:
- servlet name
-
getURLPattern
public String getURLPattern()
get the underlying url-pattern this mapping applicable- Returns:
- url-pattern string configured
-
findMethod
public boolean findMethod(String method)
Returntrue
if the specified HTTP request method is allowed for caching- Parameters:
method
- Request method to check
-
getTimeout
public int getTimeout()
get the timeout- Returns:
- timeout value configured
-
getTimeoutField
public Field getTimeoutField()
get the timeout field- Returns:
- timeout field configured
-
getKeyFields
public Field[] getKeyFields()
get the key fields- Returns:
- key fields configured
-
getConstraintFields
public ConstraintField[] getConstraintFields()
get the constraint fields- Returns:
- constraint fields configured
-
-