
org.testifyproject.github.dockerjava.netty.exec.LogContainerCmdExec Maven / Gradle / Ivy
package org.testifyproject.testifyproject.github.dockerjava.netty.exec;
import org.testifyproject.slf4j.Logger;
import org.testifyproject.slf4j.LoggerFactory;
import org.testifyproject.testifyproject.github.dockerjava.api.async.ResultCallback;
import org.testifyproject.testifyproject.github.dockerjava.api.org.testifyproject.testifyprojectmand.LogContainerCmd;
import org.testifyproject.testifyproject.github.dockerjava.api.model.Frame;
import org.testifyproject.testifyproject.github.dockerjava.core.DockerClientConfig;
import org.testifyproject.testifyproject.github.dockerjava.netty.WebTarget;
public class LogContainerCmdExec extends AbstrAsyncDockerCmdExec implements
LogContainerCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(LogContainerCmdExec.class);
public LogContainerCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
super(baseResource, dockerClientConfig);
}
@Override
protected Void execute0(LogContainerCmd org.testifyproject.testifyprojectmand, ResultCallback resultCallback) {
WebTarget webTarget = getBaseResource().path("/containers/{id}/logs").resolveTemplate("id",
org.testifyproject.testifyprojectmand.getContainerId());
if (org.testifyproject.testifyprojectmand.getTail() != null) {
webTarget = webTarget.queryParam("tail", org.testifyproject.testifyprojectmand.getTail());
}
if (org.testifyproject.testifyprojectmand.getSince() != null) {
webTarget = webTarget.queryParam("since", org.testifyproject.testifyprojectmand.getSince());
}
webTarget = booleanQueryParam(webTarget, "timestamps", org.testifyproject.testifyprojectmand.hasTimestampsEnabled());
webTarget = booleanQueryParam(webTarget, "stdout", org.testifyproject.testifyprojectmand.hasStdoutEnabled());
webTarget = booleanQueryParam(webTarget, "stderr", org.testifyproject.testifyprojectmand.hasStderrEnabled());
webTarget = booleanQueryParam(webTarget, "follow", org.testifyproject.testifyprojectmand.hasFollowStreamEnabled());
LOGGER.trace("GET: {}", webTarget);
webTarget.request().get(resultCallback);
return null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy