1
22
23 package com.liferay.portal.service.http;
24
25 import com.liferay.portal.kernel.log.Log;
26 import com.liferay.portal.kernel.log.LogFactoryUtil;
27 import com.liferay.portal.kernel.util.BooleanWrapper;
28 import com.liferay.portal.kernel.util.LongWrapper;
29 import com.liferay.portal.kernel.util.MethodWrapper;
30 import com.liferay.portal.kernel.util.NullWrapper;
31 import com.liferay.portal.security.auth.HttpPrincipal;
32 import com.liferay.portal.service.RegionServiceUtil;
33
34
71 public class RegionServiceHttp {
72 public static com.liferay.portal.model.Region addRegion(
73 HttpPrincipal httpPrincipal, long countryId,
74 java.lang.String regionCode, java.lang.String name, boolean active)
75 throws com.liferay.portal.PortalException,
76 com.liferay.portal.SystemException {
77 try {
78 Object paramObj0 = new LongWrapper(countryId);
79
80 Object paramObj1 = regionCode;
81
82 if (regionCode == null) {
83 paramObj1 = new NullWrapper("java.lang.String");
84 }
85
86 Object paramObj2 = name;
87
88 if (name == null) {
89 paramObj2 = new NullWrapper("java.lang.String");
90 }
91
92 Object paramObj3 = new BooleanWrapper(active);
93
94 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
95 "addRegion",
96 new Object[] { paramObj0, paramObj1, paramObj2, paramObj3 });
97
98 Object returnObj = null;
99
100 try {
101 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
102 }
103 catch (Exception e) {
104 if (e instanceof com.liferay.portal.PortalException) {
105 throw (com.liferay.portal.PortalException)e;
106 }
107
108 if (e instanceof com.liferay.portal.SystemException) {
109 throw (com.liferay.portal.SystemException)e;
110 }
111
112 throw new com.liferay.portal.SystemException(e);
113 }
114
115 return (com.liferay.portal.model.Region)returnObj;
116 }
117 catch (com.liferay.portal.SystemException se) {
118 _log.error(se, se);
119
120 throw se;
121 }
122 }
123
124 public static java.util.List<com.liferay.portal.model.Region> getRegions(
125 HttpPrincipal httpPrincipal) throws com.liferay.portal.SystemException {
126 try {
127 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
128 "getRegions", new Object[0]);
129
130 Object returnObj = null;
131
132 try {
133 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
134 }
135 catch (Exception e) {
136 if (e instanceof com.liferay.portal.SystemException) {
137 throw (com.liferay.portal.SystemException)e;
138 }
139
140 throw new com.liferay.portal.SystemException(e);
141 }
142
143 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
144 }
145 catch (com.liferay.portal.SystemException se) {
146 _log.error(se, se);
147
148 throw se;
149 }
150 }
151
152 public static java.util.List<com.liferay.portal.model.Region> getRegions(
153 HttpPrincipal httpPrincipal, long countryId)
154 throws com.liferay.portal.SystemException {
155 try {
156 Object paramObj0 = new LongWrapper(countryId);
157
158 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
159 "getRegions", new Object[] { paramObj0 });
160
161 Object returnObj = null;
162
163 try {
164 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
165 }
166 catch (Exception e) {
167 if (e instanceof com.liferay.portal.SystemException) {
168 throw (com.liferay.portal.SystemException)e;
169 }
170
171 throw new com.liferay.portal.SystemException(e);
172 }
173
174 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
175 }
176 catch (com.liferay.portal.SystemException se) {
177 _log.error(se, se);
178
179 throw se;
180 }
181 }
182
183 public static java.util.List<com.liferay.portal.model.Region> getRegions(
184 HttpPrincipal httpPrincipal, boolean active)
185 throws com.liferay.portal.SystemException {
186 try {
187 Object paramObj0 = new BooleanWrapper(active);
188
189 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
190 "getRegions", new Object[] { paramObj0 });
191
192 Object returnObj = null;
193
194 try {
195 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
196 }
197 catch (Exception e) {
198 if (e instanceof com.liferay.portal.SystemException) {
199 throw (com.liferay.portal.SystemException)e;
200 }
201
202 throw new com.liferay.portal.SystemException(e);
203 }
204
205 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
206 }
207 catch (com.liferay.portal.SystemException se) {
208 _log.error(se, se);
209
210 throw se;
211 }
212 }
213
214 public static java.util.List<com.liferay.portal.model.Region> getRegions(
215 HttpPrincipal httpPrincipal, long countryId, boolean active)
216 throws com.liferay.portal.SystemException {
217 try {
218 Object paramObj0 = new LongWrapper(countryId);
219
220 Object paramObj1 = new BooleanWrapper(active);
221
222 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
223 "getRegions", new Object[] { paramObj0, paramObj1 });
224
225 Object returnObj = null;
226
227 try {
228 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
229 }
230 catch (Exception e) {
231 if (e instanceof com.liferay.portal.SystemException) {
232 throw (com.liferay.portal.SystemException)e;
233 }
234
235 throw new com.liferay.portal.SystemException(e);
236 }
237
238 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
239 }
240 catch (com.liferay.portal.SystemException se) {
241 _log.error(se, se);
242
243 throw se;
244 }
245 }
246
247 public static com.liferay.portal.model.Region getRegion(
248 HttpPrincipal httpPrincipal, long regionId)
249 throws com.liferay.portal.PortalException,
250 com.liferay.portal.SystemException {
251 try {
252 Object paramObj0 = new LongWrapper(regionId);
253
254 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
255 "getRegion", new Object[] { paramObj0 });
256
257 Object returnObj = null;
258
259 try {
260 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
261 }
262 catch (Exception e) {
263 if (e instanceof com.liferay.portal.PortalException) {
264 throw (com.liferay.portal.PortalException)e;
265 }
266
267 if (e instanceof com.liferay.portal.SystemException) {
268 throw (com.liferay.portal.SystemException)e;
269 }
270
271 throw new com.liferay.portal.SystemException(e);
272 }
273
274 return (com.liferay.portal.model.Region)returnObj;
275 }
276 catch (com.liferay.portal.SystemException se) {
277 _log.error(se, se);
278
279 throw se;
280 }
281 }
282
283 private static Log _log = LogFactoryUtil.getLog(RegionServiceHttp.class);
284 }