Class LiveTailHandle
java.lang.Object
codes.grow.packages.cloudwatchlogs.LiveTailHandle
- All Implemented Interfaces:
TailHandle,AutoCloseable
Handle of a live-tail session (
startLiveTail). On AWS a session streams new events for up
to 3 hours; the Moto emulator replays matching existing events once and ends the session.-
Method Summary
Modifier and TypeMethodDescriptionbooleanWaits until the session ended or the timeout passed.voidclose()Stops the session and releases the stream.done()Returns a future that completes when the session ends (service closed it, error, orclose()).error()Returns the error that ended the session, if any (also passed toonError).booleanisClosed()Returns whether the session has ended.Returns the session id from thesessionStartframe.voidstop()Stops the session (same asclose()).toString()
-
Method Details
-
sessionId
Returns the session id from thesessionStartframe.- Returns:
- the id (empty when the stream ended before the session started)
-
done
Returns a future that completes when the session ends (service closed it, error, orclose()). It never completes exceptionally; seeerror().- Returns:
- the future
-
await
Waits until the session ended or the timeout passed.- Parameters:
timeout- how long to wait- Returns:
- true when the session ended
-
error
Returns the error that ended the session, if any (also passed toonError).- Returns:
- the error, or empty
-
isClosed
public boolean isClosed()Returns whether the session has ended.- Returns:
- true once ended
-
stop
public void stop()Stops the session (same asclose()). Idempotent.- Specified by:
stopin interfaceTailHandle
-
close
public void close()Stops the session and releases the stream. Idempotent.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceTailHandle
-
toString
-