|
9 | 9 | import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionCoordinatesScenario; |
10 | 10 | import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionDescendantsScenario; |
11 | 11 | import com.expediagroup.sdk.rapid.examples.scenarios.geography.ParseRegionWithMultiPolygonCoordinatesScenario; |
| 12 | +import java.util.concurrent.ExecutionException; |
12 | 13 | import org.slf4j.Logger; |
13 | 14 | import org.slf4j.LoggerFactory; |
14 | 15 |
|
15 | | -import java.util.concurrent.ExecutionException; |
16 | | - |
17 | | - |
| 16 | +/** |
| 17 | + * This is the main class for the Rapid SDK Geography demonstration. |
| 18 | + */ |
18 | 19 | public class RapidSdkGeographyDemoApp { |
19 | 20 |
|
20 | | - private static final Logger logger = LoggerFactory.getLogger(RapidSdkGeographyDemoApp.class); |
21 | | - |
22 | | - public static void main(String[] args) throws ExecutionException, InterruptedException { |
23 | | - |
24 | | - logger.info("======================================================================================="); |
25 | | - logger.info("======================================================================================="); |
26 | | - logger.info("== =="); |
27 | | - logger.info("== Howdy! This is a demonstration of Expedia Group RAPID SDK Geography, Enjoy! =="); |
28 | | - logger.info("== =="); |
29 | | - logger.info("======================================================================================="); |
30 | | - logger.info("======================================================================================="); |
31 | | - |
32 | | - logger.info("=============================== Running Geography Scenarios ==========================="); |
33 | | - |
34 | | - /* Run Get List of Region Names Scenario using the default profile |
35 | | - This scenario demonstrates the following: |
36 | | - 1. Getting all regions with details in a paginated manner |
37 | | - 2. Filtering region names |
38 | | - */ |
39 | | - GetListOfRegionNamesScenario getListOfRegionNamesScenario = new GetListOfRegionNamesScenario(); |
40 | | - getListOfRegionNamesScenario.setProfile(new DefaultRapidPartnerProfile()); |
41 | | - getListOfRegionNamesScenario.run(); |
42 | | - |
43 | | - /* Run Get Region Name of Region Scenario using the default profile |
44 | | - This scenario demonstrates the following: |
45 | | - 1. Getting region details by region id |
46 | | - 2. Accessing region details |
47 | | - */ |
48 | | - GetRegionDetailsAndPropertyIdsScenario getRegionNameOfRegionScenario = new GetRegionDetailsAndPropertyIdsScenario(); |
49 | | - getRegionNameOfRegionScenario.setProfile(new DefaultRapidPartnerProfile()); |
50 | | - getRegionNameOfRegionScenario.run(); |
51 | | - |
52 | | - /* Run Get Region By Ancestor Id Scenario using the default profile |
53 | | - This scenario demonstrates the following: |
54 | | - 1. Getting paginated regions details by ancestor id |
55 | | - 2. Accessing region details |
56 | | - */ |
57 | | - GetRegionByAncestorIdScenario getRegionByAncestorIdScenario = new GetRegionByAncestorIdScenario(); |
58 | | - getRegionByAncestorIdScenario.setProfile(new DefaultRapidPartnerProfile()); |
59 | | - getRegionByAncestorIdScenario.run(); |
60 | | - |
61 | | - /* Run Get Region With MultiPolygon Coordinates Scenario using the default profile |
62 | | - This scenario demonstrates the following: |
63 | | - 1. Getting region details with multipolygon coordinates by region id |
64 | | - 2. Accessing region coordinates of type multipolygon |
65 | | - 3. Accessing every polygon list of coordinates. |
66 | | - */ |
67 | | - ParseRegionWithMultiPolygonCoordinatesScenario parseRegionWithMultiPolygonCoordinatesScenario = new ParseRegionWithMultiPolygonCoordinatesScenario(); |
68 | | - parseRegionWithMultiPolygonCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile()); |
69 | | - parseRegionWithMultiPolygonCoordinatesScenario.run(); |
70 | | - |
71 | | - /* Run Parse Region Ancestors Scenario using the default profile |
72 | | - This scenario demonstrates the following: |
73 | | - 1. Getting region details with ancestors by region id |
74 | | - 2. Parsing region ancestors |
75 | | - */ |
76 | | - ParseRegionAncestorsScenario parseRegionAncestorsScenario = new ParseRegionAncestorsScenario(); |
77 | | - parseRegionAncestorsScenario.setProfile(new DefaultRapidPartnerProfile()); |
78 | | - parseRegionAncestorsScenario.run(); |
79 | | - |
80 | | - /* Run Parse Region Descendants Scenario using the default profile |
81 | | - This scenario demonstrates the following: |
82 | | - 1. Getting region details with descendants by region id |
83 | | - 2. Parsing region descendants |
84 | | - */ |
85 | | - ParseRegionDescendantsScenario parseRegionDescendantsScenario = new ParseRegionDescendantsScenario(); |
86 | | - parseRegionDescendantsScenario.setProfile(new DefaultRapidPartnerProfile()); |
87 | | - parseRegionDescendantsScenario.run(); |
88 | | - |
89 | | - /* Run Parse Region Coordinates Scenario using the default profile |
90 | | - This scenario demonstrates the following: |
91 | | - 1. Getting region details with coordinates by region id |
92 | | - 2. Parsing region coordinates |
93 | | - */ |
94 | | - ParseRegionCoordinatesScenario parseRegionCoordinatesScenario = new ParseRegionCoordinatesScenario(); |
95 | | - parseRegionCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile()); |
96 | | - parseRegionCoordinatesScenario.run(); |
97 | | - |
98 | | - /* Run Parse Region Categories Scenario using the default profile |
99 | | - This scenario demonstrates the following: |
100 | | - 1. Getting region details with property ids by region id |
101 | | - 2. Parsing region categories |
102 | | - */ |
103 | | - ParseRegionCategoriesScenario parseRegionCategoriesScenario = new ParseRegionCategoriesScenario(); |
104 | | - parseRegionCategoriesScenario.setProfile(new DefaultRapidPartnerProfile()); |
105 | | - parseRegionCategoriesScenario.run(); |
106 | | - |
107 | | - logger.info("=============================== End of Geography Scenarios ==========================="); |
108 | | - |
109 | | - logger.info("======================================================================================="); |
110 | | - logger.info("======================================================================================="); |
111 | | - logger.info("== =="); |
112 | | - logger.info("== That's all folks! That was the demonstration of RAPID SDK Geography. =="); |
113 | | - logger.info("== =="); |
114 | | - logger.info("======================================================================================="); |
115 | | - logger.info("======================================================================================="); |
116 | | - System.exit(0); |
117 | | - } |
| 21 | + private static final Logger logger = LoggerFactory.getLogger(RapidSdkGeographyDemoApp.class); |
| 22 | + |
| 23 | + /** |
| 24 | + * Main method to run the Rapid SDK Geography demonstration. |
| 25 | + * |
| 26 | + * @param args the arguments |
| 27 | + * @throws ExecutionException the execution exception |
| 28 | + * @throws InterruptedException the interrupted exception |
| 29 | + */ |
| 30 | + public static void main(String[] args) throws ExecutionException, InterruptedException { |
| 31 | + |
| 32 | + logger.info("================================================================================"); |
| 33 | + logger.info("================================================================================"); |
| 34 | + logger.info("== =="); |
| 35 | + logger.info( |
| 36 | + "== Howdy! This is a demonstration of Expedia Group RAPID SDK Geography, Enjoy! =="); |
| 37 | + logger.info("== =="); |
| 38 | + logger.info("================================================================================"); |
| 39 | + logger.info("================================================================================"); |
| 40 | + |
| 41 | + logger.info("============================ Running Geography Scenarios ======================="); |
| 42 | + |
| 43 | + /* Run Get List of Region Names Scenario using the default profile |
| 44 | + This scenario demonstrates the following: |
| 45 | + 1. Getting all regions with details in a paginated manner |
| 46 | + 2. Filtering region names |
| 47 | + */ |
| 48 | + GetListOfRegionNamesScenario getListOfRegionNamesScenario = new GetListOfRegionNamesScenario(); |
| 49 | + getListOfRegionNamesScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 50 | + getListOfRegionNamesScenario.run(); |
| 51 | + |
| 52 | + /* Run Get Region Name of Region Scenario using the default profile |
| 53 | + This scenario demonstrates the following: |
| 54 | + 1. Getting region details by region id |
| 55 | + 2. Accessing region details |
| 56 | + */ |
| 57 | + GetRegionDetailsAndPropertyIdsScenario getRegionNameOfRegionScenario = |
| 58 | + new GetRegionDetailsAndPropertyIdsScenario(); |
| 59 | + getRegionNameOfRegionScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 60 | + getRegionNameOfRegionScenario.run(); |
| 61 | + |
| 62 | + /* Run Get Region By Ancestor Id Scenario using the default profile |
| 63 | + This scenario demonstrates the following: |
| 64 | + 1. Getting paginated regions details by ancestor id |
| 65 | + 2. Accessing region details |
| 66 | + */ |
| 67 | + GetRegionByAncestorIdScenario getRegionByAncestorIdScenario = |
| 68 | + new GetRegionByAncestorIdScenario(); |
| 69 | + getRegionByAncestorIdScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 70 | + getRegionByAncestorIdScenario.run(); |
| 71 | + |
| 72 | + /* Run Get Region With MultiPolygon Coordinates Scenario using the default profile |
| 73 | + This scenario demonstrates the following: |
| 74 | + 1. Getting region details with multipolygon coordinates by region id |
| 75 | + 2. Accessing region coordinates of type multipolygon |
| 76 | + 3. Accessing every polygon list of coordinates. |
| 77 | + */ |
| 78 | + ParseRegionWithMultiPolygonCoordinatesScenario parseRegionWithMultiPolygonCoordinatesScenario = |
| 79 | + new ParseRegionWithMultiPolygonCoordinatesScenario(); |
| 80 | + parseRegionWithMultiPolygonCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 81 | + parseRegionWithMultiPolygonCoordinatesScenario.run(); |
| 82 | + |
| 83 | + /* Run Parse Region Ancestors Scenario using the default profile |
| 84 | + This scenario demonstrates the following: |
| 85 | + 1. Getting region details with ancestors by region id |
| 86 | + 2. Parsing region ancestors |
| 87 | + */ |
| 88 | + ParseRegionAncestorsScenario parseRegionAncestorsScenario = new ParseRegionAncestorsScenario(); |
| 89 | + parseRegionAncestorsScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 90 | + parseRegionAncestorsScenario.run(); |
| 91 | + |
| 92 | + /* Run Parse Region Descendants Scenario using the default profile |
| 93 | + This scenario demonstrates the following: |
| 94 | + 1. Getting region details with descendants by region id |
| 95 | + 2. Parsing region descendants |
| 96 | + */ |
| 97 | + ParseRegionDescendantsScenario parseRegionDescendantsScenario = |
| 98 | + new ParseRegionDescendantsScenario(); |
| 99 | + parseRegionDescendantsScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 100 | + parseRegionDescendantsScenario.run(); |
| 101 | + |
| 102 | + /* Run Parse Region Coordinates Scenario using the default profile |
| 103 | + This scenario demonstrates the following: |
| 104 | + 1. Getting region details with coordinates by region id |
| 105 | + 2. Parsing region coordinates |
| 106 | + */ |
| 107 | + ParseRegionCoordinatesScenario parseRegionCoordinatesScenario = |
| 108 | + new ParseRegionCoordinatesScenario(); |
| 109 | + parseRegionCoordinatesScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 110 | + parseRegionCoordinatesScenario.run(); |
| 111 | + |
| 112 | + /* Run Parse Region Categories Scenario using the default profile |
| 113 | + This scenario demonstrates the following: |
| 114 | + 1. Getting region details with property ids by region id |
| 115 | + 2. Parsing region categories |
| 116 | + */ |
| 117 | + ParseRegionCategoriesScenario parseRegionCategoriesScenario = |
| 118 | + new ParseRegionCategoriesScenario(); |
| 119 | + parseRegionCategoriesScenario.setProfile(new DefaultRapidPartnerProfile()); |
| 120 | + parseRegionCategoriesScenario.run(); |
| 121 | + |
| 122 | + logger.info("============================ End of Geography Scenarios ========================"); |
| 123 | + |
| 124 | + logger.info("================================================================================"); |
| 125 | + logger.info("================================================================================"); |
| 126 | + logger.info("== =="); |
| 127 | + logger.info("== That's all folks! That was the demonstration of RAPID SDK Geography. =="); |
| 128 | + logger.info("== =="); |
| 129 | + logger.info("================================================================================"); |
| 130 | + logger.info("================================================================================"); |
| 131 | + System.exit(0); |
| 132 | + } |
118 | 133 | } |
0 commit comments