http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Container.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Container.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Container.java deleted file mode 100644 index 8f0129e..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Container.java +++ /dev/null @@ -1,372 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import static com.google.common.base.Preconditions.checkNotNull; -import java.beans.ConstructorProperties; -import java.util.List; -import java.util.Map; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.gson.annotations.SerializedName; - -/** - * @author Andrea Turli - */ -public class Container { - - @SerializedName("Id") - private final String id; - @SerializedName("Name") - private final String name; - @SerializedName("Created") - private final String created; - @SerializedName("Path") - private final String path; - @SerializedName("Args") - private final String[] args; - @SerializedName("Config") - private final Config config; - @SerializedName("State") - private final State state; - @SerializedName("Image") - private final String image; - @SerializedName("NetworkSettings") - private final NetworkSettings networkSettings; - @SerializedName("ResolvConfPath") - private final String resolvConfPath; - @SerializedName("Driver") - private final String driver; - @SerializedName("ExecDriver") - private final String execDriver; - @SerializedName("Volumes") - private final Map<String, String> volumes; - @SerializedName("VolumesRW") - private final Map<String, Boolean> volumesRw; - @SerializedName("Command") - private final String command; - @SerializedName("Status") - private final String status; - @SerializedName("HostConfig") - private final HostConfig hostConfig; - @SerializedName("Ports") - private final List<Port> ports; - - @ConstructorProperties({ "Id", "Name", "Created", "Path", "Args", "Config", "State", "Image", "NetworkSettings", - "ResolvConfPath", "Driver", "ExecDriver", "Volumes", "VolumesRW", "Command", "Status", "HostConfig", "Ports" }) - public Container(String id, String name, String created, String path, String[] args, Config config, State state, - String image, NetworkSettings networkSettings, String resolvConfPath, - String driver, String execDriver, Map<String, String> volumes, Map<String, Boolean> volumesRW, - String command, String status, HostConfig hostConfig, List<Port> ports) { - this.id = checkNotNull(id, "id"); - this.name = checkNotNull(name, "name"); - this.created = checkNotNull(created, "created"); - this.path = checkNotNull(path, "path"); - this.args = checkNotNull(args, "args"); - this.config = checkNotNull(config, "config"); - this.state = checkNotNull(state, "state"); - this.image = checkNotNull(image, "image"); - this.networkSettings = checkNotNull(networkSettings, "networkSettings"); - this.resolvConfPath = checkNotNull(resolvConfPath, "resolvConfPath"); - this.driver = checkNotNull(driver, "driver"); - this.execDriver = checkNotNull(execDriver, "execDriver"); - this.volumes = checkNotNull(volumes, "volumes"); - this.volumesRw = checkNotNull(volumesRW, "volumesRW"); - this.command = checkNotNull(command, "command"); - this.status = checkNotNull(status, "status"); - this.hostConfig = checkNotNull(hostConfig, "hostConfig"); - this.ports = checkNotNull(ports, "ports"); - } - - public String getId() { - return id; - } - - public String getName() { - return name; - } - - public String getCreated() { - return created; - } - - public String getPath() { - return path; - } - - public String[] getArgs() { - return args; - } - - public Config getConfig() { - return config; - } - - public State getState() { - return state; - } - - public String getImage() { - return image; - } - - public NetworkSettings getNetworkSettings() { - return networkSettings; - } - - public String getResolvConfPath() { - return resolvConfPath; - } - - public String getDriver() { - return driver; - } - - public String getExecDriver() { - return execDriver; - } - - public Map<String, String> getVolumes() { - return volumes; - } - - public Map<String, Boolean> getVolumesRw() { - return volumesRw; - } - - public String getCommand() { - return command; - } - - public String getStatus() { - return status; - } - - public HostConfig getHostConfig() { - return hostConfig; - } - - public List<Port> getPorts() { - return ports; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Container that = (Container) o; - - return Objects.equal(this.id, that.id) && - Objects.equal(this.name, that.name) && - Objects.equal(this.created, that.created) && - Objects.equal(this.path, that.path) && - Objects.equal(this.args, that.args) && - Objects.equal(this.config, that.config) && - Objects.equal(this.state, that.state) && - Objects.equal(this.image, that.image) && - Objects.equal(this.networkSettings, that.networkSettings) && - Objects.equal(this.resolvConfPath, that.resolvConfPath) && - Objects.equal(this.driver, that.driver) && - Objects.equal(this.execDriver, that.execDriver) && - Objects.equal(this.volumes, that.volumes) && - Objects.equal(this.volumesRw, that.volumesRw) && - Objects.equal(this.command, that.command) && - Objects.equal(this.status, that.status) && - Objects.equal(this.hostConfig, that.hostConfig) && - Objects.equal(this.ports, that.ports); - } - - @Override - public int hashCode() { - return Objects.hashCode(id, name, created, path, args, config, state, image, networkSettings, resolvConfPath, - driver, execDriver, volumes, volumesRw, command, status, hostConfig, ports); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("id", id) - .add("name", name) - .add("created", created) - .add("path", path) - .add("args", args) - .add("config", config) - .add("state", state) - .add("image", image) - .add("networkSettings", networkSettings) - .add("resolvConfPath", resolvConfPath) - .add("driver", driver) - .add("execDriver", execDriver) - .add("volumes", volumes) - .add("volumesRw", volumesRw) - .add("command", command) - .add("status", status) - .add("hostConfig", hostConfig) - .add("ports", ports) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromContainer(this); - } - - public static final class Builder { - - private String id; - private String name; - private String created; - private String path; - private String[] args; - private Config config; - private State state; - private String image; - private NetworkSettings networkSettings; - private String resolvConfPath; - private String driver; - private String execDriver; - private Map<String, String> volumes = ImmutableMap.of(); - private Map<String, Boolean> volumesRw = ImmutableMap.of(); - private String command; - private String status; - private HostConfig hostConfig; - private List<Port> ports = ImmutableList.of(); - - public Builder id(String id) { - this.id = id; - return this; - } - - public Builder name(String name) { - this.name = name; - return this; - } - - public Builder created(String created) { - this.created = created; - return this; - } - - public Builder path(String path) { - this.path = path; - return this; - } - - public Builder args(String[] args) { - this.args = args; - return this; - } - - public Builder config(Config config) { - this.config = config; - return this; - } - - public Builder state(State state) { - this.state = state; - return this; - } - - public Builder image(String imageName) { - this.image = imageName; - return this; - } - - public Builder networkSettings(NetworkSettings networkSettings) { - this.networkSettings = networkSettings; - return this; - } - - public Builder resolvConfPath(String resolvConfPath) { - this.resolvConfPath = resolvConfPath; - return this; - } - - public Builder driver(String driver) { - this.driver = driver; - return this; - } - - public Builder execDriver(String execDriver) { - this.execDriver = execDriver; - return this; - } - - public Builder volumes(Map<String, String> volumes) { - this.volumes = volumes; - return this; - } - - public Builder volumesRw(Map<String, Boolean> volumesRw) { - this.volumesRw = volumesRw; - return this; - } - - public Builder command(String command) { - this.command = command; - return this; - } - - public Builder status(String status) { - this.status = status; - return this; - } - - public Builder hostConfig(HostConfig hostConfig) { - this.hostConfig = hostConfig; - return this; - } - - public Builder ports(List<Port> ports) { - this.ports = ports; - return this; - } - - public Container build() { - return new Container(id, name, created, path, args, config, state, image, networkSettings, resolvConfPath, - driver, execDriver, volumes, volumesRw, command, status, hostConfig, ports); - } - - public Builder fromContainer(Container in) { - return this - .id(in.getId()) - .name(in.getName()) - .created(in.getCreated()) - .path(in.getPath()) - .args(in.getArgs()) - .config(in.getConfig()) - .state(in.getState()) - .image(in.getImage()) - .networkSettings(in.getNetworkSettings()) - .resolvConfPath(in.getResolvConfPath()) - .driver(in.getDriver()) - .execDriver(in.getExecDriver()) - .volumes(in.getVolumes()) - .volumesRw(in.getVolumesRw()) - .command(in.getCommand()) - .status(in.getStatus()) - .hostConfig(in.getHostConfig()) - .ports(in.getPorts()); - } - } -}
http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/ExposedPorts.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/ExposedPorts.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/ExposedPorts.java deleted file mode 100644 index 146c38b..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/ExposedPorts.java +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableSet; - -import java.beans.ConstructorProperties; -import java.util.Set; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * @author Andrea Turli - */ -public class ExposedPorts { - - private final String portAndProtocol; - private final Set<String> hostPorts; - - @ConstructorProperties({ "PortAndProtocol", "HostPorts" }) - public ExposedPorts(String portAndProtocol, Set<String> hostPorts) { - this.portAndProtocol = checkNotNull(portAndProtocol, "portAndProtocol"); - this.hostPorts = hostPorts != null ? ImmutableSet.copyOf(hostPorts) : ImmutableSet.<String> of(); - } - - public String getPortAndProtocol() { - return portAndProtocol; - } - - public Set<String> getHostPorts() { - return hostPorts; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - ExposedPorts that = (ExposedPorts) o; - - return Objects.equal(this.portAndProtocol, that.portAndProtocol) && - Objects.equal(this.hostPorts, that.hostPorts); - } - - @Override - public int hashCode() { - return Objects.hashCode(portAndProtocol, hostPorts); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("portAndProtocol", portAndProtocol) - .add("hostPorts", hostPorts) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromExposedPorts(this); - } - - public static final class Builder { - - private String portAndProtocol; - private Set<String> hostPorts = ImmutableSet.of(); - - public Builder portAndProtocol(String portAndProtocol) { - this.portAndProtocol = portAndProtocol; - return this; - } - - public Builder hostPorts(Set<String> hostPorts) { - this.hostPorts = ImmutableSet.copyOf(checkNotNull(hostPorts, "hostPorts")); - return this; - } - - public ExposedPorts build() { - return new ExposedPorts(portAndProtocol, hostPorts); - } - - public Builder fromExposedPorts(ExposedPorts in) { - return this.portAndProtocol(in.getPortAndProtocol()) - .hostPorts(in.getHostPorts()); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/HostConfig.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/HostConfig.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/HostConfig.java deleted file mode 100644 index 10ae1c1..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/HostConfig.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; -import com.google.gson.annotations.SerializedName; -import org.jclouds.javax.annotation.Nullable; - -import java.beans.ConstructorProperties; -import java.util.List; -import java.util.Map; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * @author Andrea Turli - */ -public class HostConfig { - - @SerializedName("ContainerIDFile") - private final String containerIDFile; - @SerializedName("Binds") - private final List<String> binds; - @SerializedName("Privileged") - private final boolean privileged; - @SerializedName("PortBindings") - private final Map<String, List<Map<String, String>>> portBindings; - @SerializedName("Links") - private final List<String> links; - @SerializedName("PublishAllPorts") - private final boolean publishAllPorts; - - @ConstructorProperties({ "ContainerIDFile", "Binds", "Privileged", "PortBindings", "Links", "Size", - "PublishAllPorts" }) - public HostConfig(@Nullable String containerIDFile, @Nullable List<String> binds, @Nullable boolean privileged, - @Nullable Map<String, List<Map<String, String>>> portBindings, @Nullable List<String> links, - @Nullable boolean publishAllPorts) { - this.containerIDFile = containerIDFile; - this.binds = binds != null ? ImmutableList.copyOf(binds) : ImmutableList.<String> of(); - this.privileged = privileged; - this.portBindings = portBindings != null ? ImmutableMap.copyOf(portBindings) : ImmutableMap.<String, List<Map<String, String>>> of(); - this.links = links != null ? ImmutableList.copyOf(links) : ImmutableList.<String> of(); - this.publishAllPorts = publishAllPorts; - } - - public String getContainerIDFile() { - return containerIDFile; - } - - public List<String> getBinds() { - return binds; - } - - public boolean isPrivileged() { - return privileged; - } - - public Map<String, List<Map<String, String>>> getPortBindings() { - return portBindings; - } - - @Nullable - public List<String> getLinks() { - return links; - } - - public boolean isPublishAllPorts() { - return publishAllPorts; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - HostConfig that = (HostConfig) o; - - return Objects.equal(this.containerIDFile, that.containerIDFile) && - Objects.equal(this.binds, that.binds) && - Objects.equal(this.privileged, that.privileged) && - Objects.equal(this.portBindings, that.portBindings) && - Objects.equal(this.links, that.links) && - Objects.equal(this.publishAllPorts, that.publishAllPorts); - } - - @Override - public int hashCode() { - return Objects.hashCode(containerIDFile, binds, privileged, portBindings, links, publishAllPorts); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("containerIDFile", containerIDFile) - .add("binds", binds) - .add("privileged", privileged) - .add("portBindings", portBindings) - .add("links", links) - .add("publishAllPorts", publishAllPorts) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromHostConfig(this); - } - - public static final class Builder { - - private String containerIDFile; - private List<String> binds = ImmutableList.of(); - private boolean privileged; - private Map<String, List<Map<String, String>>> portBindings = ImmutableMap.of(); - private List<String> links = ImmutableList.of(); - private boolean publishAllPorts; - - public Builder containerIDFile(String containerIDFile) { - this.containerIDFile = containerIDFile; - return this; - } - - public Builder binds(List<String> binds) { - this.binds = ImmutableList.copyOf(checkNotNull(binds, "binds")); - return this; - } - - public Builder privileged(boolean privileged) { - this.privileged = privileged; - return this; - } - - public Builder links(List<String> links) { - this.links = ImmutableList.copyOf(checkNotNull(links, "links")); - return this; - } - - public Builder portBindings(Map<String, List<Map<String, String>>> portBindings) { - this.portBindings = ImmutableMap.copyOf(portBindings); - return this; - } - - public Builder publishAllPorts(boolean publishAllPorts) { - this.publishAllPorts = publishAllPorts; - return this; - } - - public HostConfig build() { - return new HostConfig(containerIDFile, binds, privileged, portBindings, links, publishAllPorts); - } - - public Builder fromHostConfig(HostConfig in) { - return this - .containerIDFile(in.getContainerIDFile()) - .binds(in.getBinds()) - .privileged(in.isPrivileged()) - .links(in.getLinks()) - .portBindings(in.getPortBindings()) - .publishAllPorts(in.isPublishAllPorts()); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Image.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Image.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Image.java deleted file mode 100644 index aa811f3..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Image.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableList; -import com.google.gson.annotations.SerializedName; -import org.jclouds.javax.annotation.Nullable; - -import java.beans.ConstructorProperties; -import java.util.List; - -import static com.google.common.base.Preconditions.checkNotNull; - -public class Image { - - @SerializedName("id") - private final String id; - @SerializedName("parent") - private final String parent; - @SerializedName("Created") - private final String created; - @SerializedName("container") - private final String container; - @SerializedName("docker_version") - private final String dockerVersion; - @SerializedName("architecture") - private final String architecture; - @SerializedName("os") - private final String os; - @SerializedName("Size") - private final long size; - @SerializedName("VirtualSize") - private final long virtualSize; - @SerializedName("RepoTags") - private final List<String> repoTags; - - @ConstructorProperties({ "id", "parent", "created", "container", "docker_version", "architecture", "os", "Size", - "VirtualSize", "RepoTags" }) - public Image(String id, @Nullable String parent, @Nullable String created, @Nullable String container, - @Nullable String dockerVersion, @Nullable String architecture, @Nullable String os, long size, - @Nullable long virtualSize, @Nullable List<String> repoTags) { - this.id = checkNotNull(id, "id"); - this.parent = parent; - this.created = created; - this.container = container; - this.dockerVersion = dockerVersion; - this.architecture = architecture; - this.os = os; - this.size = size; - this.virtualSize = virtualSize; - this.repoTags = repoTags != null ? ImmutableList.copyOf(repoTags) : ImmutableList.<String> of(); - } - - public String getId() { - return id; - } - - public String getParent() { - return parent; - } - - public String getCreated() { - return created; - } - - public String getContainer() { - return container; - } - - public String getDockerVersion() { - return dockerVersion; - } - - public String getArchitecture() { - return architecture; - } - - public String getOs() { - return os; - } - - public long getSize() { - return size; - } - - public long getVirtualSize() { - return virtualSize; - } - - public List<String> getRepoTags() { - return repoTags; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Image that = (Image) o; - - return Objects.equal(this.id, that.id) && - Objects.equal(this.parent, that.parent) && - Objects.equal(this.created, that.created) && - Objects.equal(this.container, that.container) && - Objects.equal(this.dockerVersion, that.dockerVersion) && - Objects.equal(this.architecture, that.architecture) && - Objects.equal(this.os, that.os) && - Objects.equal(this.size, that.size) && - Objects.equal(this.virtualSize, that.virtualSize); - } - - @Override - public int hashCode() { - return Objects.hashCode(id, parent, created, container, dockerVersion, architecture, os, size, - virtualSize); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("id", id) - .add("parent", parent) - .add("created", created) - .add("container", container) - .add("dockerVersion", dockerVersion) - .add("architecture", architecture) - .add("os", os) - .add("size", size) - .add("virtualSize", virtualSize) - .add("repoTags", repoTags) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromImage(this); - } - - public static final class Builder { - - private String id; - private String parent; - private String created; - private String container; - private Config containerConfig; - private String dockerVersion; - private String architecture; - private String os; - private long size; - private long virtualSize; - private List<String> repoTags = ImmutableList.of(); - - public Builder id(String id) { - this.id = id; - return this; - } - - public Builder parent(String parent) { - this.parent = parent; - return this; - } - - public Builder created(String created) { - this.created = created; - return this; - } - - public Builder container(String container) { - this.container = container; - return this; - } - - public Builder dockerVersion(String dockerVersion) { - this.dockerVersion = dockerVersion; - return this; - } - - public Builder architecture(String architecture) { - this.architecture = architecture; - return this; - } - - public Builder os(String os) { - this.os = os; - return this; - } - - public Builder size(long size) { - this.size = size; - return this; - } - - public Builder virtualSize(long virtualSize) { - this.virtualSize = virtualSize; - return this; - } - - public Builder repoTags(List<String> repoTags) { - this.repoTags = ImmutableList.copyOf(checkNotNull(repoTags, "repoTags")); - return this; - } - - public Image build() { - return new Image(id, parent, created, container, dockerVersion, architecture, os, size, - virtualSize, repoTags); - } - - public Builder fromImage(Image in) { - return this - .id(in.getId()) - .parent(in.getParent()) - .created(in.getCreated()) - .container(in.getContainer()) - .dockerVersion(in.getDockerVersion()) - .architecture(in.getArchitecture()) - .os(in.getOs()) - .size(in.getSize()) - .virtualSize(in.getVirtualSize()); - //DO NOT add .repoTags(in.getRepoTags()); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/NetworkSettings.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/NetworkSettings.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/NetworkSettings.java deleted file mode 100644 index d700c77..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/NetworkSettings.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import static com.google.common.base.Preconditions.checkNotNull; -import java.beans.ConstructorProperties; -import java.util.List; -import java.util.Map; - -import com.google.common.base.Objects; -import com.google.common.collect.ImmutableMap; -import com.google.gson.annotations.SerializedName; - -/** - * @author Andrea Turli - */ -public class NetworkSettings { - - @SerializedName("IPAddress") - private final String ipAddress; - @SerializedName("IPPrefixLen") - private final int ipPrefixLen; - @SerializedName("Gateway") - private final String gateway; - @SerializedName("Bridge") - private final String bridge; - @SerializedName("PortMapping") - private final String portMapping; - @SerializedName("Ports") - private final Map<String, List<Map<String, String>>> ports; - - @ConstructorProperties({ "IpAddress", "IpPrefixLen", "Gateway", "Bridge", "Ports" }) - public NetworkSettings(String ipAddress, int ipPrefixLen, String gateway, String bridge, String portMapping, - Map<String, List<Map<String, String>>> ports) { - this.ipAddress = ipAddress; - this.ipPrefixLen = ipPrefixLen; - this.gateway = gateway; - this.bridge = bridge; - this.portMapping = portMapping; - this.ports = ports != null ? ImmutableMap.copyOf(ports) : ImmutableMap.<String, List<Map<String, String>>> of(); - } - - public String getIpAddress() { - return ipAddress; - } - - public int getIpPrefixLen() { - return ipPrefixLen; - } - - public String getGateway() { - return gateway; - } - - public String getBridge() { - return bridge; - } - - public String getPortMapping() { - return portMapping; - } - - public Map<String, List<Map<String, String>>> getPorts() { - return ports; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - NetworkSettings that = (NetworkSettings) o; - - return Objects.equal(this.ipAddress, that.ipAddress) && - Objects.equal(this.ipPrefixLen, that.ipPrefixLen) && - Objects.equal(this.gateway, that.gateway) && - Objects.equal(this.bridge, that.bridge) && - Objects.equal(this.portMapping, that.portMapping) && - Objects.equal(this.ports, that.ports); - } - - @Override - public int hashCode() { - return Objects.hashCode(ipAddress, ipPrefixLen, gateway, bridge, portMapping, ports); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("ipAddress", ipAddress) - .add("ipPrefixLen", ipPrefixLen) - .add("gateway", gateway) - .add("bridge", bridge) - .add("portMapping", portMapping) - .add("ports", ports) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromNetworkSettings(this); - } - - public static final class Builder { - - private String ipAddress; - private int ipPrefixLen; - private String gateway; - private String bridge; - private String portMapping; - private Map<String, List<Map<String, String>>> ports = ImmutableMap.of(); - - public Builder ipAddress(String ipAddress) { - this.ipAddress = ipAddress; - return this; - } - - public Builder ipPrefixLen(int ipPrefixLen) { - this.ipPrefixLen = ipPrefixLen; - return this; - } - - public Builder gateway(String gateway) { - this.gateway = gateway; - return this; - } - - public Builder bridge(String bridge) { - this.bridge = bridge; - return this; - } - - public Builder portMapping(String portMapping) { - this.portMapping = portMapping; - return this; - } - - public Builder ports(Map<String, List<Map<String, String>>> ports) { - this.ports = ImmutableMap.copyOf(checkNotNull(ports, "ports")); - return this; - } - - public NetworkSettings build() { - return new NetworkSettings(ipAddress, ipPrefixLen, gateway, bridge, portMapping, ports); - } - - public Builder fromNetworkSettings(NetworkSettings in) { - return this - .ipAddress(in.getIpAddress()) - .ipPrefixLen(in.getIpPrefixLen()) - .gateway(in.getGateway()) - .bridge(in.getBridge()) - .portMapping(in.getPortMapping()) - .ports(in.getPorts()); - } - - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Port.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Port.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Port.java deleted file mode 100644 index e5aad02..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Port.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import com.google.common.base.Objects; -import com.google.gson.annotations.SerializedName; - -import java.beans.ConstructorProperties; - -import static com.google.common.base.Preconditions.checkNotNull; - -/** - * @author Andrea Turli - */ -public class Port { - - @SerializedName("PrivatePort") - private final int privatePort; - @SerializedName("PublicPort") - private final int publicPort; - @SerializedName("Type") - private final String type; - @SerializedName("IP") - private final String ip; - - @ConstructorProperties({ "PrivatePort", "PublicPort", "Type", "Ip" }) - public Port(int privatePort, int publicPort, String type, String ip) { - this.privatePort = checkNotNull(privatePort, "privatePort"); - this.publicPort = checkNotNull(publicPort, "publicPort"); - this.type = checkNotNull(type, "type"); - this.ip = checkNotNull(ip, "ip"); - } - - public int getPrivatePort() { - return privatePort; - } - - public int getPublicPort() { - return publicPort; - } - - public String getType() { - return type; - } - - public String getIp() { - return ip; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Port that = (Port) o; - - return Objects.equal(this.privatePort, that.privatePort) && - Objects.equal(this.publicPort, that.publicPort) && - Objects.equal(this.type, that.type) && - Objects.equal(this.ip, that.ip); - } - - @Override - public int hashCode() { - return Objects.hashCode(privatePort, publicPort, type, ip); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("privatePort", privatePort) - .add("publicPort", publicPort) - .add("type", type) - .add("ip", ip) - .toString(); - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/State.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/State.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/State.java deleted file mode 100644 index 7207a86..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/State.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import static com.google.common.base.Preconditions.checkNotNull; -import java.beans.ConstructorProperties; - -import com.google.common.base.Objects; -import com.google.gson.annotations.SerializedName; - -/** - * @author Andrea Turli - */ -public class State { - @SerializedName("Pid") - private final int pid; - @SerializedName("Running") - private final boolean running; - @SerializedName("ExitCode") - private final int exitCode; - @SerializedName("StartedAt") - private final String startedAt; - @SerializedName("FinishedAt") - private final String finishedAt; - @SerializedName("Ghost") - private final boolean ghost; - - @ConstructorProperties({ "Pid", "Running", "ExitCode", "StartedAt", "FinishedAt", "Ghost" }) - public State(int pid, boolean running, int exitCode, String startedAt, String finishedAt, boolean ghost) { - this.pid = checkNotNull(pid, "pid"); - this.running = checkNotNull(running, "running"); - this.exitCode = checkNotNull(exitCode, "exitCode"); - this.startedAt = checkNotNull(startedAt, "startedAt"); - this.finishedAt = checkNotNull(finishedAt, "finishedAt"); - this.ghost = checkNotNull(ghost, "ghost"); - } - - public int getPid() { - return pid; - } - - public boolean isRunning() { - return running; - } - - public int getExitCode() { - return exitCode; - } - - public String getStartedAt() { - return startedAt; - } - - public String getFinishedAt() { - return finishedAt; - } - - public boolean isGhost() { - return ghost; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - State that = (State) o; - - return Objects.equal(this.pid, that.pid) && - Objects.equal(this.running, that.running) && - Objects.equal(this.exitCode, that.exitCode) && - Objects.equal(this.startedAt, that.startedAt) && - Objects.equal(this.finishedAt, that.finishedAt) && - Objects.equal(this.ghost, that.ghost); - } - - @Override - public int hashCode() { - return Objects.hashCode(pid, running, exitCode, startedAt, finishedAt, ghost); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("pid", pid) - .add("running", running) - .add("exitCode", exitCode) - .add("startedAt", startedAt) - .add("finishedAt", finishedAt) - .add("ghost", ghost) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromState(this); - } - - public static final class Builder { - - private int pid; - private boolean running; - private int exitCode; - private String startedAt; - private String finishedAt; - private boolean ghost; - - public Builder pid(int pid) { - this.pid = pid; - return this; - } - - public Builder running(boolean running) { - this.running = running; - return this; - } - - public Builder exitCode(int exitCode) { - this.exitCode = exitCode; - return this; - } - - public Builder startedAt(String startedAt) { - this.startedAt = startedAt; - return this; - } - - public Builder finishedAt(String finishedAt) { - this.finishedAt = finishedAt; - return this; - } - - public Builder ghost(boolean ghost) { - this.ghost = ghost; - return this; - } - - public State build() { - return new State(pid, running, exitCode, startedAt, finishedAt, ghost); - } - - public Builder fromState(State in) { - return this - .pid(in.getPid()) - .running(in.isRunning()) - .exitCode(in.getExitCode()) - .startedAt(in.getStartedAt()) - .finishedAt(in.getFinishedAt()) - .ghost(in.isGhost()); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Version.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Version.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Version.java deleted file mode 100644 index 1b6984e..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/domain/Version.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.domain; - -import static com.google.common.base.Preconditions.checkNotNull; -import java.beans.ConstructorProperties; - -import com.google.common.base.Objects; -import com.google.gson.annotations.SerializedName; - -/** - * @author Andrea Turli - */ -public class Version { - @SerializedName("Arch") - private final String arch; - @SerializedName("GitCommit") - private final String gitCommit; - @SerializedName("GoVersion") - private final String goVersion; - @SerializedName("KernelVersion") - private final String kernelVersion; - @SerializedName("Os") - private final String os; - @SerializedName("Version") - private final String version; - - @ConstructorProperties({ "Arch", "GitCommit", "GoVersion", "KernelVersion", "Os", "Version" }) - public Version(String arch, String gitCommit, String goVersion, String kernelVersion, String os, String version) { - this.arch = checkNotNull(arch, "arch"); - this.gitCommit = checkNotNull(gitCommit, "gitCommit"); - this.goVersion = checkNotNull(goVersion, "goVersion"); - this.kernelVersion = checkNotNull(kernelVersion, "kernelVersion"); - this.os = checkNotNull(os, "os"); - this.version = checkNotNull(version, "version"); - } - - public String getArch() { - return arch; - } - - public String getGitCommit() { - return gitCommit; - } - - public String getGoVersion() { - return goVersion; - } - - public String getKernelVersion() { - return kernelVersion; - } - - public String getOs() { - return os; - } - - public String getVersion() { - return version; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - Version that = (Version) o; - - return Objects.equal(this.arch, that.arch) && - Objects.equal(this.gitCommit, that.gitCommit) && - Objects.equal(this.goVersion, that.goVersion) && - Objects.equal(this.kernelVersion, that.kernelVersion) && - Objects.equal(this.os, that.os) && - Objects.equal(this.version, that.version); - } - - @Override - public int hashCode() { - return Objects.hashCode(arch, gitCommit, goVersion, kernelVersion, os, version); - } - - @Override - public String toString() { - return Objects.toStringHelper(this) - .add("arch", arch) - .add("gitCommit", gitCommit) - .add("goVersion", goVersion) - .add("kernelVersion", kernelVersion) - .add("os", os) - .add("version", version) - .toString(); - } - - public static Builder builder() { - return new Builder(); - } - - public Builder toBuilder() { - return builder().fromVersion(this); - } - - public static final class Builder { - - private String arch; - private String gitCommit; - private String goVersion; - private String kernelVersion; - private String os; - private String version; - - public Builder arch(String arch) { - this.arch = arch; - return this; - } - - public Builder gitCommit(String gitCommit) { - this.gitCommit = gitCommit; - return this; - } - - public Builder goVersion(String goVersion) { - this.goVersion = goVersion; - return this; - } - - public Builder kernelVersion(String kernelVersion) { - this.kernelVersion = kernelVersion; - return this; - } - - public Builder os(String os) { - this.os = os; - return this; - } - - public Builder version(String version) { - this.version = version; - return this; - } - - public Version build() { - return new Version(arch, gitCommit, goVersion, kernelVersion, os, version); - } - - public Builder fromVersion(Version in) { - return this - .arch(in.getArch()) - .gitCommit(in.getGitCommit()) - .goVersion(in.getGoVersion()) - .kernelVersion(in.getKernelVersion()) - .os(in.getOs()) - .version(in.getVersion()); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/handlers/DockerErrorHandler.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/handlers/DockerErrorHandler.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/handlers/DockerErrorHandler.java deleted file mode 100644 index 964a958..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/handlers/DockerErrorHandler.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.handlers; - -import com.google.common.base.Throwables; -import com.google.common.io.Closeables; -import org.jclouds.http.HttpCommand; -import org.jclouds.http.HttpErrorHandler; -import org.jclouds.http.HttpResponse; -import org.jclouds.http.HttpResponseException; -import org.jclouds.logging.Logger; -import org.jclouds.rest.AuthorizationException; -import org.jclouds.rest.ResourceNotFoundException; -import org.jclouds.util.Strings2; - -import javax.annotation.Resource; -import java.io.IOException; - -/** - * This will parse and set an appropriate exception on the command object. - * <p/> - * <p/> - * Errors are returned with an appropriate HTTP status code, an X-Elastic- Error header specifying - * the error type, and a text description in the HTTP body. - * - * @author Andrea Turli - */ -public class DockerErrorHandler implements HttpErrorHandler { - @Resource - protected Logger logger = Logger.NULL; - - public void handleError(HttpCommand command, HttpResponse response) { - // it is important to always read fully and close streams - String message = parseMessage(response); - Exception exception = message != null ? new HttpResponseException(command, response, message) - : new HttpResponseException(command, response); - try { - message = message != null ? message : String.format("%s -> %s", command.getCurrentRequest().getRequestLine(), - response.getStatusLine()); - switch (response.getStatusCode()) { - case 400: - if ((command.getCurrentRequest().getEndpoint().getPath().endsWith("/info")) - || (message != null && message.indexOf("could not be found") != -1)) - exception = new ResourceNotFoundException(message, exception); - else if (message != null && message.indexOf("currently in use") != -1) - exception = new IllegalStateException(message, exception); - else - exception = new IllegalArgumentException(message, exception); - break; - case 401: - exception = new AuthorizationException(message, exception); - break; - case 402: - exception = new IllegalStateException(message, exception); - break; - case 404: - if (!command.getCurrentRequest().getMethod().equals("DELETE")) { - exception = new ResourceNotFoundException(message, exception); - } - break; - case 405: - exception = new IllegalArgumentException(message, exception); - break; - case 409: - exception = new IllegalStateException(message, exception); - break; - } - } finally { - try { - Closeables.close(response.getPayload(), true); - } catch (IOException e) { - // This code will never be reached - throw Throwables.propagate(e); - } - command.setException(exception); - } - } - - public String parseMessage(HttpResponse response) { - if (response.getPayload() == null) - return null; - try { - return Strings2.toString(response.getPayload()); - } catch (IOException e) { - throw Throwables.propagate(e); - } finally { - try { - response.getPayload().getInput().close(); - } catch (IOException e) { - throw Throwables.propagate(e); - } - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/BuildOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/BuildOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/BuildOptions.java deleted file mode 100644 index 8a8bc05..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/BuildOptions.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * Options to customize image builder. - * - * @author Andrea Turli - */ -public class BuildOptions extends BaseHttpRequestOptions { - - public static final BuildOptions NONE = new BuildOptions(); - - public BuildOptions tag(String tag) { - this.queryParameters.put("tag", tag); - return this; - } - - public BuildOptions verbose(Boolean verbose) { - this.queryParameters.put("verbose", verbose.toString()); - return this; - } - - public BuildOptions nocache(Boolean nocache) { - this.queryParameters.put("nocache", nocache.toString()); - return this; - } - - public static class Builder { - - /** - * @see BuildOptions#tag - */ - public static BuildOptions tag(String tag) { - BuildOptions options = new BuildOptions(); - return options.tag(tag); - } - - /** - * @see BuildOptions#verbose(Boolean) - */ - public static BuildOptions verbose(Boolean verbose) { - BuildOptions options = new BuildOptions(); - return options.verbose(verbose); - } - - /** - * @see BuildOptions#nocache(Boolean) - */ - public static BuildOptions nocache(Boolean nocache) { - BuildOptions options = new BuildOptions(); - return options.nocache(nocache); - } - - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CommitOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CommitOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CommitOptions.java deleted file mode 100644 index 7f058d4..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CommitOptions.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * Options to customize image commit. - * - * @author Andrea Turli - */ -public class CommitOptions extends BaseHttpRequestOptions { - - public static final CommitOptions NONE = new CommitOptions(); - - public CommitOptions containerId(String containerId) { - this.queryParameters.put("containerId", containerId); - return this; - } - - public CommitOptions repository(String repository) { - this.queryParameters.put("repository", repository); - return this; - } - - public CommitOptions tag(String tag) { - this.queryParameters.put("tag", tag); - return this; - } - - public CommitOptions message(String message) { - this.queryParameters.put("message", message); - return this; - } - - public CommitOptions author(String author) { - this.queryParameters.put("author", author); - return this; - } - - public CommitOptions run(String run) { - this.queryParameters.put("run", run); - return this; - } - - public static class Builder { - - /** - * @see CommitOptions#containerId - */ - public static CommitOptions containerId(String containerId) { - CommitOptions options = new CommitOptions(); - return options.containerId(containerId); - } - - /** - * @see CommitOptions#repository - */ - public static CommitOptions repository(String repository) { - CommitOptions options = new CommitOptions(); - return options.repository(repository); - } - - /** - * @see CommitOptions#tag - */ - public static CommitOptions tag(String tag) { - CommitOptions options = new CommitOptions(); - return options.tag(tag); - } - - /** - * @see CommitOptions#message - */ - public static CommitOptions message(String message) { - CommitOptions options = new CommitOptions(); - return options.message(message); - } - - /** - * @see CommitOptions#author - */ - public static CommitOptions author(String author) { - CommitOptions options = new CommitOptions(); - return options.author(author); - } - - /** - * @see CommitOptions#run - */ - public static CommitOptions run(String run) { - CommitOptions options = new CommitOptions(); - return options.run(run); - } - - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CreateImageOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CreateImageOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CreateImageOptions.java deleted file mode 100644 index 5ff65af..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/CreateImageOptions.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * Options to customize container creation. - * - * @author Andrea Turli - */ -public class CreateImageOptions extends BaseHttpRequestOptions { - - /* - private final String fromImage; - private final String fromSrc; - private final String repo; - private final String tag; - private final String registry; - - public CreateImageOptions(String fromImage, String fromSrc, String repo, String tag, String registry) { - this.fromImage = fromImage; - this.fromSrc = fromSrc; - this.repo = repo; - this.tag = tag; - this.registry = registry; - - if (fromImage != null) { - queryParameters.put("fromImage", fromImage); - } - if (fromSrc != null) { - queryParameters.put("fromSrc", fromSrc); - } - if (repo != null) { - queryParameters.put("repo", repo); - } - if (tag != null) { - queryParameters.put("tag", tag); - } - if (registry != null) { - queryParameters.put("registry", registry); - } - } - */ - - public static final CreateImageOptions NONE = new CreateImageOptions(); - - public CreateImageOptions fromImage(String fromImage) { - this.queryParameters.put("fromImage", fromImage); - return this; - } - - public CreateImageOptions fromSrc(String fromSrc) { - this.queryParameters.put("fromSrc", fromSrc); - return this; - } - - public CreateImageOptions repo(String repo) { - this.queryParameters.put("repo", repo); - return this; - } - - public CreateImageOptions tag(String tag) { - this.queryParameters.put("tag", tag); - return this; - } - - public CreateImageOptions registry(String registry) { - this.queryParameters.put("registry", registry); - return this; - } - - public static class Builder { - /** - * @see CreateImageOptions#fromImage - */ - public static CreateImageOptions fromImage(String fromImage) { - CreateImageOptions options = new CreateImageOptions(); - return options.fromImage(fromImage); - } - - /** - * @see CreateImageOptions#fromSrc - */ - public static CreateImageOptions fromSrc(String fromSrc) { - CreateImageOptions options = new CreateImageOptions(); - return options.fromSrc(fromSrc); - } - - /** - * @see CreateImageOptions#repo - */ - public static CreateImageOptions repo(String repo) { - CreateImageOptions options = new CreateImageOptions(); - return options.repo(repo); - } - - /** - * @see CreateImageOptions#tag - */ - public static CreateImageOptions tag(String tag) { - CreateImageOptions options = new CreateImageOptions(); - return options.tag(tag); - } - - /** - * @see CreateImageOptions#registry - */ - public static CreateImageOptions registry(String registry) { - CreateImageOptions options = new CreateImageOptions(); - return options.registry(registry); - } - - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/DeleteImageOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/DeleteImageOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/DeleteImageOptions.java deleted file mode 100644 index 767dc7d..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/DeleteImageOptions.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * Options to customize image deletion. - * - * @author Andrea Turli - */ -public class DeleteImageOptions extends BaseHttpRequestOptions { - - public static final DeleteImageOptions NONE = new DeleteImageOptions(); - - public DeleteImageOptions force(Boolean force) { - this.queryParameters.put("force", force.toString()); - return this; - } - - public static class Builder { - - /** - * @see DeleteImageOptions#force - */ - public static DeleteImageOptions force(Boolean force) { - DeleteImageOptions options = new DeleteImageOptions(); - return options.force(force); - } - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListContainerOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListContainerOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListContainerOptions.java deleted file mode 100644 index 6e9f129..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListContainerOptions.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * @author Andrea Turli - */ -public class ListContainerOptions extends BaseHttpRequestOptions { - - public static final ListContainerOptions NONE = new ListContainerOptions(); - - public ListContainerOptions all(Boolean all) { - this.queryParameters.put("all", all.toString()); - return this; - } - - public ListContainerOptions limit(Integer limit) { - this.queryParameters.put("limit", limit.toString()); - return this; - } - - public ListContainerOptions since(Integer since) { - this.queryParameters.put("since", since.toString()); - return this; - } - - public ListContainerOptions before(Integer before) { - this.queryParameters.put("before", before.toString()); - return this; - } - - public ListContainerOptions size(Integer size) { - this.queryParameters.put("size", size.toString()); - return this; - } - - public static class Builder { - - /** - * @see ListContainerOptions#all - */ - public static ListContainerOptions all(Boolean all) { - ListContainerOptions options = new ListContainerOptions(); - return options.all(all); - } - - /** - * @see ListContainerOptions#limit(Integer) - */ - public static ListContainerOptions limit(Integer limit) { - ListContainerOptions options = new ListContainerOptions(); - return options.limit(limit); - } - - /** - * @see ListContainerOptions#since(Integer) - */ - public static ListContainerOptions since(Integer since) { - ListContainerOptions options = new ListContainerOptions(); - return options.since(since); - } - - /** - * @see ListContainerOptions#before(Integer) - */ - public static ListContainerOptions before(Integer before) { - ListContainerOptions options = new ListContainerOptions(); - return options.before(before); - } - - /** - * @see ListContainerOptions#limit(Integer) - */ - public static ListContainerOptions size(Integer size) { - ListContainerOptions options = new ListContainerOptions(); - return options.size(size); - } - - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListImageOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListImageOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListImageOptions.java deleted file mode 100644 index 510fae2..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/ListImageOptions.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * @author Andrea Turli - */ -public class ListImageOptions extends BaseHttpRequestOptions { - - public static final ListImageOptions NONE = new ListImageOptions(); - - public ListImageOptions all(Boolean all) { - this.queryParameters.put("all", all.toString()); - return this; - } - - public static class Builder { - /** - * @see ListImageOptions#all - */ - public static ListImageOptions all(Boolean all) { - ListImageOptions options = new ListImageOptions(); - return options.all(all); - } - } - -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java deleted file mode 100644 index 636b352..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/java/org/jclouds/docker/options/RemoveContainerOptions.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker.options; - -import org.jclouds.http.options.BaseHttpRequestOptions; - -/** - * Options to customize container removal. - * - * @author Andrea Turli - */ -public class RemoveContainerOptions extends BaseHttpRequestOptions { - - public static final RemoveContainerOptions NONE = new RemoveContainerOptions(); - - public RemoveContainerOptions verbose(Boolean verbose) { - this.queryParameters.put("verbose", verbose.toString()); - return this; - } - - public RemoveContainerOptions force(Boolean force) { - this.queryParameters.put("force", force.toString()); - return this; - } - - public static class Builder { - /** - * @see RemoveContainerOptions#verbose - */ - public static RemoveContainerOptions verbose(Boolean verbose) { - RemoveContainerOptions options = new RemoveContainerOptions(); - return options.verbose(verbose); - } - - /** - * @see RemoveContainerOptions#force - */ - public static RemoveContainerOptions force(Boolean force) { - RemoveContainerOptions options = new RemoveContainerOptions(); - return options.force(force); - } - } -} http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata deleted file mode 100644 index ca1a6cb..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/META-INF/services/org.jclouds.apis.ApiMetadata +++ /dev/null @@ -1 +0,0 @@ -org.jclouds.docker.DockerApiMetadata \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/centos/Dockerfile ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/centos/Dockerfile b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/centos/Dockerfile deleted file mode 100644 index 1318715..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/centos/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -FROM centos:6.4 -MAINTAINER Andrea Turli <[email protected]> - -# RUN yum -y groupinstall 'Development Tools' -RUN yum -y install openssh-server openssh-clients - -RUN chkconfig sshd on -RUN service sshd start -RUN echo 'root:password' | chpasswd - -EXPOSE 22 -CMD ["/usr/sbin/sshd", "-D"] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/ubuntu/Dockerfile ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/ubuntu/Dockerfile b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/ubuntu/Dockerfile deleted file mode 100644 index fe21ef4..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/main/resources/ubuntu/Dockerfile +++ /dev/null @@ -1,30 +0,0 @@ -# -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -FROM ubuntu:12.04 -MAINTAINER Andrea Turli <[email protected]> - -RUN apt-get update -RUN apt-get install -y openssh-server - -RUN mkdir /var/run/sshd -RUN /usr/sbin/sshd - -RUN echo 'root:password' | chpasswd - -EXPOSE 22 -CMD ["/usr/sbin/sshd", "-D"] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/stratos/blob/397d9926/dependencies/jclouds/apis/docker/1.7.1-stratos/src/test/java/org/jclouds/docker/DockerApiMetadataTest.java ---------------------------------------------------------------------- diff --git a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/test/java/org/jclouds/docker/DockerApiMetadataTest.java b/dependencies/jclouds/apis/docker/1.7.1-stratos/src/test/java/org/jclouds/docker/DockerApiMetadataTest.java deleted file mode 100644 index a8e325b..0000000 --- a/dependencies/jclouds/apis/docker/1.7.1-stratos/src/test/java/org/jclouds/docker/DockerApiMetadataTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.jclouds.docker; - -import org.jclouds.apis.ApiMetadata; -import org.jclouds.apis.Apis; -import org.jclouds.compute.internal.BaseComputeServiceApiMetadataTest; -import org.testng.annotations.Test; - -import static org.testng.Assert.assertEquals; -import static org.testng.Assert.assertNotNull; -import static org.testng.Assert.assertTrue; - -/** - * Unit tests for the {@link DockerApiMetadata} class. - * - * @author Andrea Turli - */ -@Test(groups = "unit", testName = "AbiquoApiMetadataTest") -public class DockerApiMetadataTest extends BaseComputeServiceApiMetadataTest { - - public DockerApiMetadataTest() { - super(new DockerApiMetadata()); - } - - public void testDockerApiRegistered() { - ApiMetadata api = Apis.withId("docker"); - - assertNotNull(api); - assertTrue(api instanceof DockerApiMetadata); - assertEquals(api.getId(), "docker"); - } - -} -
