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