Interface Metadata

All Known Subinterfaces:
InternalMetadata
All Known Implementing Classes:
EmbeddedMetadata, EmbeddedMetadata.EmbeddedExpirableMetadata, EmbeddedMetadata.EmbeddedLifespanExpirableMetadata, EmbeddedMetadata.EmbeddedMaxIdleExpirableMetadata, InternalMetadataImpl, L1Metadata, MemcachedMetadata, MetaParamsInternalMetadata, RemoteMetadata

public interface Metadata
This interface encapsulates metadata information that can be stored alongside values in the cache.
Since:
5.3
Author:
Galder ZamarreƱo
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    Metadata builder
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an instance of Metadata.Builder which can be used to build new instances of Metadata instance which are full copies of this Metadata.
    default boolean
    Returns whether this metadata is effectively empty, that is that persisting or replicating it to another node would be no different then sending a null metadata object.
    long
    Returns the lifespan of the cache entry with which this metadata object is associated, in milliseconds.
    long
    Returns the the maximum amount of time that the cache entry associated with this metadata object is allowed to be idle for before it is considered as expired, in milliseconds.
    default boolean
    Returns if the creation timestamp is updated when an entry is modified.
    Returns the version of the cache entry with which this metadata object is associated.
  • Method Details

    • lifespan

      long lifespan()
      Returns the lifespan of the cache entry with which this metadata object is associated, in milliseconds. Negative values are interpreted as unlimited lifespan.
      Returns:
      lifespan of the entry in number of milliseconds
    • maxIdle

      long maxIdle()
      Returns the the maximum amount of time that the cache entry associated with this metadata object is allowed to be idle for before it is considered as expired, in milliseconds.
      Returns:
      maximum idle time of the entry in number of milliseconds
    • version

      EntryVersion version()
      Returns the version of the cache entry with which this metadata object is associated.
      Returns:
      version of the entry
    • updateCreationTimestamp

      @Experimental default boolean updateCreationTimestamp()
      Returns if the creation timestamp is updated when an entry is modified.

      Created entries always update the creation timestamp.

      This capability is experimental and all Infinispan implementations return true. To update creation timestamps you must create a custom Metadata implementation.

      Returns:
      true to update the creation timestamp when entries are modified.
    • isEmpty

      default boolean isEmpty()
      Returns whether this metadata is effectively empty, that is that persisting or replicating it to another node would be no different then sending a null metadata object.
      Returns:
      if this metadata has no actual data to store
    • builder

      Metadata.Builder builder()
      Returns an instance of Metadata.Builder which can be used to build new instances of Metadata instance which are full copies of this Metadata.
      Returns:
      instance of Metadata.Builder