All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fitbur.github.dockerjava.jaxrs.ExecCreateCmdExec Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package com.fitbur.github.dockerjava.jaxrs;

import com.fitbur.github.dockerjava.api.com.fitburmand.ExecCreateCmd;
import com.fitbur.github.dockerjava.api.com.fitburmand.ExecCreateCmdResponse;
import com.fitbur.github.dockerjava.core.DockerClientConfig;
import com.fitbur.slf4j.Logger;
import com.fitbur.slf4j.LoggerFactory;

import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.MediaType;

import static javax.ws.rs.client.Entity.entity;

public class ExecCreateCmdExec extends AbstrSyncDockerCmdExec implements
        ExecCreateCmd.Exec {

    private static final Logger LOGGER = LoggerFactory.getLogger(VersionCmdExec.class);

    public ExecCreateCmdExec(WebTarget baseResource, DockerClientConfig dockerClientConfig) {
        super(baseResource, dockerClientConfig);
    }

    @Override
    protected ExecCreateCmdResponse execute(ExecCreateCmd com.fitburmand) {
        WebTarget webResource = getBaseResource().path("/containers/{id}/exec").resolveTemplate("id",
                com.fitburmand.getContainerId());

        LOGGER.trace("POST: {}", webResource);

        return webResource.request().accept(MediaType.APPLICATION_JSON)
                .post(entity(com.fitburmand, MediaType.APPLICATION_JSON), ExecCreateCmdResponse.class);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy