-
Notifications
You must be signed in to change notification settings - Fork 1.1k
upd to 1.22 API update part 1 #469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b97fc4d
8c93adf
93b9dc8
2ad06b1
074883a
d25eda0
dc5e6c6
d9a30cb
18a6307
c18177e
cf39893
f69c056
25018fc
57a2807
5ca5e63
3087078
aaa5e4b
a39d5fc
642c94f
7a8513d
051a0fa
5e70093
35865ba
6482e77
97baacd
284d145
2f3aa8b
71d5ecb
7631991
0e9ba93
3e79e88
5336f8c
2ec5fb3
01f1468
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| ### Code Design | ||
| * Model is based on Objects and not primitives that allows nullify requests and have null values for data | ||
| that wasn't provided by docker daemon. | ||
| * For null safeness findbugs annotations are used. | ||
| ** Every method that may return `null` (and we are unsure in any fields as docker daemon may change something) | ||
| should be annotated with `@CheckForNull` return qualifier from `javax.annotation` package. | ||
| ** Methods that can't return `null` must be annotated with `@Nonnull`. | ||
| ** The same for Arguments. | ||
| ** `@Nullable` must be used only for changing inherited (other typed) qualifier. | ||
| * Setters in builder style must be prefixed with `withXX`. | ||
| * All classes should provide `toString()` `equals()` and `hashCode()` defined methods. | ||
| * Javadocs | ||
| ** Provide full information on field: | ||
| *** For models define API version with `@since {@link RemoteApiVersion#VERSION_1_X}`. | ||
| ** getters/setters should refernce to field `@see #$field`. | ||
|
|
||
| ### Coding style | ||
| * TBD, some initial styling already enforced with checkstyle. | ||
| IDEA/checkstyle file analogues will be provided soon. | ||
|
|
||
| ### Testing | ||
| * Unit tests for serder (serialization-deserialization). | ||
| * Integration tests for commands. | ||
| * If model object has builders, then fill it with data and compare by `equals()` with expected response | ||
| from docker daemon. If failed, then some fields mappings are wrong. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,8 @@ public interface DockerCmdExecFactory extends Closeable { | |
|
|
||
| public KillContainerCmd.Exec createKillContainerCmdExec(); | ||
|
|
||
| UpdateContainerCmd.Exec createUpdateContainerCmdExec(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use public keyword or remove other public keywords.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in next PR will do and it TODO enable checkstyle. |
||
|
|
||
| public RestartContainerCmd.Exec createRestartContainerCmdExec(); | ||
|
|
||
| public CommitCmd.Exec createCommitCmdExec(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| package com.github.dockerjava.api.command; | ||
|
|
||
| import com.github.dockerjava.api.model.UpdateContainerResponse; | ||
|
|
||
| import javax.annotation.CheckForNull; | ||
|
|
||
| /** | ||
| * @author Kanstantsin Shautsou | ||
| */ | ||
| public interface UpdateContainerCmd extends SyncDockerCmd<UpdateContainerResponse> { | ||
| @CheckForNull | ||
| String getContainerId(); | ||
|
|
||
| @CheckForNull | ||
| public Integer getBlkioWeight(); | ||
|
|
||
| public UpdateContainerCmd withBlkioWeight(Integer blkioWeight); | ||
|
|
||
| public UpdateContainerCmd withContainerId(String containerId); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing @nonnull
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically it can be set because there is no null checks and null call will work (docker-java wouldn't fail)...
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to deny |
||
|
|
||
| @CheckForNull | ||
| public Integer getCpuPeriod(); | ||
|
|
||
| public UpdateContainerCmd withCpuPeriod(Integer cpuPeriod); | ||
|
|
||
| @CheckForNull | ||
| public Integer getCpuQuota(); | ||
|
|
||
| public UpdateContainerCmd withCpuQuota(Integer cpuQuota); | ||
|
|
||
| @CheckForNull | ||
| public String getCpusetCpus(); | ||
|
|
||
| public UpdateContainerCmd withCpusetCpus(String cpusetCpus); | ||
|
|
||
| @CheckForNull | ||
| public String getCpusetMems(); | ||
|
|
||
| public UpdateContainerCmd withCpusetMems(String cpusetMems); | ||
|
|
||
| @CheckForNull | ||
| public Integer getCpuShares(); | ||
|
|
||
| public UpdateContainerCmd withCpuShares(Integer cpuShares); | ||
|
|
||
| @CheckForNull | ||
| public Long getKernelMemory(); | ||
|
|
||
| public UpdateContainerCmd withKernelMemory(Long kernelMemory); | ||
|
|
||
| @CheckForNull | ||
| public Long getMemory(); | ||
|
|
||
| public UpdateContainerCmd withMemory(Long memory); | ||
|
|
||
| @CheckForNull | ||
| public Long getMemoryReservation(); | ||
|
|
||
| public UpdateContainerCmd withMemoryReservation(Long memoryReservation); | ||
|
|
||
| @CheckForNull | ||
| Long getMemorySwap(); | ||
|
|
||
| UpdateContainerCmd withMemorySwap(Long memorySwap); | ||
|
|
||
| interface Exec extends DockerCmdSyncExec<UpdateContainerCmd, UpdateContainerResponse> { | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcuslinke review this doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@KostyaSha LGTM