Class AbstractVersionedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.infinispan.client.hotrod.impl.protocol.AbstractVersionedInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Metadata
,Versioned
,VersionedMetadata
- Direct Known Subclasses:
ChannelInputStream
@NotThreadSafe public abstract class AbstractVersionedInputStream extends InputStream implements VersionedMetadata
-
-
Field Summary
Fields Modifier and Type Field Description protected Runnable
afterClose
protected VersionedMetadata
versionedMetadata
-
Constructor Summary
Constructors Constructor Description AbstractVersionedInputStream(VersionedMetadata versionedMetadata, Runnable afterClose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
getCreated()
long
getLastUsed()
int
getLifespan()
int
getMaxIdle()
long
getVersion()
-
Methods inherited from class java.io.InputStream
available, mark, markSupported, nullInputStream, read, read, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
-
-
-
-
Field Detail
-
versionedMetadata
protected final VersionedMetadata versionedMetadata
-
afterClose
protected final Runnable afterClose
-
-
Constructor Detail
-
AbstractVersionedInputStream
public AbstractVersionedInputStream(VersionedMetadata versionedMetadata, Runnable afterClose)
-
-
Method Detail
-
getVersion
public long getVersion()
- Specified by:
getVersion
in interfaceVersioned
-
getCreated
public long getCreated()
- Specified by:
getCreated
in interfaceMetadata
- Returns:
- Time when entry was created. -1 for immortal entries.
-
getLifespan
public int getLifespan()
- Specified by:
getLifespan
in interfaceMetadata
- Returns:
- Lifespan of the entry in seconds. Negative values are interpreted as unlimited lifespan.
-
getLastUsed
public long getLastUsed()
- Specified by:
getLastUsed
in interfaceMetadata
- Returns:
- Time when entry was last used. -1 for immortal entries.
-
getMaxIdle
public int getMaxIdle()
- Specified by:
getMaxIdle
in interfaceMetadata
- Returns:
- The maximum amount of time (in seconds) this key is allowed to be idle for before it is considered as expired.
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classInputStream
- Throws:
IOException
-
-