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.AddressServiceUtil;
023
024
054 public class AddressServiceHttp {
055 public static com.liferay.portal.model.Address addAddress(
056 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
057 java.lang.String street1, java.lang.String street2,
058 java.lang.String street3, java.lang.String city, java.lang.String zip,
059 long regionId, long countryId, int typeId, boolean mailing,
060 boolean primary)
061 throws com.liferay.portal.kernel.exception.PortalException,
062 com.liferay.portal.kernel.exception.SystemException {
063 try {
064 MethodKey methodKey = new MethodKey(AddressServiceUtil.class.getName(),
065 "addAddress", _addAddressParameterTypes0);
066
067 MethodHandler methodHandler = new MethodHandler(methodKey,
068 className, classPK, street1, street2, street3, city, zip,
069 regionId, countryId, typeId, mailing, primary);
070
071 Object returnObj = null;
072
073 try {
074 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
075 }
076 catch (Exception e) {
077 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
078 throw (com.liferay.portal.kernel.exception.PortalException)e;
079 }
080
081 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
082 throw (com.liferay.portal.kernel.exception.SystemException)e;
083 }
084
085 throw new com.liferay.portal.kernel.exception.SystemException(e);
086 }
087
088 return (com.liferay.portal.model.Address)returnObj;
089 }
090 catch (com.liferay.portal.kernel.exception.SystemException se) {
091 _log.error(se, se);
092
093 throw se;
094 }
095 }
096
097 public static void deleteAddress(HttpPrincipal httpPrincipal, long addressId)
098 throws com.liferay.portal.kernel.exception.PortalException,
099 com.liferay.portal.kernel.exception.SystemException {
100 try {
101 MethodKey methodKey = new MethodKey(AddressServiceUtil.class.getName(),
102 "deleteAddress", _deleteAddressParameterTypes1);
103
104 MethodHandler methodHandler = new MethodHandler(methodKey, addressId);
105
106 try {
107 TunnelUtil.invoke(httpPrincipal, methodHandler);
108 }
109 catch (Exception e) {
110 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
111 throw (com.liferay.portal.kernel.exception.PortalException)e;
112 }
113
114 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
115 throw (com.liferay.portal.kernel.exception.SystemException)e;
116 }
117
118 throw new com.liferay.portal.kernel.exception.SystemException(e);
119 }
120 }
121 catch (com.liferay.portal.kernel.exception.SystemException se) {
122 _log.error(se, se);
123
124 throw se;
125 }
126 }
127
128 public static com.liferay.portal.model.Address getAddress(
129 HttpPrincipal httpPrincipal, long addressId)
130 throws com.liferay.portal.kernel.exception.PortalException,
131 com.liferay.portal.kernel.exception.SystemException {
132 try {
133 MethodKey methodKey = new MethodKey(AddressServiceUtil.class.getName(),
134 "getAddress", _getAddressParameterTypes2);
135
136 MethodHandler methodHandler = new MethodHandler(methodKey, addressId);
137
138 Object returnObj = null;
139
140 try {
141 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
142 }
143 catch (Exception e) {
144 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
145 throw (com.liferay.portal.kernel.exception.PortalException)e;
146 }
147
148 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
149 throw (com.liferay.portal.kernel.exception.SystemException)e;
150 }
151
152 throw new com.liferay.portal.kernel.exception.SystemException(e);
153 }
154
155 return (com.liferay.portal.model.Address)returnObj;
156 }
157 catch (com.liferay.portal.kernel.exception.SystemException se) {
158 _log.error(se, se);
159
160 throw se;
161 }
162 }
163
164 public static java.util.List<com.liferay.portal.model.Address> getAddresses(
165 HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
166 throws com.liferay.portal.kernel.exception.PortalException,
167 com.liferay.portal.kernel.exception.SystemException {
168 try {
169 MethodKey methodKey = new MethodKey(AddressServiceUtil.class.getName(),
170 "getAddresses", _getAddressesParameterTypes3);
171
172 MethodHandler methodHandler = new MethodHandler(methodKey,
173 className, classPK);
174
175 Object returnObj = null;
176
177 try {
178 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
179 }
180 catch (Exception e) {
181 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
182 throw (com.liferay.portal.kernel.exception.PortalException)e;
183 }
184
185 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
186 throw (com.liferay.portal.kernel.exception.SystemException)e;
187 }
188
189 throw new com.liferay.portal.kernel.exception.SystemException(e);
190 }
191
192 return (java.util.List<com.liferay.portal.model.Address>)returnObj;
193 }
194 catch (com.liferay.portal.kernel.exception.SystemException se) {
195 _log.error(se, se);
196
197 throw se;
198 }
199 }
200
201 public static com.liferay.portal.model.Address updateAddress(
202 HttpPrincipal httpPrincipal, long addressId, java.lang.String street1,
203 java.lang.String street2, java.lang.String street3,
204 java.lang.String city, java.lang.String zip, long regionId,
205 long countryId, int typeId, boolean mailing, boolean primary)
206 throws com.liferay.portal.kernel.exception.PortalException,
207 com.liferay.portal.kernel.exception.SystemException {
208 try {
209 MethodKey methodKey = new MethodKey(AddressServiceUtil.class.getName(),
210 "updateAddress", _updateAddressParameterTypes4);
211
212 MethodHandler methodHandler = new MethodHandler(methodKey,
213 addressId, street1, street2, street3, city, zip, regionId,
214 countryId, typeId, mailing, primary);
215
216 Object returnObj = null;
217
218 try {
219 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
220 }
221 catch (Exception e) {
222 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
223 throw (com.liferay.portal.kernel.exception.PortalException)e;
224 }
225
226 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
227 throw (com.liferay.portal.kernel.exception.SystemException)e;
228 }
229
230 throw new com.liferay.portal.kernel.exception.SystemException(e);
231 }
232
233 return (com.liferay.portal.model.Address)returnObj;
234 }
235 catch (com.liferay.portal.kernel.exception.SystemException se) {
236 _log.error(se, se);
237
238 throw se;
239 }
240 }
241
242 private static Log _log = LogFactoryUtil.getLog(AddressServiceHttp.class);
243 private static final Class<?>[] _addAddressParameterTypes0 = new Class[] {
244 java.lang.String.class, long.class, java.lang.String.class,
245 java.lang.String.class, java.lang.String.class,
246 java.lang.String.class, java.lang.String.class, long.class,
247 long.class, int.class, boolean.class, boolean.class
248 };
249 private static final Class<?>[] _deleteAddressParameterTypes1 = new Class[] {
250 long.class
251 };
252 private static final Class<?>[] _getAddressParameterTypes2 = new Class[] {
253 long.class
254 };
255 private static final Class<?>[] _getAddressesParameterTypes3 = new Class[] {
256 java.lang.String.class, long.class
257 };
258 private static final Class<?>[] _updateAddressParameterTypes4 = new Class[] {
259 long.class, java.lang.String.class, java.lang.String.class,
260 java.lang.String.class, java.lang.String.class,
261 java.lang.String.class, long.class, long.class, int.class,
262 boolean.class, boolean.class
263 };
264 }