org.testifyproject.github.dockerjava.jaxrs.StatsCmdExec Maven / Gradle / Ivy
package org.testifyproject.testifyproject.github.dockerjava.jaxrs;
import javax.ws.rs.client.WebTarget;
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.StatsCmd;
import org.testifyproject.testifyproject.github.dockerjava.api.model.Statistics;
import org.testifyproject.testifyproject.github.dockerjava.core.DockerClientConfig;
import org.testifyproject.testifyproject.github.dockerjava.core.async.JsonStreamProcessor;
import org.testifyproject.testifyproject.github.dockerjava.jaxrs.async.AbstractCallbackNotifier;
import org.testifyproject.testifyproject.github.dockerjava.jaxrs.async.GETCallbackNotifier;
public class StatsCmdExec extends AbstrAsyncDockerCmdExec implements StatsCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(StatsCmdExec.class);
public StatsCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
super(baseResource, dockerClientConfig);
}
@Override
protected AbstractCallbackNotifier callbackNotifier(StatsCmd org.testifyproject.testifyprojectmand,
ResultCallback resultCallback) {
WebTarget webTarget = getBaseResource().path("/containers/{id}/stats").resolveTemplate("id",
org.testifyproject.testifyprojectmand.getContainerId());
LOGGER.trace("GET: {}", webTarget);
return new GETCallbackNotifier(new JsonStreamProcessor(Statistics.class),
resultCallback, webTarget.request());
}
}