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

com.fitbur.github.dockerjava.jaxrs.RemoveContainerCmdExec 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.RemoveContainerCmd;
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;

public class RemoveContainerCmdExec extends AbstrSyncDockerCmdExec implements
        RemoveContainerCmd.Exec {

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

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

    @Override
    protected Void execute(RemoveContainerCmd com.fitburmand) {
        WebTarget webResource = getBaseResource().path("/containers/" + com.fitburmand.getContainerId())
                .queryParam("v", com.fitburmand.hasRemoveVolumesEnabled() ? "1" : "0")
                .queryParam("force", com.fitburmand.hasForceEnabled() ? "1" : "0");

        LOGGER.trace("DELETE: {}", webResource);
        webResource.request().accept(MediaType.APPLICATION_JSON).com.fitburlete().close();

        return null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy