Interface StreamingRemoteCache<K>

All Known Implementing Classes:
StreamingRemoteCacheImpl

public interface StreamingRemoteCache<K>
StreamingRemoteCache implements streaming versions of most RemoteCache methods
Since:
9.0
Author:
Tristan Tarrant
  • Method Details

    • get

      <T extends InputStream & VersionedMetadata> T get(K key)
      Retrieves the value of the specified key as an InputStream. It is up to the application to ensure that the stream is consumed and closed. The marshaller is ignored, i.e. all data will be read in its raw binary form. The returned input stream implements the VersionedMetadata interface. The returned input stream is not thread-safe.
      Parameters:
      key - key to use
    • put

      OutputStream put(K key)
      Initiates a streaming put operation. It is up to the application to write to the returned OutputStream and close it when there is no more data to write. The marshaller is ignored, i.e. all data will be written in its raw binary form. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
    • put

      OutputStream put(K key, long lifespan, TimeUnit lifespanUnit)
      An overloaded form of put(Object), which takes in lifespan parameters. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      lifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.
      lifespanUnit - unit of measurement for the lifespan
    • put

      OutputStream put(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
      An overloaded form of put(Object), which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      lifespan - lifespan of the entry
      lifespanUnit - TimeUnit for lifespan
      maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
      maxIdleUnit - TimeUnit for maxIdle
    • putIfAbsent

      OutputStream putIfAbsent(K key)
      A conditional form of put which inserts an entry into the cache only if no mapping for the key is already present. The operation is atomic. The server only performs the operation once the stream has been closed. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
    • putIfAbsent

      OutputStream putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit)
      An overloaded form of putIfAbsent(Object) which takes in lifespan parameters. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      lifespan - lifespan of the entry
      lifespanUnit - TimeUnit for lifespan
    • putIfAbsent

      OutputStream putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
      An overloaded form of putIfAbsent(Object) which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      lifespan - lifespan of the entry
      lifespanUnit - TimeUnit for lifespan
      maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
      maxIdleUnit - TimeUnit for maxIdle
    • replaceWithVersion

      OutputStream replaceWithVersion(K key, long version)
      A form of put(Object), which takes in a version. The value will be replaced on the server only if the existing entry's version matches. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      version - the version to check for
    • replaceWithVersion

      OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit)
      An overloaded form of replaceWithVersion(Object, long) which takes in lifespan parameters. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      version - the version to check for
      lifespan - lifespan of the entry
      lifespanUnit - TimeUnit for lifespan
    • replaceWithVersion

      OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
      An overloaded form of replaceWithVersion(Object, long) which takes in lifespan and maxIdle parameters. The returned output stream is not thread-safe.
      Parameters:
      key - key to use
      version - the version to check for
      lifespan - lifespan of the entry
      lifespanUnit - TimeUnit for lifespan
      maxIdle - the maximum amount of time this key is allowed to be idle for before it is considered as expired
      maxIdleUnit - TimeUnit for maxIdle