public class LogRequestor extends Thread implements LogGetHandle
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
LogRequestor(org.apache.http.impl.client.CloseableHttpClient client,
UrlBuilder urlBuilder,
String containerId,
LogCallback callback)
Create a helper object for requesting log entries synchronously (
fetchLogs() ) or asynchronously (Thread.start() . |
Modifier and Type | Method and Description |
---|---|
void |
fetchLogs()
Get logs and feed a callback with the content
|
void |
finish() |
DockerAccessException |
getException() |
boolean |
isError() |
void |
run() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public LogRequestor(org.apache.http.impl.client.CloseableHttpClient client, UrlBuilder urlBuilder, String containerId, LogCallback callback)
fetchLogs()
) or asynchronously (Thread.start()
.client
- HTTP client to use for requesting the docker hosturlBuilder
- builder that creates docker urlscontainerId
- container for which to fetch the hostcallback
- callback to call for each line receivedpublic void fetchLogs()
public void finish()
finish
in interface LogGetHandle
public boolean isError()
isError
in interface LogGetHandle
public DockerAccessException getException()
getException
in interface LogGetHandle
Copyright © 2020. All rights reserved.