forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEventsCmdImpl.java
More file actions
95 lines (76 loc) · 2.36 KB
/
Copy pathEventsCmdImpl.java
File metadata and controls
95 lines (76 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package com.github.dockerjava.core.command;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import com.github.dockerjava.api.command.EventsCmd;
import com.github.dockerjava.api.model.Event;
import com.github.dockerjava.core.util.FiltersBuilder;
/**
* Stream docker events
*/
public class EventsCmdImpl extends AbstrAsyncDockerCmd<EventsCmd, Event> implements EventsCmd {
private String since;
private String until;
private FiltersBuilder filters = new FiltersBuilder();
public EventsCmdImpl(EventsCmd.Exec exec) {
super(exec);
}
@Override
public EventsCmd withSince(String since) {
this.since = since;
return this;
}
@Override
public EventsCmd withUntil(String until) {
this.until = until;
return this;
}
@Override
public EventsCmd withContainerFilter(String... container) {
Objects.requireNonNull(container, "container have not been specified");
this.filters.withContainers(container);
return this;
}
@Override
public EventsCmd withImageFilter(String... image) {
Objects.requireNonNull(image, "image have not been specified");
this.filters.withImages(image);
return this;
}
@Override
public EventsCmd withEventFilter(String... event) {
Objects.requireNonNull(event, "event have not been specified");
this.filters.withFilter("event", event);
return this;
}
@Override
public EventsCmd withEventTypeFilter(String... eventTypes) {
Objects.requireNonNull(eventTypes, "event types have not been specified");
this.filters.withEventTypes(eventTypes);
return this;
}
@Override
public EventsCmd withLabelFilter(String... label) {
Objects.requireNonNull(label, "label have not been specified");
this.filters.withLabels(label);
return this;
}
@Override
public EventsCmd withLabelFilter(Map<String, String> labels) {
Objects.requireNonNull(labels, "labels have not been specified");
this.filters.withLabels(labels);
return this;
}
@Override
public String getSince() {
return since;
}
@Override
public String getUntil() {
return until;
}
@Override
public Map<String, List<String>> getFilters() {
return filters.build();
}
}