Class JCacheEntryMetaInf

java.lang.Object
com.tangosol.coherence.jcache.common.JCacheEntryMetaInf
All Implemented Interfaces:
ExternalizableLite, PortableObject, Serializable

public class JCacheEntryMetaInf extends Object implements ExternalizableLite, PortableObject
Represents the JCache metadata for a key and value pair stored in a Cache.

The meta info is stored as a Coherence decoration on the value in invalid input: '{@link /*missing*/}'ParitionedCache}. The meta info is a member of a LocalCacheValue;

JCacheEntryMetaInfs store and provide meta information about a Cache Entry, including information for dealing with expiry.

Since:
Coherence 12.1.3
Author:
jf 2013.10.24
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a JCacheEntryMetaInf.
    JCacheEntryMetaInf(long ldtCreated, javax.cache.expiry.ExpiryPolicy expiryPolicy)
    Constructs an JCacheEntryMetaInf.
    Copy constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    accessed(long ldtAccessed, javax.cache.expiry.ExpiryPolicy expiryPolicy)
    Update the JCacheEntryMetaInf based on the associated entry being accessed at the specified time.
    long
    Gets the number of times the internal value has been accessed.
    long
    Gets the time (since the Epoc) in milliseconds since the internal value was last accessed.
    long
    Gets the time (since the Epoc) in milliseconds since the internal value was created.
    long
    Gets the time (since the Epoc) in milliseconds when the Cache Entry associated with this value should be considered expired.
    long
    Gets the number of times the internal value has been modified (set)
    long
    Gets the time (since the Epoc) in milliseconds since the internal value was last modified.
    boolean
    isExpiredAt(long now)
    Determines if the Cache Entry associated with this value would be expired at the specified time
    void
    modified(long ldtModified, javax.cache.expiry.ExpiryPolicy expiryPolicy)
    Update the JCacheEntryMetaInf based on the associated entry being modified at the specified time.
    void
    Restore the contents of a user type instance by reading its state using the specified PofReader object.
    void
    read from datainput
    void
    setAccessTime(long accessTime)
    Gets the internal value with the side-effect of updating the access time to that which is specified and incrementing the access count.
    void
    setExpiryTime(long expiryTime)
    Sets the time (since the Epoc) in milliseconds when the Cache Entry associated with this value should be considered expired.
    void
    setModificationTime(long modificationTime)
    Sets update the modification time for the meta data for a key and value pair.
     
    void
    Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
    void
    write to

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • JCacheEntryMetaInf

      public JCacheEntryMetaInf()
      Constructs a JCacheEntryMetaInf.
    • JCacheEntryMetaInf

      public JCacheEntryMetaInf(JCacheEntryMetaInf metaInf)
      Copy constructor
      Parameters:
      metaInf -
    • JCacheEntryMetaInf

      public JCacheEntryMetaInf(long ldtCreated, javax.cache.expiry.ExpiryPolicy expiryPolicy)
      Constructs an JCacheEntryMetaInf.
      Parameters:
      ldtCreated - the time when the cache entry was created
      expiryPolicy - the ExpiryPolicy to determine the expiry time
  • Method Details

    • getCreationTime

      public long getCreationTime()
      Gets the time (since the Epoc) in milliseconds since the internal value was created.
      Returns:
      time in milliseconds (since the Epoc)
    • getAccessTime

      public long getAccessTime()
      Gets the time (since the Epoc) in milliseconds since the internal value was last accessed.
      Returns:
      time in milliseconds (since the Epoc)
    • getAccessCount

      public long getAccessCount()
      Gets the number of times the internal value has been accessed.
      Returns:
      the access count
    • getModificationTime

      public long getModificationTime()
      Gets the time (since the Epoc) in milliseconds since the internal value was last modified.
      Returns:
      time in milliseconds (since the Epoc)
    • getModificationCount

      public long getModificationCount()
      Gets the number of times the internal value has been modified (set)
      Returns:
      the modification count
    • getExpiryTime

      public long getExpiryTime()
      Gets the time (since the Epoc) in milliseconds when the Cache Entry associated with this value should be considered expired.
      Returns:
      time in milliseconds (since the Epoc)
    • setExpiryTime

      public void setExpiryTime(long expiryTime)
      Sets the time (since the Epoc) in milliseconds when the Cache Entry associated with this value should be considered expired.
      Parameters:
      expiryTime - time in milliseconds (since the Epoc)
    • isExpiredAt

      public boolean isExpiredAt(long now)
      Determines if the Cache Entry associated with this value would be expired at the specified time
      Parameters:
      now - time in milliseconds (since the Epoc)
      Returns:
      true if the value would be expired at the specified time
    • setAccessTime

      public void setAccessTime(long accessTime)
      Gets the internal value with the side-effect of updating the access time to that which is specified and incrementing the access count.
      Parameters:
      accessTime - the time when the related value was accessed
    • setModificationTime

      public void setModificationTime(long modificationTime)
      Sets update the modification time for the meta data for a key and value pair. Incrementing the modification count. * @param m_ldtModification the time when the value was modified
    • accessed

      public void accessed(long ldtAccessed, javax.cache.expiry.ExpiryPolicy expiryPolicy)
      Update the JCacheEntryMetaInf based on the associated entry being accessed at the specified time.
      Parameters:
      ldtAccessed - the time the entry was accessed
      expiryPolicy - the ExpiryPolicy for the Cache
    • modified

      public void modified(long ldtModified, javax.cache.expiry.ExpiryPolicy expiryPolicy)
      Update the JCacheEntryMetaInf based on the associated entry being modified at the specified time.
      Parameters:
      ldtModified - the time the entry was accessed
      expiryPolicy - the ExpiryPolicy for the Cache
    • readExternal

      public void readExternal(DataInput dataInput) throws IOException
      read from datainput
      Specified by:
      readExternal in interface ExternalizableLite
      Parameters:
      dataInput -
      Throws:
      IOException
    • writeExternal

      public void writeExternal(DataOutput dataOutput) throws IOException
      write to
      Specified by:
      writeExternal in interface ExternalizableLite
      Parameters:
      dataOutput -
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • readExternal

      public void readExternal(PofReader pofReader) throws IOException
      Description copied from interface: PortableObject
      Restore the contents of a user type instance by reading its state using the specified PofReader object.
      Specified by:
      readExternal in interface PortableObject
      Parameters:
      pofReader - the PofReader from which to read the object's state
      Throws:
      IOException - if an I/O error occurs
    • writeExternal

      public void writeExternal(PofWriter pofWriter) throws IOException
      Description copied from interface: PortableObject
      Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
      Specified by:
      writeExternal in interface PortableObject
      Parameters:
      pofWriter - the PofWriter to which to write the object's state
      Throws:
      IOException - if an I/O error occurs