forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.java
More file actions
240 lines (207 loc) · 4.45 KB
/
Copy pathEvent.java
File metadata and controls
240 lines (207 loc) · 4.45 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
package com.github.dockerjava.api.model;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import javax.annotation.CheckForNull;
import java.io.Serializable;
/**
* Representation of a Docker event.
*/
@EqualsAndHashCode
@ToString
public class Event implements Serializable {
private static final long serialVersionUID = 1L;
/**
* @since 1.16
*/
@JsonProperty("status")
private String status;
/**
* @since 1.16
*/
@JsonProperty("id")
private String id;
/**
* @since 1.16
*/
@JsonProperty("from")
private String from;
/**
* ??
*/
@JsonProperty("node")
private Node node;
/*
* @since 1.
*/
@JsonProperty("Type")
private EventType type;
/**
* @since 1.22
*/
@JsonProperty("Action")
private String action;
/**
* @since 1.22
*/
@JsonProperty("Actor")
private EventActor actor;
/**
* @since 1.16
*/
@JsonProperty("time")
private Long time;
/**
* @since 1.21
*/
@JsonProperty("timeNano")
private Long timeNano;
/**
* Default constructor for the deserialization.
*/
public Event() {
}
/**
* Constructor.
*
* @param id Container ID
* @param status Status string. List of statuses is available in <a
* href="https://docs.docker.com/reference/api/docker_remote_api_v1.16/#monitor-dockers-events">Docker API v.1.16</a>
* @param from Image, from which the container has been created
* @param time Event time The time is specified in milliseconds since January 1, 1970, 00:00:00 GMT
* @since 1.16
*/
public Event(String status, String id, String from, Long time) {
this.status = status;
this.id = id;
this.from = from;
this.time = time;
}
/**
* Status of docker image or container. List of statuses is available in <a
* href="https://docs.docker.com/reference/api/docker_remote_api_v1.16/#monitor-dockers-events">Docker API v.1.16</a>
*
* @return Status string
*/
public String getStatus() {
return status;
}
/**
* @see #status
*/
public Event withStatus(String status) {
this.status = status;
return this;
}
/**
* Get ID of docker container.
*
* @return Container ID
*/
public String getId() {
return id;
}
/**
* @see #id
*/
public Event withId(String id) {
this.id = id;
return this;
}
/**
* Get source image of the container.
*
* @return Name of the parent container
*/
public String getFrom() {
return from;
}
/**
* @see #from
*/
public Event withFrom(String from) {
this.from = from;
return this;
}
/**
* Get the event time. The time is specified in milliseconds since January 1, 1970, 00:00:00 GMT
*
* @return Event time in the specified format.
*/
public Long getTime() {
return time;
}
/**
* @see #time
*/
public Event withTime(Long time) {
this.time = time;
return this;
}
/**
* @see #timeNano
*/
@CheckForNull
public Long getTimeNano() {
return timeNano;
}
/**
* @see #timeNano
*/
public Event withTimenano(Long timenano) {
this.timeNano = timenano;
return this;
}
/**
* Returns the node when working against docker swarm
*/
public Node getNode() {
return node;
}
/**
* @see #node
*/
public Event withNode(Node node) {
this.node = node;
return this;
}
@CheckForNull
public EventType getType() {
return type;
}
/**
* @see #type
*/
public Event withType(EventType type) {
this.type = type;
return this;
}
/**
* @see #action
*/
@CheckForNull
public String getAction() {
return action;
}
/**
* @see #action
*/
public Event withAction(String action) {
this.action = action;
return this;
}
/**
* @see #actor
*/
@CheckForNull
public EventActor getActor() {
return actor;
}
/**
* @see #actor
*/
public Event withEventActor(EventActor actor) {
this.actor = actor;
return this;
}
}