Skip to content

Commit 7a6ef52

Browse files
committed
Merge branch 'master' into master-vuminhkh
* master: (21 commits) Update CHANGELOG.md Format sources Update CHANGELOG.md Update CHANGELOG.md Added missing withXXX(List list) methods Update README.md Bump to version 3.0.0-SNAPSHOT according to semver Update CHANGELOG.md Added override for bulk-read variant of InputStream.read() in anonymous inner class created by Dockerfile.ScannedResult.buildDockerFolderTar(). This fixes an IO performance issue that occurs when only the single-byte variant of the read() method on InputStream is overriden. Added @checkfornull annotation Update README.md Update CHANGELOG.md [maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare release docker-java-2.1.2 Fix issue #348 Small doc fixes Removed import Added additional withX(List<Y> x) methods Added null check annotations and removed withX() methods WIP ... Conflicts: src/main/java/com/github/dockerjava/core/command/CopyFileFromContainerCmdImpl.java
2 parents 28c6f94 + be5c1c3 commit 7a6ef52

File tree

147 files changed

+1609
-1266
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+1609
-1266
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
Change Log
22
===
3-
Latest SNAPSHOT version
3+
Latest SNAPSHOT (3.0.0-SNAPSHOT)
4+
---
5+
Notes
6+
7+
* The upcoming release will contain multiple API breaking changes therefore the major version switch
8+
9+
All changes
10+
11+
* [#359] (https://github.com/docker-java/docker-java/pull/359) Fix performance issue of build command by adding bulk-read variant of InputStream.read()
12+
* [#357] (https://github.com/docker-java/docker-java/pull/357) Wait container command needs possibility to abort operation
13+
* [#313] (https://github.com/docker-java/docker-java/pull/313) Refactor primitive type fields to be of object type in JSON objects
14+
15+
v2.1.2
416
---
517
* [#350] (https://github.com/docker-java/docker-java/pull/350) Remove ServiceLoader logic
618
* [#344] (https://github.com/docker-java/docker-java/pull/344) Implement equals/hashCode for Filters

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ listening on TCP port. To allow Docker server to use TCP add the following line
3636

3737
DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"
3838

39-
However you can force docker-java to use UNIX socket communication by configure the following url:
39+
However you can force docker-java to use UNIX socket communication by configuring the following url:
4040

4141
unix:///var/run/docker.sock
4242

43-
More details setting up Docker server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/
43+
More details about setting up Docker server can be found in official documentation: http://docs.docker.io/en/latest/use/basics/
4444

4545
Now make sure that docker is up:
4646

@@ -64,7 +64,7 @@ Run build without integration tests:
6464
<dependency>
6565
<groupId>com.github.docker-java</groupId>
6666
<artifactId>docker-java</artifactId>
67-
<version>2.1.1</version>
67+
<version>2.1.2</version>
6868
</dependency>
6969

7070
### Latest SNAPSHOT version
@@ -74,7 +74,7 @@ You can find the latest SNAPSHOT version including javadoc and source files on [
7474
<dependency>
7575
<groupId>com.github.docker-java</groupId>
7676
<artifactId>docker-java</artifactId>
77-
<version>2.1.2-SNAPSHOT</version>
77+
<version>3.0.0-SNAPSHOT</version>
7878
</dependency>
7979

8080
## Documentation

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<groupId>com.github.docker-java</groupId>
1111
<artifactId>docker-java</artifactId>
1212
<packaging>jar</packaging>
13-
<version>2.1.2-SNAPSHOT</version>
13+
<version>3.0.0-SNAPSHOT</version>
1414

1515
<name>docker-java</name>
1616
<url>https://github.com/docker-java/docker-java</url>

src/main/java/com/github/dockerjava/api/async/ResultCallback.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,4 @@ public interface ResultCallback<A_RES_T> extends Closeable {
2020

2121
/** Called when processing was finished either by reaching the end or by aborting it */
2222
void onComplete();
23-
2423
}

src/main/java/com/github/dockerjava/api/command/AttachContainerCmd.java

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import java.io.InputStream;
44

5+
import javax.annotation.CheckForNull;
6+
import javax.annotation.Nonnull;
7+
58
import com.github.dockerjava.api.DockerClient;
69
import com.github.dockerjava.api.model.Frame;
710

@@ -22,45 +25,40 @@
2225
*/
2326
public interface AttachContainerCmd extends AsyncDockerCmd<AttachContainerCmd, Frame> {
2427

28+
@CheckForNull
2529
public String getContainerId();
2630

27-
public boolean hasLogsEnabled();
28-
29-
public boolean hasFollowStreamEnabled();
31+
@CheckForNull
32+
public Boolean hasLogsEnabled();
3033

31-
public boolean hasTimestampsEnabled();
34+
@CheckForNull
35+
public Boolean hasFollowStreamEnabled();
3236

33-
public boolean hasStdoutEnabled();
37+
@CheckForNull
38+
public Boolean hasTimestampsEnabled();
3439

35-
public boolean hasStderrEnabled();
40+
@CheckForNull
41+
public Boolean hasStdoutEnabled();
3642

37-
public AttachContainerCmd withContainerId(String containerId);
43+
@CheckForNull
44+
public Boolean hasStderrEnabled();
3845

39-
/**
40-
* See {@link #withFollowStream(boolean)}
41-
*/
42-
public AttachContainerCmd withFollowStream();
46+
public AttachContainerCmd withContainerId(@Nonnull String containerId);
4347

4448
/**
4549
* Following the stream means the resulting {@link InputStream} returned by {@link #exec()} reads infinitely. So a
4650
* {@link InputStream#read()} MAY BLOCK FOREVER as long as no data is streamed from the docker host to
4751
* {@link DockerClient}!
4852
*/
49-
public AttachContainerCmd withFollowStream(boolean followStream);
50-
51-
public AttachContainerCmd withTimestamps(boolean timestamps);
52-
53-
public AttachContainerCmd withStdOut();
54-
55-
public AttachContainerCmd withStdOut(boolean stdout);
53+
public AttachContainerCmd withFollowStream(Boolean followStream);
5654

57-
public AttachContainerCmd withStdErr();
55+
public AttachContainerCmd withTimestamps(Boolean timestamps);
5856

59-
public AttachContainerCmd withStdErr(boolean stderr);
57+
public AttachContainerCmd withStdOut(Boolean stdout);
6058

61-
public AttachContainerCmd withLogs(boolean logs);
59+
public AttachContainerCmd withStdErr(Boolean stderr);
6260

63-
public AttachContainerCmd withLogs();
61+
public AttachContainerCmd withLogs(Boolean logs);
6462

6563
public static interface Exec extends DockerCmdAsyncExec<AttachContainerCmd, Frame> {
6664
}

src/main/java/com/github/dockerjava/api/command/AuthCmd.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
package com.github.dockerjava.api.command;
22

3+
import javax.annotation.CheckForNull;
4+
import javax.annotation.Nonnull;
5+
36
import com.github.dockerjava.api.UnauthorizedException;
47
import com.github.dockerjava.api.model.AuthConfig;
58
import com.github.dockerjava.api.model.AuthResponse;
@@ -11,9 +14,10 @@
1114
*/
1215
public interface AuthCmd extends SyncDockerCmd<AuthResponse> {
1316

17+
@CheckForNull
1418
public AuthConfig getAuthConfig();
1519

16-
public AuthCmd withAuthConfig(AuthConfig authConfig);
20+
public AuthCmd withAuthConfig(@Nonnull AuthConfig authConfig);
1721

1822
/**
1923
* @return The status. Based on it's value you may mean you need to authorise your account, e.g.:

src/main/java/com/github/dockerjava/api/command/BuildImageCmd.java

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.github.dockerjava.api.model.BuildResponseItem;
55

66
import javax.annotation.CheckForNull;
7+
import javax.annotation.Nonnull;
8+
79
import java.io.File;
810
import java.io.InputStream;
911
import java.net.URI;
@@ -20,8 +22,10 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
2022

2123
// lib specific
2224

25+
@CheckForNull
2326
public InputStream getTarInputStream();
2427

28+
@CheckForNull
2529
public AuthConfigurations getBuildAuthConfigs();
2630

2731
// getters
@@ -41,30 +45,32 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
4145
/**
4246
* "nocache" in API
4347
*/
44-
public boolean hasNoCacheEnabled();
48+
@CheckForNull
49+
public Boolean hasNoCacheEnabled();
4550

4651
/**
4752
* "rm" in API
4853
*/
49-
public boolean hasRemoveEnabled();
54+
@CheckForNull
55+
public Boolean hasRemoveEnabled();
5056

5157
/**
5258
* "forcerm" in API
5359
*/
54-
public boolean isForcerm();
55-
5660
@CheckForNull
57-
public Boolean getForcerm();
61+
public Boolean isForcerm();
5862

5963
/**
6064
* "q" in API
6165
*/
62-
public boolean isQuiet();
66+
@CheckForNull
67+
public Boolean isQuiet();
6368

6469
/**
6570
* "pull" in API
6671
*/
67-
public boolean hasPullEnabled();
72+
@CheckForNull
73+
public Boolean hasPullEnabled();
6874

6975
@CheckForNull
7076
public String getPathToDockerfile();
@@ -91,29 +97,19 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
9197

9298
public BuildImageCmd withDockerfile(File dockerfile);
9399

94-
public BuildImageCmd withNoCache();
95-
96-
public BuildImageCmd withNoCache(boolean noCache);
97-
98-
public BuildImageCmd withRemove();
100+
public BuildImageCmd withNoCache(Boolean noCache);
99101

100-
public BuildImageCmd withRemove(boolean rm);
101-
102-
public BuildImageCmd withForcerm();
102+
public BuildImageCmd withRemove(Boolean rm);
103103

104104
public BuildImageCmd withForcerm(Boolean forcerm);
105105

106-
public BuildImageCmd withQuiet();
107-
108-
public BuildImageCmd withQuiet(boolean quiet);
109-
110-
public BuildImageCmd withPull();
106+
public BuildImageCmd withQuiet(Boolean quiet);
111107

112-
public BuildImageCmd withPull(boolean pull);
108+
public BuildImageCmd withPull(Boolean pull);
113109

114-
public BuildImageCmd withMemory(long memory);
110+
public BuildImageCmd withMemory(Long memory);
115111

116-
public BuildImageCmd withMemswap(long memswap);
112+
public BuildImageCmd withMemswap(Long memswap);
117113

118114
public BuildImageCmd withCpushares(String cpushares);
119115

@@ -123,7 +119,7 @@ public interface BuildImageCmd extends AsyncDockerCmd<BuildImageCmd, BuildRespon
123119

124120
public BuildImageCmd withBuildAuthConfigs(AuthConfigurations authConfig);
125121

126-
public BuildImageCmd withTarInputStream(InputStream tarInputStream);
122+
public BuildImageCmd withTarInputStream(@Nonnull InputStream tarInputStream);
127123

128124
public static interface Exec extends DockerCmdAsyncExec<BuildImageCmd, BuildResponseItem> {
129125
}

0 commit comments

Comments
 (0)