Interface EntryInfo


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:

  • The template. (set internally by WebSphere)
  • The ID. (set internally by WebSphere with the output of the IdGenerator.getId() method)
  • The priority.
  • The timeLimit and expirationTime options.
  • The dataIds option.
  • The external cache group to which this entry will be pushed (FragmentInfo)

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The entry is kept local to the JVM that executed the entry's JSP or command instead of shared across all JVMs.
    static final int
    Deprecated.
    Share type PULL should not be used in new code development.
    static final int
    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 final int
    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

    Modifier and Type
    Method
    Description
    void
    Adds a new alias ID.
    void
    addDataId(String dataId)
    Adds a new data ID.
    void
    addTemplate(String template)
    Adds a template.
    Returns the alias IDs set on this entry info.
    int
    Returns cache type (CACHE_TYPE_DEFAULT or CACHE_TYPE_JAXRPC)
    Returns the data IDs set on this entry info.
    long
    Returns the expiration time.
    Returns the string representation of cache ID.
    Returns the object representation of cache ID.
    int
    Returns the inactiviy timer.
    boolean
    Determine whether persist-to-disk is true.
    int
    Returns the priority.
    int
    Returns the sharing policy in the sharingPolicy variable.
    Returns one of the templates set on this entry info.
    Returns the templates set on this entry info.
    int
    Returns the time limit.
    Returns the userMetaData.
    long
    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
    Deprecated.
    The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode.
    boolean
    Determines whether the sharingPolicy is EntryInfo.NOT_SHARED.
    boolean
    Determines whether the sharingPolicy is EntryInfo.SHARED_PULL.
    boolean
    Determines whether the sharingPolicy is EntryInfo.SHARED_PUSH.
    void
    setBatchEnabled(boolean flag)
    Deprecated.
    The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode.
    void
    setExpirationTime(long expirationTime)
    Assigns new expiration time.
    void
    Sets the cache ID.
    void
    setInactivity(int inactivity)
    Assigns the inactivity timer.
    void
    setPersistToDisk(boolean persistToDisk)
    Sets the persist-to-disk.
    void
    setPriority(int priority)
    Assigns the new priority.
    void
    setSharingPolicy(int policy)
    Sets the sharing policy.
    void
    setTimeLimit(int timeLimit)
    Assigns the time limit.
    void
    setUserMetaData(Object userMetaData)
    Assigns the new userMetaData.
  • Field Details

    • 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:
    • 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:
    • 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:
    • 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:
  • Method Details

    • getId

      String getId()
      Returns the string representation of cache ID.
      Returns:
      The string representation of cache ID..
    • getIdObject

      Object getIdObject()
      Returns the object representation of cache ID.
      Returns:
      The object representation of cache ID.
    • setId

      void setId(String id)
      Sets the cache ID.
      Parameters:
      id - The cache ID.
    • isBatchEnabled

      boolean isBatchEnabled()
      Deprecated.
      The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode. It always returns true.
      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)
      Deprecated.
      The updates for Push or Push-Pull sharing policies are always done in an asynchronous batch mode. Calling setBatchEnabled(false) has no effect on cache replication.
      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()
      Returns the sharing policy in the sharingPolicy variable.
      Returns:
      The sharing policy.
      See Also:
    • getPersistToDisk

      boolean getPersistToDisk()
      Determine whether persist-to-disk is true.
      Returns:
      True if this entry persists to disk.
    • setSharingPolicy

      void setSharingPolicy(int policy)
      Sets the sharing policy.
      Parameters:
      policy - The sharing policy.
      See Also:
    • setPersistToDisk

      void setPersistToDisk(boolean persistToDisk)
      Sets the persist-to-disk. If disk cache offload is enabled and persist-to-disk is true, the entry will be offloaded to the disk.
      Parameters:
      persistToDisk - The persist-to-disk.
    • isNotShared

      boolean isNotShared()
      Determines whether the sharingPolicy is EntryInfo.NOT_SHARED.
      Returns:
      True indicates that the sharingPolicy is EntryInfo.NOT_SHARED.
    • isSharedPush

      boolean isSharedPush()
      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()
      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()
      Returns the time limit.
      Returns:
      The time limit.
    • setTimeLimit

      void setTimeLimit(int timeLimit)
      Assigns the time limit. Once an entry is cached, it will remain in the cache for this many seconds
      Parameters:
      timeLimit - The time limit.
    • getInactivity

      int getInactivity()
      Returns the inactiviy timer.
      Returns:
      The inactivity timer.
    • setInactivity

      void setInactivity(int inactivity)
      Assigns the inactivity timer. 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()
      Returns the expiration time.
      Returns:
      The expiration time.
    • setExpirationTime

      void setExpirationTime(long expirationTime)
      Assigns new expiration time.
      Parameters:
      expirationTime - The new expiration time.
    • getPriority

      int getPriority()
      Returns the priority.
      Returns:
      The priority.
    • setPriority

      void setPriority(int priority)
      Assigns the new priority.
      Parameters:
      priority - The new priority.
    • getTemplates

      Enumeration getTemplates()
      Returns the templates set on this entry info.
      Returns:
      An Enumeration of the template names.
    • getTemplate

      String getTemplate()
      Returns one of the templates set on this entry info.
      Returns:
      A template name.
    • addTemplate

      void addTemplate(String template)
      Adds a template.
      Parameters:
      template - The new Template name.
    • getDataIds

      Enumeration getDataIds()
      Returns the data IDs set on this entry info.
      Returns:
      The Enumeration of data IDs.
    • addDataId

      void addDataId(String dataId)
      Adds a new data ID.
      Parameters:
      dataId - The new data ID.
    • getAliasList

      Enumeration getAliasList()
      Returns the alias IDs set on this entry info.
      Returns:
      The Enumeration of alias IDs.
    • addAlias

      void addAlias(Object alias)
      Adds a new alias ID.
      Parameters:
      alias - The new alias ID.
    • getUserMetaData

      Object getUserMetaData()
      Returns the userMetaData.
      Returns:
      The userMetaData.
    • setUserMetaData

      void setUserMetaData(Object userMetaData)
      Assigns the new userMetaData.
      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