public class StreamingRemoteCacheImpl<K> extends Object implements StreamingRemoteCache<K>
StreamingRemoteCache| Constructor and Description |
|---|
StreamingRemoteCacheImpl(InternalRemoteCache<K,?> cache) |
| Modifier and Type | Method and Description |
|---|---|
<T extends InputStream & VersionedMetadata> |
get(K key)
Retrieves the value of the specified key as an
InputStream. |
OutputStream |
put(K key)
Initiates a streaming put operation.
|
OutputStream |
put(K key,
long lifespan,
TimeUnit unit)
An overloaded form of
StreamingRemoteCache.put(Object), which takes in lifespan parameters. |
OutputStream |
put(K key,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
An overloaded form of
StreamingRemoteCache.put(Object), which takes in lifespan and maxIdle parameters. |
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.
|
OutputStream |
putIfAbsent(K key,
long lifespan,
TimeUnit unit)
An overloaded form of
StreamingRemoteCache.putIfAbsent(Object) which takes in lifespan parameters. |
OutputStream |
putIfAbsent(K key,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
An overloaded form of
StreamingRemoteCache.putIfAbsent(Object) which takes in lifespan and maxIdle parameters. |
OutputStream |
replaceWithVersion(K key,
long version)
A form of
StreamingRemoteCache.put(Object), which takes in a version. |
OutputStream |
replaceWithVersion(K key,
long version,
long lifespan,
TimeUnit unit)
An overloaded form of
StreamingRemoteCache.replaceWithVersion(Object, long) which takes in lifespan parameters. |
OutputStream |
replaceWithVersion(K key,
long version,
long lifespan,
TimeUnit lifespanUnit,
long maxIdle,
TimeUnit maxIdleUnit)
An overloaded form of
StreamingRemoteCache.replaceWithVersion(Object, long) which takes in lifespan and maxIdle parameters. |
public StreamingRemoteCacheImpl(InternalRemoteCache<K,?> cache)
public <T extends InputStream & VersionedMetadata> T get(K key)
StreamingRemoteCacheInputStream. 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.get in interface StreamingRemoteCache<K>key - key to usepublic OutputStream put(K key)
StreamingRemoteCacheOutputStream
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.put in interface StreamingRemoteCache<K>key - key to usepublic OutputStream put(K key, long lifespan, TimeUnit unit)
StreamingRemoteCacheStreamingRemoteCache.put(Object), which takes in lifespan parameters.
The returned output stream is not thread-safe.put in interface StreamingRemoteCache<K>key - key to uselifespan - lifespan of the entry. Negative values are interpreted as unlimited lifespan.unit - unit of measurement for the lifespanpublic OutputStream put(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
StreamingRemoteCacheStreamingRemoteCache.put(Object), which takes in lifespan and maxIdle parameters.
The returned output stream is not thread-safe.put in interface StreamingRemoteCache<K>key - key to uselifespan - lifespan of the entrylifespanUnit - TimeUnit for lifespanmaxIdle - the maximum amount of time this key is allowed
to be idle for before it is considered as expiredmaxIdleUnit - TimeUnit for maxIdlepublic OutputStream putIfAbsent(K key)
StreamingRemoteCacheputIfAbsent in interface StreamingRemoteCache<K>key - key to usepublic OutputStream putIfAbsent(K key, long lifespan, TimeUnit unit)
StreamingRemoteCacheStreamingRemoteCache.putIfAbsent(Object) which takes in lifespan parameters.
The returned output stream is not thread-safe.putIfAbsent in interface StreamingRemoteCache<K>key - key to uselifespan - lifespan of the entryunit - TimeUnit for lifespanpublic OutputStream putIfAbsent(K key, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
StreamingRemoteCacheStreamingRemoteCache.putIfAbsent(Object) which takes in lifespan and maxIdle parameters.
The returned output stream is not thread-safe.putIfAbsent in interface StreamingRemoteCache<K>key - key to uselifespan - lifespan of the entrylifespanUnit - TimeUnit for lifespanmaxIdle - the maximum amount of time this key is allowed
to be idle for before it is considered as expiredmaxIdleUnit - TimeUnit for maxIdlepublic OutputStream replaceWithVersion(K key, long version)
StreamingRemoteCacheStreamingRemoteCache.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.replaceWithVersion in interface StreamingRemoteCache<K>key - key to useversion - the version to check forpublic OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit unit)
StreamingRemoteCacheStreamingRemoteCache.replaceWithVersion(Object, long) which takes in lifespan parameters.
The returned output stream is not thread-safe.replaceWithVersion in interface StreamingRemoteCache<K>key - key to useversion - the version to check forlifespan - lifespan of the entryunit - TimeUnit for lifespanpublic OutputStream replaceWithVersion(K key, long version, long lifespan, TimeUnit lifespanUnit, long maxIdle, TimeUnit maxIdleUnit)
StreamingRemoteCacheStreamingRemoteCache.replaceWithVersion(Object, long) which takes in lifespan and maxIdle parameters.
The returned output stream is not thread-safe.replaceWithVersion in interface StreamingRemoteCache<K>key - key to useversion - the version to check forlifespan - lifespan of the entrylifespanUnit - TimeUnit for lifespanmaxIdle - the maximum amount of time this key is allowed
to be idle for before it is considered as expiredmaxIdleUnit - TimeUnit for maxIdleCopyright © 2022 JBoss by Red Hat. All rights reserved.