com.ibm.websphere.cache
Interface EntryInfo

All Known Subinterfaces:
FragmentInfo, JAXRPCEntryInfo

public interface EntryInfo

EntryInfo and FragmentInfo objects contain metadata for caching and are attached to each cache entry. IdGenerators and MetaDataGenerators use these interfaces to define the caching metadata for an entry.

Typically a Id/MetaDataGenerator will get an entry's FragmentInfo object from the ServletCacheRequest, and use the object's set methods to configure that entry.

The following is a summary of the caching metadata for a CacheEntry:


Field Summary
static int NOT_SHARED
          The entry is kept local to the JVM that executed the entry's JSP or command instead of shared across all JVMs.
static int SHARED_PULL
          Deprecated. Share type PULL should not be used in new code development. Use share type PUSH_PULL instead. Share type PULL, if used in existing code, will function like share type PUSH_PULL.
static int SHARED_PUSH
          The entry is shared across multiple JVMs; the entry is pushed to all JVMs after its JSP or command is executed instead of waiting for the JVMs to pull it.
static int SHARED_PUSH_PULL
          The entry is shared across multiple JVMs; the id of the entry is pushed on initial creation (execution of JSP/Servlet or command) and stored in the other JVMs.
 
Method Summary
 void addAlias(java.lang.Object alias)
          This unions a new alias id into the aliasList variable.
 void addDataId(java.lang.String dataId)
          This unions a new data id into the dataIds variable.
 void addTemplate(java.lang.String template)
          This adds a template to the templates variable.
 java.util.Enumeration getAliasList()
          This gets the alias list from the aliasList variable.
 int getCacheType()
          Returns cache type (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)
 java.util.Enumeration getDataIds()
          This gets the data ids from the dataIds variable.
 long getExpirationTime()
          This gets the expiration time from the expirationTime variable.
 java.lang.String getId()
          This gets the id variable.
 java.lang.Object getIdObject()
          This gets the id variable as an java.lang.Object.
 int getInactivity()
          This gets the inactiviy timer for this cache entry.
 boolean getPersistToDisk()
          This gets the value of the persist to disk boolean variable.
 int getPriority()
          This gets the priority in the priority variable.
 int getSharingPolicy()
          This gets the sharing policy in the sharingPolicy variable.
 java.lang.String getTemplate()
          This gets one of the templates set on this entry info.
 java.util.Enumeration getTemplates()
          This gets the templates in the templates variable.
 int getTimeLimit()
          This gets the time limit on this cache entry.
 java.lang.Object getUserMetaData()
          This gets the userMetaData in the userMetaData variable.
 long getValidatorExpirationTime()
          Returns the validator expiration time of the entry in the cache The validator expiration time along with the expiration time control the state of the entry in the cache.
 boolean isBatchEnabled()
          This determines whether updates (when sharing is PUSH) are sent immediately or in an asynchronous batch fashion
 boolean isNotShared()
          This determines whether the sharingPolicy is EntryInfo.NOT_SHARED.
 boolean isSharedPull()
          This determines whether the sharingPolicy is EntryInfo.SHARED_PULL.
 boolean isSharedPush()
          This determines whether the sharingPolicy is EntryInfo.SHARED_PUSH.
 void setBatchEnabled(boolean flag)
          This sets whether updates (when sharing is PUSH) are sent immediately or in an asynchronous batch fashion
 void setExpirationTime(long expirationTime)
          This sets the expirationTime variable.
 void setId(java.lang.String id)
          This sets the id variable.
 void setInactivity(int inactivity)
          This sets the inactivity timer variable.
 void setPersistToDisk(boolean persistToDisk)
          This sets the persist-to-disk property in the persistToDisk variable.
 void setPriority(int priority)
          This assigns the new priority to the priority variable.
 void setSharingPolicy(int policy)
          This sets the sharing policy in the sharingPolicy variable.
 void setTimeLimit(int timeLimit)
          This sets the time limit in the timeLimit variable.
 void setUserMetaData(java.lang.Object userMetaData)
          This assigns the new userMetaData to the userMetaData variable.
 

Field Detail

NOT_SHARED

static final int NOT_SHARED
The entry is kept local to the JVM that executed the entry's JSP or command instead of shared across all JVMs. This option is useful when there is affinity between a client and web application server and the data is only used by that client (e.g., a shopping cart).

See Also:
Constant Field Values

SHARED_PUSH

static final int SHARED_PUSH
The entry is shared across multiple JVMs; the entry is pushed to all JVMs after its JSP or command is executed instead of waiting for the JVMs to pull it. Pushing these entries is delayed for a short time (which is configurable) to exploit the efficiency of batching several entries in one message. This option is useful when the entry is very heavily used by all clients (e.g., a popular product display).

See Also:
Constant Field Values

SHARED_PULL

static final int SHARED_PULL
Deprecated. Share type PULL should not be used in new code development. Use share type PUSH_PULL instead. Share type PULL, if used in existing code, will function like share type PUSH_PULL.
The entry is shared across multiple JVMs; other JVMs get it by pulling it when needed and then storing it in its local cache for further requests. This option is useful when the entry is shared by all clients but is not accessed often enough between invalidations to warrant pushing it to other (e.g., a not-so-popular product display).

See Also:
Constant Field Values

SHARED_PUSH_PULL

static final int SHARED_PUSH_PULL
The entry is shared across multiple JVMs; the id of the entry is pushed on initial creation (execution of JSP/Servlet or command) and stored in the other JVMs. If the actual entry is requested, other JVMs first look to see if the id has been broadcasted previously before making a remote request for it.

See Also:
Constant Field Values
Method Detail

getId

java.lang.String getId()
This gets the id variable.

Returns:
The cache id.

getIdObject

java.lang.Object getIdObject()
This gets the id variable as an java.lang.Object.

Returns:
The cache id.

setId

void setId(java.lang.String id)
This sets the id variable.

Parameters:
id - The cache id.

isBatchEnabled

boolean isBatchEnabled()
This determines whether updates (when sharing is PUSH) are sent immediately or in an asynchronous batch fashion

Returns:
True if updates are done in a batch

setBatchEnabled

void setBatchEnabled(boolean flag)
This sets whether updates (when sharing is PUSH) are sent immediately or in an asynchronous batch fashion

Parameters:
flag - true to enable batch updates, false otherwise.

getSharingPolicy

int getSharingPolicy()
This gets the sharing policy in the sharingPolicy variable.

Returns:
The sharing policy.
See Also:
EntryInfo

getPersistToDisk

boolean getPersistToDisk()
This gets the value of the persist to disk boolean variable.

Returns:
The the persist to disk.

setSharingPolicy

void setSharingPolicy(int policy)
This sets the sharing policy in the sharingPolicy variable.

Parameters:
policy - The sharing policy.
See Also:
EntryInfo

setPersistToDisk

void setPersistToDisk(boolean persistToDisk)
This sets the persist-to-disk property in the persistToDisk variable.

Parameters:
persistToDisk - The persistToDisk property.

isNotShared

boolean isNotShared()
This determines whether the sharingPolicy is EntryInfo.NOT_SHARED.

Returns:
True indicates that the sharingPolicy is EntryInfo.NOT_SHARED.

isSharedPush

boolean isSharedPush()
This determines whether the sharingPolicy is EntryInfo.SHARED_PUSH.

Returns:
True indicates that the sharingPolicy is EntryInfo.SHARED_PUSH or EntryInfo.SHARED_PUSH_PULL.

isSharedPull

boolean isSharedPull()
This determines whether the sharingPolicy is EntryInfo.SHARED_PULL.

Returns:
True indicates that the sharingPolicy is EntryInfo.SHARED_PULL or EntryInfo.SHARED_PUSH_PULL.

getTimeLimit

int getTimeLimit()
This gets the time limit on this cache entry.

Returns:
The time limit.

setTimeLimit

void setTimeLimit(int timeLimit)
This sets the time limit in the timeLimit variable. Once an entry is cached, it will remain in the cache for this many seconds

Parameters:
timeLimit - The time limit.

getInactivity

int getInactivity()
This gets the inactiviy timer for this cache entry.

Returns:
The inactivity timer.

setInactivity

void setInactivity(int inactivity)
This sets the inactivity timer variable. Once an entry is cached, it will remain in the cache for this many seconds if not accessed.

Parameters:
inactivity - This inactivity timer.

getExpirationTime

long getExpirationTime()
This gets the expiration time from the expirationTime variable.

Returns:
The expiration time.

setExpirationTime

void setExpirationTime(long expirationTime)
This sets the expirationTime variable.

Parameters:
expirationTime - The new expiration time.

getPriority

int getPriority()
This gets the priority in the priority variable.

Returns:
The priority.

setPriority

void setPriority(int priority)
This assigns the new priority to the priority variable.

Parameters:
priority - The new priority.

getTemplates

java.util.Enumeration getTemplates()
This gets the templates in the templates variable.

Returns:
An Enumeration of the template names.

getTemplate

java.lang.String getTemplate()
This gets one of the templates set on this entry info.

Returns:
A template name.

addTemplate

void addTemplate(java.lang.String template)
This adds a template to the templates variable.

Parameters:
template - The new Template name.

getDataIds

java.util.Enumeration getDataIds()
This gets the data ids from the dataIds variable.

Returns:
The Enumeration of data ids.

addDataId

void addDataId(java.lang.String dataId)
This unions a new data id into the dataIds variable.

Parameters:
dataId - The new data id.

getAliasList

java.util.Enumeration getAliasList()
This gets the alias list from the aliasList variable.

Returns:
The Enumeration of data ids.

addAlias

void addAlias(java.lang.Object alias)
This unions a new alias id into the aliasList variable.

Parameters:
alias - The new alias id.

getUserMetaData

java.lang.Object getUserMetaData()
This gets the userMetaData in the userMetaData variable.

Returns:
The userMetaData.

setUserMetaData

void setUserMetaData(java.lang.Object userMetaData)
This assigns the new userMetaData to the userMetaData variable.

Parameters:
userMetaData - The new userMetaData.

getValidatorExpirationTime

long getValidatorExpirationTime()
Returns the validator expiration time of the entry in the cache The validator expiration time along with the expiration time control the state of the entry in the cache.

Returns:
long the current validator expiration time in milliseconds

getCacheType

int getCacheType()
Returns cache type (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)

Returns:
cache type