Class RawExtractor

java.lang.Object
overit.geocall.cache.RawExtractor
All Implemented Interfaces:
Serializable, Entry<byte[],byte[]>

public class RawExtractor extends Object implements Entry<byte[],byte[]>
Class that allows an entry to be extracted from the cache exactly as it was stored. Loading is not supported, so you can only use this class to retrieve items that are already present in the cache.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a RawExtractor for the entry linked to the passed key
    Creates a RawExtractor for the entry linked to the passed key and view
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    compose(byte[] bb)
    The method for obtaining the composed instance of the object.
    byte[]
    fromRaw(byte[] bb)
    Create the instance of the real entry value by deserializing the passed bytes array
    Defines the name of a cacheable object
    Defines the name of a view for the cacheable object
    byte[]
    The method for obtaining the real value of the entry
    byte[]
    toRaw(byte[] bb)
    Serialize the real value of the entry into a bytes array.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface overit.geocall.cache.Entry

    getCharset, getClusterTtl, getReadTtl, getStoreTtl
  • Constructor Details

    • RawExtractor

      public RawExtractor(String key)
      Creates a RawExtractor for the entry linked to the passed key
      Parameters:
      key - the name of a cacheable object
    • RawExtractor

      public RawExtractor(String key, String view)
      Creates a RawExtractor for the entry linked to the passed key and view
      Parameters:
      key - the name of a cacheable object
      view - the name of the view for the cacheable object
  • Method Details

    • getKey

      public String getKey()
      Description copied from interface: Entry
      Defines the name of a cacheable object
      Specified by:
      getKey in interface Entry<byte[],byte[]>
      Returns:
      the name of a cacheable object
    • getView

      public String getView()
      Description copied from interface: Entry
      Defines the name of a view for the cacheable object
      Specified by:
      getView in interface Entry<byte[],byte[]>
      Returns:
      the name of the view for the cacheable object. Typically, the empty string indicates that the entry consists of only one view
    • load

      public byte[] load()
      Description copied from interface: Entry
      The method for obtaining the real value of the entry
      Specified by:
      load in interface Entry<byte[],byte[]>
      Returns:
      the real value of the entry. This method must be used when the cache doesn't contains a version for this Entry
    • compose

      public byte[] compose(byte[] bb)
      Description copied from interface: Entry
      The method for obtaining the composed instance of the object. This method allows the real instance of the object to be aggregated with other information, such as the composition of a system configuration with the default one
      Specified by:
      compose in interface Entry<byte[],byte[]>
      Parameters:
      bb - the real instance of the object
      Returns:
      the composed instance of the object. This method must be used after the invocation of the Entry.load() method when the cache doesn't contain a version for this entry.
    • fromRaw

      public byte[] fromRaw(byte[] bb)
      Description copied from interface: Entry
      Create the instance of the real entry value by deserializing the passed bytes array
      Specified by:
      fromRaw in interface Entry<byte[],byte[]>
      Parameters:
      bb - the bytes array containing the serialized object
      Returns:
      the real entry value instance
    • toRaw

      public byte[] toRaw(byte[] bb)
      Description copied from interface: Entry
      Serialize the real value of the entry into a bytes array.
      Specified by:
      toRaw in interface Entry<byte[],byte[]>
      Parameters:
      bb - the real value of the entry
      Returns:
      the serialized bytes array