1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.aws.ec2.model;
17
18 import static com.google.common.collect.Maps.newHashMap;
19 import static org.kuali.common.util.base.Precondition.checkNotBlank;
20
21 import java.util.Map;
22
23 public enum Regions {
24
25 AP_NORTHEAST_1("ap-northeast-1", "Asia Pacific (Tokyo)"),
26 AP_SOUTHEAST_1("ap-southeast-1", "Asia Pacific (Singapore)"),
27 AP_SOUTHEAST_2("ap-southeast-2", "Asia Pacific (Sydney)"),
28 EU_WEST_1("eu-west-1", "EU (Ireland)"),
29 SA_EAST_1("sa-east-1", "South America (Sao Paulo)"),
30 US_EAST_1("us-east-1", "US East (Northern Virginia)"),
31 US_WEST_1("us-west-1", "US West (Northern California)"),
32 US_WEST_2("us-west-2", "US West (Oregon)");
33
34 private final String name;
35 private final String location;
36
37 private Regions(String name, String location) {
38 checkNotBlank(name, "name");
39 checkNotBlank(location, "location");
40 this.name = name;
41 this.location = location;
42 }
43
44 public String getName() {
45 return name;
46 }
47
48 public String getLocation() {
49 return location;
50 }
51
52 public static Map<String, Regions> asMap() {
53 Map<String, Regions> map = newHashMap();
54 for (Regions region : values()) {
55 map.put(region.getName(), region);
56 }
57 return map;
58 }
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 public static final Regions DEFAULT_REGION = US_EAST_1;
76 }