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.security.auth.HttpPrincipal;
31 import com.liferay.portal.service.RegionServiceUtil;
32 import com.liferay.portal.service.http.TunnelUtil;
33
34
71 public class RegionServiceHttp {
72 public static java.util.List getRegions(HttpPrincipal httpPrincipal)
73 throws com.liferay.portal.SystemException {
74 try {
75 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
76 "getRegions", new Object[0]);
77 Object returnObj = null;
78
79 try {
80 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
81 }
82 catch (Exception e) {
83 if (e instanceof com.liferay.portal.SystemException) {
84 throw (com.liferay.portal.SystemException)e;
85 }
86
87 throw new com.liferay.portal.SystemException(e);
88 }
89
90 return (java.util.List)returnObj;
91 }
92 catch (com.liferay.portal.SystemException se) {
93 _log.error(se, se);
94 throw se;
95 }
96 }
97
98 public static java.util.List getRegions(HttpPrincipal httpPrincipal,
99 long countryId) throws com.liferay.portal.SystemException {
100 try {
101 Object paramObj0 = new LongWrapper(countryId);
102 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
103 "getRegions", new Object[] { paramObj0 });
104 Object returnObj = null;
105
106 try {
107 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
108 }
109 catch (Exception e) {
110 if (e instanceof com.liferay.portal.SystemException) {
111 throw (com.liferay.portal.SystemException)e;
112 }
113
114 throw new com.liferay.portal.SystemException(e);
115 }
116
117 return (java.util.List)returnObj;
118 }
119 catch (com.liferay.portal.SystemException se) {
120 _log.error(se, se);
121 throw se;
122 }
123 }
124
125 public static java.util.List getRegions(HttpPrincipal httpPrincipal,
126 boolean active) throws com.liferay.portal.SystemException {
127 try {
128 Object paramObj0 = new BooleanWrapper(active);
129 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
130 "getRegions", new Object[] { paramObj0 });
131 Object returnObj = null;
132
133 try {
134 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
135 }
136 catch (Exception e) {
137 if (e instanceof com.liferay.portal.SystemException) {
138 throw (com.liferay.portal.SystemException)e;
139 }
140
141 throw new com.liferay.portal.SystemException(e);
142 }
143
144 return (java.util.List)returnObj;
145 }
146 catch (com.liferay.portal.SystemException se) {
147 _log.error(se, se);
148 throw se;
149 }
150 }
151
152 public static java.util.List getRegions(HttpPrincipal httpPrincipal,
153 long countryId, boolean active)
154 throws com.liferay.portal.SystemException {
155 try {
156 Object paramObj0 = new LongWrapper(countryId);
157 Object paramObj1 = new BooleanWrapper(active);
158 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
159 "getRegions", new Object[] { paramObj0, paramObj1 });
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)returnObj;
174 }
175 catch (com.liferay.portal.SystemException se) {
176 _log.error(se, se);
177 throw se;
178 }
179 }
180
181 public static com.liferay.portal.model.Region getRegion(
182 HttpPrincipal httpPrincipal, long regionId)
183 throws com.liferay.portal.SystemException,
184 com.liferay.portal.PortalException {
185 try {
186 Object paramObj0 = new LongWrapper(regionId);
187 MethodWrapper methodWrapper = new MethodWrapper(RegionServiceUtil.class.getName(),
188 "getRegion", new Object[] { paramObj0 });
189 Object returnObj = null;
190
191 try {
192 returnObj = TunnelUtil.invoke(httpPrincipal, methodWrapper);
193 }
194 catch (Exception e) {
195 if (e instanceof com.liferay.portal.SystemException) {
196 throw (com.liferay.portal.SystemException)e;
197 }
198
199 if (e instanceof com.liferay.portal.PortalException) {
200 throw (com.liferay.portal.PortalException)e;
201 }
202
203 throw new com.liferay.portal.SystemException(e);
204 }
205
206 return (com.liferay.portal.model.Region)returnObj;
207 }
208 catch (com.liferay.portal.SystemException se) {
209 _log.error(se, se);
210 throw se;
211 }
212 }
213
214 private static Log _log = LogFactoryUtil.getLog(RegionServiceHttp.class);
215 }