001
014
015 package com.liferay.portal.service.http;
016
017 import com.liferay.portal.kernel.log.Log;
018 import com.liferay.portal.kernel.log.LogFactoryUtil;
019 import com.liferay.portal.kernel.util.MethodHandler;
020 import com.liferay.portal.kernel.util.MethodKey;
021 import com.liferay.portal.security.auth.HttpPrincipal;
022 import com.liferay.portal.service.RegionServiceUtil;
023
024
054 public class RegionServiceHttp {
055 public static com.liferay.portal.model.Region addRegion(
056 HttpPrincipal httpPrincipal, long countryId,
057 java.lang.String regionCode, java.lang.String name, boolean active)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 MethodKey methodKey = new MethodKey(RegionServiceUtil.class.getName(),
062 "addRegion", _addRegionParameterTypes0);
063
064 MethodHandler methodHandler = new MethodHandler(methodKey,
065 countryId, regionCode, name, active);
066
067 Object returnObj = null;
068
069 try {
070 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
071 }
072 catch (Exception e) {
073 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
074 throw (com.liferay.portal.kernel.exception.PortalException)e;
075 }
076
077 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
078 throw (com.liferay.portal.kernel.exception.SystemException)e;
079 }
080
081 throw new com.liferay.portal.kernel.exception.SystemException(e);
082 }
083
084 return (com.liferay.portal.model.Region)returnObj;
085 }
086 catch (com.liferay.portal.kernel.exception.SystemException se) {
087 _log.error(se, se);
088
089 throw se;
090 }
091 }
092
093 public static java.util.List<com.liferay.portal.model.Region> getRegions(
094 HttpPrincipal httpPrincipal)
095 throws com.liferay.portal.kernel.exception.SystemException {
096 try {
097 MethodKey methodKey = new MethodKey(RegionServiceUtil.class.getName(),
098 "getRegions", _getRegionsParameterTypes1);
099
100 MethodHandler methodHandler = new MethodHandler(methodKey);
101
102 Object returnObj = null;
103
104 try {
105 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
106 }
107 catch (Exception e) {
108 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
109 throw (com.liferay.portal.kernel.exception.SystemException)e;
110 }
111
112 throw new com.liferay.portal.kernel.exception.SystemException(e);
113 }
114
115 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
116 }
117 catch (com.liferay.portal.kernel.exception.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, long countryId)
126 throws com.liferay.portal.kernel.exception.SystemException {
127 try {
128 MethodKey methodKey = new MethodKey(RegionServiceUtil.class.getName(),
129 "getRegions", _getRegionsParameterTypes2);
130
131 MethodHandler methodHandler = new MethodHandler(methodKey, countryId);
132
133 Object returnObj = null;
134
135 try {
136 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
137 }
138 catch (Exception e) {
139 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
140 throw (com.liferay.portal.kernel.exception.SystemException)e;
141 }
142
143 throw new com.liferay.portal.kernel.exception.SystemException(e);
144 }
145
146 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
147 }
148 catch (com.liferay.portal.kernel.exception.SystemException se) {
149 _log.error(se, se);
150
151 throw se;
152 }
153 }
154
155 public static java.util.List<com.liferay.portal.model.Region> getRegions(
156 HttpPrincipal httpPrincipal, boolean active)
157 throws com.liferay.portal.kernel.exception.SystemException {
158 try {
159 MethodKey methodKey = new MethodKey(RegionServiceUtil.class.getName(),
160 "getRegions", _getRegionsParameterTypes3);
161
162 MethodHandler methodHandler = new MethodHandler(methodKey, active);
163
164 Object returnObj = null;
165
166 try {
167 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
168 }
169 catch (Exception e) {
170 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
171 throw (com.liferay.portal.kernel.exception.SystemException)e;
172 }
173
174 throw new com.liferay.portal.kernel.exception.SystemException(e);
175 }
176
177 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
178 }
179 catch (com.liferay.portal.kernel.exception.SystemException se) {
180 _log.error(se, se);
181
182 throw se;
183 }
184 }
185
186 public static java.util.List<com.liferay.portal.model.Region> getRegions(
187 HttpPrincipal httpPrincipal, long countryId, boolean active)
188 throws com.liferay.portal.kernel.exception.SystemException {
189 try {
190 MethodKey methodKey = new MethodKey(RegionServiceUtil.class.getName(),
191 "getRegions", _getRegionsParameterTypes4);
192
193 MethodHandler methodHandler = new MethodHandler(methodKey,
194 countryId, active);
195
196 Object returnObj = null;
197
198 try {
199 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
200 }
201 catch (Exception e) {
202 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
203 throw (com.liferay.portal.kernel.exception.SystemException)e;
204 }
205
206 throw new com.liferay.portal.kernel.exception.SystemException(e);
207 }
208
209 return (java.util.List<com.liferay.portal.model.Region>)returnObj;
210 }
211 catch (com.liferay.portal.kernel.exception.SystemException se) {
212 _log.error(se, se);
213
214 throw se;
215 }
216 }
217
218 public static com.liferay.portal.model.Region getRegion(
219 HttpPrincipal httpPrincipal, long regionId)
220 throws com.liferay.portal.kernel.exception.PortalException,
221 com.liferay.portal.kernel.exception.SystemException {
222 try {
223 MethodKey methodKey = new MethodKey(RegionServiceUtil.class.getName(),
224 "getRegion", _getRegionParameterTypes5);
225
226 MethodHandler methodHandler = new MethodHandler(methodKey, regionId);
227
228 Object returnObj = null;
229
230 try {
231 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
232 }
233 catch (Exception e) {
234 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
235 throw (com.liferay.portal.kernel.exception.PortalException)e;
236 }
237
238 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
239 throw (com.liferay.portal.kernel.exception.SystemException)e;
240 }
241
242 throw new com.liferay.portal.kernel.exception.SystemException(e);
243 }
244
245 return (com.liferay.portal.model.Region)returnObj;
246 }
247 catch (com.liferay.portal.kernel.exception.SystemException se) {
248 _log.error(se, se);
249
250 throw se;
251 }
252 }
253
254 private static Log _log = LogFactoryUtil.getLog(RegionServiceHttp.class);
255 private static final Class<?>[] _addRegionParameterTypes0 = new Class[] {
256 long.class, java.lang.String.class, java.lang.String.class,
257 boolean.class
258 };
259 private static final Class<?>[] _getRegionsParameterTypes1 = new Class[] { };
260 private static final Class<?>[] _getRegionsParameterTypes2 = new Class[] {
261 long.class
262 };
263 private static final Class<?>[] _getRegionsParameterTypes3 = new Class[] {
264 boolean.class
265 };
266 private static final Class<?>[] _getRegionsParameterTypes4 = new Class[] {
267 long.class, boolean.class
268 };
269 private static final Class<?>[] _getRegionParameterTypes5 = new Class[] {
270 long.class
271 };
272 }