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