Class LogRequestor
- java.lang.Object
-
- java.lang.Thread
-
- io.fabric8.maven.docker.access.log.LogRequestor
-
- All Implemented Interfaces:
LogGetHandle,Runnable
public class LogRequestor extends Thread implements LogGetHandle
Extractor for parsing the response of a log request- Since:
- 28/11/14
- Author:
- roland
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor 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().
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfetchLogs()Get logs and feed a callback with the contentvoidfinish()DockerAccessExceptiongetException()booleanisError()voidrun()-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
LogRequestor
public 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().- Parameters:
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 received
-
-
Method Detail
-
fetchLogs
public void fetchLogs()
Get logs and feed a callback with the content
-
finish
public void finish()
- Specified by:
finishin interfaceLogGetHandle
-
isError
public boolean isError()
- Specified by:
isErrorin interfaceLogGetHandle
-
getException
public DockerAccessException getException()
- Specified by:
getExceptionin interfaceLogGetHandle
-
-