Skip to content

Commit f12e3f2

Browse files
committed
#168 Execs entrypoint iterable of Exec
1 parent f830059 commit f12e3f2

File tree

6 files changed

+45
-8
lines changed

6 files changed

+45
-8
lines changed

src/main/java/com/amihaiemil/docker/Docker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ Reader events()
8181

8282
/**
8383
* Entry point for the Exec API.
84-
* @return Exec.
84+
* @return Execs.
8585
*/
86-
Exec exec();
86+
Execs execs();
8787

8888
/**
8989
* Entry point for the Swarm API.

src/main/java/com/amihaiemil/docker/Exec.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright (c) 2018-2019, Mihai Emil Andronache
2+
* Copyright (c) 2018-2020, Mihai Emil Andronache
33
* All rights reserved.
44
* Redistribution and use in source and binary forms, with or without
55
* modification, are permitted provided that the following conditions are met:
@@ -26,7 +26,7 @@
2626
package com.amihaiemil.docker;
2727

2828
/**
29-
* Exec API.
29+
* Exec containing the commands to be run within a Container.
3030
* @author Mihai Andronache ([email protected])
3131
* @version $Id$
3232
* @since 0.0.1
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* Copyright (c) 2018-2020, Mihai Emil Andronache
3+
* All rights reserved.
4+
* Redistribution and use in source and binary forms, with or without
5+
* modification, are permitted provided that the following conditions are met:
6+
* 1)Redistributions of source code must retain the above copyright notice,
7+
* this list of conditions and the following disclaimer.
8+
* 2)Redistributions in binary form must reproduce the above copyright notice,
9+
* this list of conditions and the following disclaimer in the documentation
10+
* and/or other materials provided with the distribution.
11+
* 3)Neither the name of docker-java-api nor the names of its
12+
* contributors may be used to endorse or promote products derived from
13+
* this software without specific prior written permission.
14+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
15+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17+
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
18+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
19+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
20+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
21+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
22+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
23+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
24+
* POSSIBILITY OF SUCH DAMAGE.
25+
*/
26+
package com.amihaiemil.docker;
27+
28+
/**
29+
* The Exec API. More about it here:<br>
30+
* https://docs.docker.com/engine/api/v1.40/#tag/Exec
31+
* @author Mihai Andronache ([email protected])
32+
* @version $Id$
33+
* @since 0.0.12
34+
*/
35+
public interface Execs extends Iterable<Exec> {
36+
}

src/main/java/com/amihaiemil/docker/RtDocker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public final Volumes volumes() {
122122
}
123123

124124
@Override
125-
public final Exec exec() {
125+
public final Execs execs() {
126126
throw new UnsupportedOperationException(
127127
"Exec API is not yet implemented. If you can contribute please,"
128128
+ " do it here: https://www.github.com/amihaiemil/docker-java-api"

src/test/java/com/amihaiemil/docker/LocalDockerTestCase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public void returnsNetworks() {
176176
public void unsupportedOperationExec() {
177177
new LocalDocker(
178178
new File("/var/run/docker.sock")
179-
).exec();
179+
).execs();
180180
}
181181

182182
/**

src/test/java/com/amihaiemil/docker/UnixDockerTestCase.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,9 @@ public void returnsNetworks() {
175175
@Test(expected = UnsupportedOperationException.class)
176176
public void unsupportedOperationExec() {
177177
new UnixDocker(
178-
new File("/var/run/docker.sock")
179-
).exec();
178+
new File(
179+
"/var/run/docker.sock")
180+
).execs();
180181
}
181182

182183
/**

0 commit comments

Comments
 (0)