camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject camel git commit: Upgraded to latest docker-java
Date Fri, 06 Feb 2015 14:55:30 GMT
Repository: camel
Updated Branches:
  refs/heads/master f1e91780b -> abda366a2


Upgraded to latest docker-java


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/abda366a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/abda366a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/abda366a

Branch: refs/heads/master
Commit: abda366a27d45cce24cf752b0b0678d6331195f0
Parents: f1e9178
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Fri Feb 6 15:55:42 2015 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Fri Feb 6 15:55:42 2015 +0100

----------------------------------------------------------------------
 .../docker/consumer/DockerEventsConsumer.java   |  6 ++++-
 .../docker/producer/DockerProducer.java         | 26 +++++++++++++++-----
 .../docker/headers/ListImagesCmdHeaderTest.java |  2 +-
 parent/pom.xml                                  |  2 +-
 4 files changed, 27 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/abda366a/components/camel-docker/src/main/java/org/apache/camel/component/docker/consumer/DockerEventsConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/main/java/org/apache/camel/component/docker/consumer/DockerEventsConsumer.java
b/components/camel-docker/src/main/java/org/apache/camel/component/docker/consumer/DockerEventsConsumer.java
index ea255f6..bae90e7 100644
--- a/components/camel-docker/src/main/java/org/apache/camel/component/docker/consumer/DockerEventsConsumer.java
+++ b/components/camel-docker/src/main/java/org/apache/camel/component/docker/consumer/DockerEventsConsumer.java
@@ -22,7 +22,6 @@ import java.util.concurrent.ExecutorService;
 import com.github.dockerjava.api.command.EventCallback;
 import com.github.dockerjava.api.command.EventsCmd;
 import com.github.dockerjava.api.model.Event;
-
 import org.apache.camel.AsyncCallback;
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
@@ -144,4 +143,9 @@ public class DockerEventsConsumer extends DefaultConsumer implements EventCallba
         eventsCmd.exec();
         
     }
+
+    @Override
+    public boolean isReceiving() {
+        return isRunAllowed();
+    }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/abda366a/components/camel-docker/src/main/java/org/apache/camel/component/docker/producer/DockerProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/main/java/org/apache/camel/component/docker/producer/DockerProducer.java
b/components/camel-docker/src/main/java/org/apache/camel/component/docker/producer/DockerProducer.java
index f946de5..9da5df2 100644
--- a/components/camel-docker/src/main/java/org/apache/camel/component/docker/producer/DockerProducer.java
+++ b/components/camel-docker/src/main/java/org/apache/camel/component/docker/producer/DockerProducer.java
@@ -18,6 +18,8 @@ package org.apache.camel.component.docker.producer;
 
 import java.io.File;
 import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
 
 import com.github.dockerjava.api.DockerClient;
 import com.github.dockerjava.api.command.AttachContainerCmd;
@@ -53,6 +55,7 @@ import com.github.dockerjava.api.command.VersionCmd;
 import com.github.dockerjava.api.command.WaitContainerCmd;
 import com.github.dockerjava.api.model.AuthConfig;
 import com.github.dockerjava.api.model.Bind;
+import com.github.dockerjava.api.model.Capability;
 import com.github.dockerjava.api.model.Device;
 import com.github.dockerjava.api.model.ExposedPort;
 import com.github.dockerjava.api.model.ExposedPorts;
@@ -62,7 +65,6 @@ import com.github.dockerjava.api.model.Ports;
 import com.github.dockerjava.api.model.RestartPolicy;
 import com.github.dockerjava.api.model.Volume;
 import com.github.dockerjava.api.model.Volumes;
-
 import org.apache.camel.Exchange;
 import org.apache.camel.Message;
 import org.apache.camel.component.docker.DockerClientFactory;
@@ -299,7 +301,7 @@ public class DockerProducer extends DefaultProducer {
         String filter = DockerHelper.getProperty(DockerConstants.DOCKER_FILTER, configuration,
message, String.class);
         
         if (filter != null) {
-            listImagesCmd.withFilter(filter);
+            listImagesCmd.withFilters(filter);
         }
         
         Boolean showAll = DockerHelper.getProperty(DockerConstants.DOCKER_SHOW_ALL, configuration,
message, Boolean.class);
@@ -837,15 +839,27 @@ public class DockerProducer extends DefaultProducer {
         }
         
         String[] capAdd = DockerHelper.parseDelimitedStringHeader(DockerConstants.DOCKER_CAP_ADD,
message);
-
         if (capAdd != null) {
-            startContainerCmd.withCapAdd(capAdd);
+            List<Capability> caps = new ArrayList<Capability>();
+            for (String s : capAdd) {
+                Capability cap = Capability.valueOf(s);
+                caps.add(cap);
+            }
+            Capability[] array = caps.toArray(new Capability[caps.size()]);
+            startContainerCmd.withCapAdd(array);
         }
         
         String[] capDrop = DockerHelper.parseDelimitedStringHeader(DockerConstants.DOCKER_CAP_DROP,
message);
-
         if (capDrop != null) {
-            startContainerCmd.withCapDrop(capDrop);
+            if (capAdd != null) {
+                List<Capability> caps = new ArrayList<Capability>();
+                for (String s : capDrop) {
+                    Capability cap = Capability.valueOf(s);
+                    caps.add(cap);
+                }
+                Capability[] array = caps.toArray(new Capability[caps.size()]);
+                startContainerCmd.withCapDrop(array);
+            }
         }
         
         return startContainerCmd;

http://git-wip-us.apache.org/repos/asf/camel/blob/abda366a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
----------------------------------------------------------------------
diff --git a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
index 40ec4e1..ad4a03b 100644
--- a/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
+++ b/components/camel-docker/src/test/java/org/apache/camel/component/docker/headers/ListImagesCmdHeaderTest.java
@@ -50,7 +50,7 @@ public class ListImagesCmdHeaderTest extends BaseDockerHeaderTest<ListImagesCmd>
         template.sendBodyAndHeaders("direct:in", "", headers);
         
         Mockito.verify(dockerClient, Mockito.times(1)).listImagesCmd();
-        Mockito.verify(mockObject, Mockito.times(1)).withFilter(Matchers.eq(filter));
+        Mockito.verify(mockObject, Mockito.times(1)).withFilters(Matchers.eq(filter));
         Mockito.verify(mockObject, Mockito.times(1)).withShowAll(Matchers.eq(showAll));
         
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/abda366a/parent/pom.xml
----------------------------------------------------------------------
diff --git a/parent/pom.xml b/parent/pom.xml
index 6ea01f5..58f4ef2 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -129,7 +129,7 @@
     <disruptor-version>3.3.0</disruptor-version>
     <dnsjava-version>2.1.6</dnsjava-version>
     <dnsjava-bundle-version>2.1.6_1</dnsjava-bundle-version>
-    <docker-java-version>0.10.3</docker-java-version>
+    <docker-java-version>0.10.5</docker-java-version>
     <dom4j-bundle-version>1.6.1_5</dom4j-bundle-version>
     <dozer-version>5.5.1</dozer-version>
     <drools-version>6.1.0.Final</drools-version>


Mime
View raw message