public class AttachContainerCmdImpl extends AbstrDockerCmd<AttachContainerCmd,InputStream> implements AttachContainerCmd
AttachContainerCmd.Exec
execution
Constructor and Description |
---|
AttachContainerCmdImpl(AttachContainerCmd.Exec exec,
String containerId) |
Modifier and Type | Method and Description |
---|---|
InputStream |
exec()
Its the responsibility of the caller to consume and/or close the
InputStream to prevent connection leaks. |
String |
getContainerId() |
boolean |
hasFollowStreamEnabled() |
boolean |
hasLogsEnabled() |
boolean |
hasStderrEnabled() |
boolean |
hasStdoutEnabled() |
boolean |
hasTimestampsEnabled() |
AttachContainerCmd |
withContainerId(String containerId) |
AttachContainerCmd |
withFollowStream()
|
AttachContainerCmd |
withFollowStream(boolean followStream)
Following the stream means the resulting
InputStream returned by AttachContainerCmd.exec() reads infinitely. |
AttachContainerCmd |
withLogs() |
AttachContainerCmd |
withLogs(boolean logs) |
AttachContainerCmd |
withStdErr() |
AttachContainerCmd |
withStdErr(boolean stderr) |
AttachContainerCmd |
withStdOut() |
AttachContainerCmd |
withStdOut(boolean stdout) |
AttachContainerCmd |
withTimestamps(boolean timestamps) |
close
public AttachContainerCmdImpl(AttachContainerCmd.Exec exec, String containerId)
public String getContainerId()
getContainerId
in interface AttachContainerCmd
public boolean hasLogsEnabled()
hasLogsEnabled
in interface AttachContainerCmd
public boolean hasFollowStreamEnabled()
hasFollowStreamEnabled
in interface AttachContainerCmd
public boolean hasTimestampsEnabled()
hasTimestampsEnabled
in interface AttachContainerCmd
public boolean hasStdoutEnabled()
hasStdoutEnabled
in interface AttachContainerCmd
public boolean hasStderrEnabled()
hasStderrEnabled
in interface AttachContainerCmd
public AttachContainerCmd withContainerId(String containerId)
withContainerId
in interface AttachContainerCmd
public AttachContainerCmd withFollowStream()
AttachContainerCmd
withFollowStream
in interface AttachContainerCmd
public AttachContainerCmd withFollowStream(boolean followStream)
AttachContainerCmd
InputStream
returned by AttachContainerCmd.exec()
reads infinitely. So a
InputStream.read()
MAY BLOCK FOREVER as long as no data is streamed from the docker host to
DockerClient
!withFollowStream
in interface AttachContainerCmd
public AttachContainerCmd withTimestamps(boolean timestamps)
withTimestamps
in interface AttachContainerCmd
public AttachContainerCmd withStdOut()
withStdOut
in interface AttachContainerCmd
public AttachContainerCmd withStdOut(boolean stdout)
withStdOut
in interface AttachContainerCmd
public AttachContainerCmd withStdErr()
withStdErr
in interface AttachContainerCmd
public AttachContainerCmd withStdErr(boolean stderr)
withStdErr
in interface AttachContainerCmd
public AttachContainerCmd withLogs(boolean logs)
withLogs
in interface AttachContainerCmd
public AttachContainerCmd withLogs()
withLogs
in interface AttachContainerCmd
public InputStream exec() throws NotFoundException
AttachContainerCmd
InputStream
to prevent connection leaks.exec
in interface AttachContainerCmd
exec
in interface DockerCmd<InputStream>
exec
in class AbstrDockerCmd<AttachContainerCmd,InputStream>
NotFoundException
- No such containerCopyright © 2015. All Rights Reserved.