Interface StreamingRemoteCache<K>


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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T extends java.io.InputStream & VersionedMetadata>
      T
      get​(K key)
      Retrieves the value of the specified key as an InputStream.
      java.io.OutputStream put​(K key)
      Initiates a streaming put operation.
      java.io.OutputStream put​(K key, long lifespan, java.util.concurrent.TimeUnit lifespanUnit)
      An overloaded form of put(Object), which takes in lifespan parameters.
      java.io.OutputStream put​(K key, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleUnit)
      An overloaded form of put(Object), which takes in lifespan and maxIdle parameters.
      java.io.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.
      java.io.OutputStream putIfAbsent​(K key, long lifespan, java.util.concurrent.TimeUnit lifespanUnit)
      An overloaded form of putIfAbsent(Object) which takes in lifespan parameters.
      java.io.OutputStream putIfAbsent​(K key, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleUnit)
      An overloaded form of putIfAbsent(Object) which takes in lifespan and maxIdle parameters.
      java.io.OutputStream replaceWithVersion​(K key, long version)
      A form of put(Object), which takes in a version.
      java.io.OutputStream replaceWithVersion​(K key, long version, long lifespan, java.util.concurrent.TimeUnit lifespanUnit)
      An overloaded form of replaceWithVersion(Object, long) which takes in lifespan parameters.
      java.io.OutputStream replaceWithVersion​(K key, long version, long lifespan, java.util.concurrent.TimeUnit lifespanUnit, long maxIdle, java.util.concurrent.TimeUnit maxIdleUnit)
      An overloaded form of replaceWithVersion(Object, long) which takes in lifespan and maxIdle parameters.
    • Method Detail

      • get

        <T extends java.io.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

        java.io.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

        java.io.OutputStream put​(K key,
                                 long lifespan,
                                 java.util.concurrent.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

        java.io.OutputStream put​(K key,
                                 long lifespan,
                                 java.util.concurrent.TimeUnit lifespanUnit,
                                 long maxIdle,
                                 java.util.concurrent.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

        java.io.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

        java.io.OutputStream putIfAbsent​(K key,
                                         long lifespan,
                                         java.util.concurrent.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

        java.io.OutputStream putIfAbsent​(K key,
                                         long lifespan,
                                         java.util.concurrent.TimeUnit lifespanUnit,
                                         long maxIdle,
                                         java.util.concurrent.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

        java.io.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

        java.io.OutputStream replaceWithVersion​(K key,
                                                long version,
                                                long lifespan,
                                                java.util.concurrent.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

        java.io.OutputStream replaceWithVersion​(K key,
                                                long version,
                                                long lifespan,
                                                java.util.concurrent.TimeUnit lifespanUnit,
                                                long maxIdle,
                                                java.util.concurrent.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