Class AbstractVersionedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.infinispan.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 RunnableafterCloseprotected VersionedMetadataversionedMetadata
-
Constructor Summary
Constructors Constructor Description AbstractVersionedInputStream(VersionedMetadata versionedMetadata, Runnable afterClose)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()longgetCreated()longgetLastUsed()intgetLifespan()intgetMaxIdle()longgetVersion()-
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:
getVersionin interfaceVersioned
-
getCreated
public long getCreated()
- Specified by:
getCreatedin interfaceMetadata- Returns:
- Time when entry was created. -1 for immortal entries.
-
getLifespan
public int getLifespan()
- Specified by:
getLifespanin interfaceMetadata- Returns:
- Lifespan of the entry in seconds. Negative values are interpreted as unlimited lifespan.
-
getLastUsed
public long getLastUsed()
- Specified by:
getLastUsedin interfaceMetadata- Returns:
- Time when entry was last used. -1 for immortal entries.
-
getMaxIdle
public int getMaxIdle()
- Specified by:
getMaxIdlein 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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-