forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStatsCmdExec.java
More file actions
35 lines (26 loc) · 1.36 KB
/
Copy pathStatsCmdExec.java
File metadata and controls
35 lines (26 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.github.dockerjava.jaxrs;
import javax.ws.rs.client.WebTarget;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.dockerjava.api.async.ResultCallback;
import com.github.dockerjava.api.command.StatsCmd;
import com.github.dockerjava.api.model.Statistics;
import com.github.dockerjava.core.DockerClientConfig;
import com.github.dockerjava.core.async.JsonStreamProcessor;
import com.github.dockerjava.jaxrs.async.AbstractCallbackNotifier;
import com.github.dockerjava.jaxrs.async.GETCallbackNotifier;
public class StatsCmdExec extends AbstrAsyncDockerCmdExec<StatsCmd, Statistics> implements StatsCmd.Exec {
private static final Logger LOGGER = LoggerFactory.getLogger(StatsCmdExec.class);
public StatsCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
super(baseResource, dockerClientConfig);
}
@Override
protected AbstractCallbackNotifier<Statistics> callbackNotifier(StatsCmd command,
ResultCallback<Statistics> resultCallback) {
WebTarget webTarget = getBaseResource().path("/containers/{id}/stats").resolveTemplate("id",
command.getContainerId());
LOGGER.trace("GET: {}", webTarget);
return new GETCallbackNotifier<Statistics>(new JsonStreamProcessor<Statistics>(Statistics.class),
resultCallback, webTarget.request());
}
}