forked from michaelmosmann/embedmongo.flapdoodle.de
-
-
Notifications
You must be signed in to change notification settings - Fork 161
/
Version.java
372 lines (331 loc) · 7.17 KB
/
Version.java
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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
/**
* Copyright (C) 2011
* Michael Mosmann <michael@mosmann.de>
* Martin Jöhren <m.joehren@googlemail.com>
*
* with contributions from
* konstantin-ba@github,Archimedes Trajano (trajano@github)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.flapdoodle.embed.mongo.distribution;
import de.flapdoodle.embed.mongo.packageresolver.*;
import java.util.EnumSet;
import java.util.Optional;
/**
* MongoDB Version enum
*/
public enum Version implements IFeatureAwareVersion, HasMongotoolsPackage {
@Deprecated
V1_6_5("1.6.5"),
@Deprecated
V1_7_6("1.7.6"),
@Deprecated
V1_8_0_rc0("1.8.0-rc0"),
@Deprecated
V1_8_0("1.8.0"),
@Deprecated
V1_8_1("1.8.1"),
@Deprecated
V1_8_2_rc0("1.8.2-rc0"),
@Deprecated
V1_8_2("1.8.2"),
@Deprecated
V1_8_4("1.8.4"),
@Deprecated
V1_8_5("1.8.5"),
@Deprecated
V1_9_0("1.9.0"),
@Deprecated
V2_0_1("2.0.1"),
@Deprecated
V2_0_4("2.0.4"),
@Deprecated
V2_0_5("2.0.5"),
@Deprecated
V2_0_6("2.0.6"),
@Deprecated
V2_0_7_RC1("2.0.7-rc1"),
@Deprecated
V2_0_7("2.0.7"),
@Deprecated
V2_0_8_RC0("2.0.8-rc0"),
@Deprecated
V2_0_9("2.0.9"),
@Deprecated
V2_1_0("2.1.0"),
@Deprecated
V2_1_1("2.1.1"),
@Deprecated
V2_1_2("2.1.2"),
@Deprecated
V2_2_0_RC0("2.2.0-rc0"),
@Deprecated
V2_2_0("2.2.0"),
@Deprecated
V2_2_1("2.2.1"),
@Deprecated
V2_2_3("2.2.3"),
@Deprecated
V2_2_4("2.2.4"),
@Deprecated
V2_2_5("2.2.5"),
@Deprecated
V2_2_6("2.2.6"),
@Deprecated
V2_2_7("2.2.7"),
@Deprecated
V2_3_0("2.3.0"),
@Deprecated
V2_4_0_RC3("2.4.0-rc3"),
@Deprecated
V2_4_0("2.4.0"),
@Deprecated
V2_4_1("2.4.1"),
@Deprecated
V2_4_2("2.4.2"),
@Deprecated
V2_4_3("2.4.3"),
@Deprecated
V2_4_5("2.4.5"),
@Deprecated
V2_4_6("2.4.6"),
@Deprecated
V2_4_7("2.4.7"),
@Deprecated
V2_4_8("2.4.8"),
@Deprecated
V2_4_9("2.4.9"),
@Deprecated
V2_4_10("2.4.10"),
@Deprecated
V2_5_0("2.5.0"),
@Deprecated
V2_5_1("2.5.1"),
@Deprecated
V2_5_3("2.5.3"),
@Deprecated
V2_5_4("2.5.4"),
/**
* 2.6 series production releases --------------
*/
@Deprecated
V2_6_0("2.6.0"),
@Deprecated
V2_6_1("2.6.1"),
@Deprecated
V2_6_8("2.6.8"),
@Deprecated
V2_6_10("2.6.10"),
/**
* Latest 2.6 production release
*/
@Deprecated
V2_6_11("2.6.11"),
/**
* Latest 2.7 series development release
*/
@Deprecated
V2_7_0("2.7.0"),
@Deprecated
V2_7_1("2.7.1"),
/**
* Latest 3.0 series production release
*/
@Deprecated
V3_0_0("3.0.0"),
@Deprecated
V3_0_1("3.0.1"),
@Deprecated
V3_0_2("3.0.2"),
@Deprecated
V3_0_4("3.0.4"),
@Deprecated
V3_0_5("3.0.5"),
@Deprecated
V3_0_6("3.0.6"),
@Deprecated
V3_0_7("3.0.7"),
@Deprecated
V3_0_8("3.0.8"),
/**
* Latest 3.1 series development release
*/
@Deprecated
V3_1_0("3.1.0"),
@Deprecated
V3_1_5("3.1.5"),
@Deprecated
V3_1_6("3.1.6"),
@Deprecated
V3_2_0("3.2.0"),
/**
* Latest 3.2 series development release
*/
@Deprecated
V3_2_1_RC3("3.2.1-rc3"),
/**
* Latest 3.2 series production release
*/
@Deprecated
V3_2_1("3.2.1"),
V3_2_20("3.2.20"),
/**
* Latest 3 series production release
*/
@Deprecated
V3_3_1("3.3.1"),
@Deprecated
V3_4_3("3.4.3"),
/**
* last version with solaris support
*/
V3_4_5("3.4.5"),
V3_4_15("3.4.15"),
V3_5_5("3.5.5"),
@Deprecated
V3_6_0("3.6.0"),
@Deprecated
V3_6_2("3.6.2"),
@Deprecated
V3_6_3("3.6.3"),
V3_6_5("3.6.5"),
V3_6_22("3.6.22"),
@Deprecated
V4_0_2("4.0.2"),
V4_0_12("4.0.12"),
V4_2_13("4.2.13"),
@Deprecated
V4_4_1("4.4.1", MongotoolsVersion.Main.V100_5),
V4_4_5("4.4.5", MongotoolsVersion.Main.V100_5),
V4_4_9("4.4.9", MongotoolsVersion.Main.V100_5),
V4_4_11("4.4.11", MongotoolsVersion.Main.V100_5),
V4_4_13("4.4.13", MongotoolsVersion.Main.V100_5),
V5_0_2("5.0.2", MongotoolsVersion.Main.V100_5),
V5_0_5("5.0.5", MongotoolsVersion.Main.V100_5),
V5_0_6("5.0.6", MongotoolsVersion.Main.V100_5),
@Deprecated
LATEST_NIGHTLY("latest"),
;
private final String specificVersion;
private final FeatureSet features;
private final NumericVersion numericVersion;
private final MongotoolsVersion.Main mongodumpVersion;
Version(String vName) {
this.specificVersion = vName;
this.features = FeatureSetResolver.defaultInstance()
.featuresOf(de.flapdoodle.embed.process.distribution.Version.of(specificVersion));
this.numericVersion = NumericVersion.of(vName);
this.mongodumpVersion = null;
}
Version(String vName, MongotoolsVersion.Main mongodumpVersion) {
this.specificVersion = vName;
this.features = FeatureSetResolver.defaultInstance()
.featuresOf(de.flapdoodle.embed.process.distribution.Version.of(specificVersion));
this.numericVersion = NumericVersion.of(vName);
this.mongodumpVersion = mongodumpVersion;
}
@Override
public Optional<MongotoolsVersion.Main> mongotoolsVersion() {
return Optional.ofNullable(mongodumpVersion);
}
@Override
public String asInDownloadPath() {
return specificVersion;
}
@Override
public NumericVersion numericVersion() {
return numericVersion;
}
@Override
public EnumSet<Feature> getFeatures() {
return EnumSet.noneOf(Feature.class);
}
@Override
public FeatureSet features() {
return features;
}
@Override
public String toString() {
return "Version{" + specificVersion + '}';
}
public enum Main implements IFeatureAwareVersion, HasMongotoolsPackage {
@Deprecated
V1_8(V1_8_5),
@Deprecated
V2_0(V2_0_9),
@Deprecated
V2_1(V2_1_2),
@Deprecated
V2_2(V2_2_7),
@Deprecated
V2_3(V2_3_0),
@Deprecated
V2_4(V2_4_10),
@Deprecated
V2_5(V2_5_4),
@Deprecated
V2_6(V2_6_11),
@Deprecated
V2_7(V2_7_1),
// Older releases
@Deprecated
V3_0(V3_0_8),
@Deprecated
V3_1(V3_1_6),
@Deprecated
V3_2(V3_2_20),
@Deprecated
V3_3(V3_3_1),
@Deprecated
V3_4(V3_4_15),
@Deprecated
V3_5(V3_5_5),
V3_6(V3_6_22),
V4_0(V4_0_12),
V4_2(V4_2_13),
V4_4(V4_4_13),
V5_0(V5_0_6),
@Deprecated
LEGACY(V3_6),
PRODUCTION(V4_4),
DEVELOPMENT(V5_0);
private final IFeatureAwareVersion _latest;
Main(IFeatureAwareVersion latest) {
_latest = latest;
}
@Override
public String asInDownloadPath() {
return _latest.asInDownloadPath();
}
@Override
@Deprecated
public NumericVersion numericVersion() {
return _latest.numericVersion();
}
@Override
public EnumSet<Feature> getFeatures() {
return _latest.getFeatures();
}
@Override
public FeatureSet features() {
return _latest.features();
}
@Override
public Optional<MongotoolsVersion.Main> mongotoolsVersion() {
return _latest instanceof HasMongotoolsPackage
? ((HasMongotoolsPackage) _latest).mongotoolsVersion()
: Optional.empty();
}
}
}