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.EmailAddressServiceUtil;
023
024
054 public class EmailAddressServiceHttp {
055 public static com.liferay.portal.model.EmailAddress addEmailAddress(
056 HttpPrincipal httpPrincipal, java.lang.String className, long classPK,
057 java.lang.String address, int typeId, boolean primary)
058 throws com.liferay.portal.kernel.exception.PortalException,
059 com.liferay.portal.kernel.exception.SystemException {
060 try {
061 MethodKey methodKey = new MethodKey(EmailAddressServiceUtil.class.getName(),
062 "addEmailAddress", _addEmailAddressParameterTypes0);
063
064 MethodHandler methodHandler = new MethodHandler(methodKey,
065 className, classPK, address, typeId, primary);
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.EmailAddress)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 void deleteEmailAddress(HttpPrincipal httpPrincipal,
094 long emailAddressId)
095 throws com.liferay.portal.kernel.exception.PortalException,
096 com.liferay.portal.kernel.exception.SystemException {
097 try {
098 MethodKey methodKey = new MethodKey(EmailAddressServiceUtil.class.getName(),
099 "deleteEmailAddress", _deleteEmailAddressParameterTypes1);
100
101 MethodHandler methodHandler = new MethodHandler(methodKey,
102 emailAddressId);
103
104 try {
105 TunnelUtil.invoke(httpPrincipal, methodHandler);
106 }
107 catch (Exception e) {
108 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
109 throw (com.liferay.portal.kernel.exception.PortalException)e;
110 }
111
112 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
113 throw (com.liferay.portal.kernel.exception.SystemException)e;
114 }
115
116 throw new com.liferay.portal.kernel.exception.SystemException(e);
117 }
118 }
119 catch (com.liferay.portal.kernel.exception.SystemException se) {
120 _log.error(se, se);
121
122 throw se;
123 }
124 }
125
126 public static com.liferay.portal.model.EmailAddress getEmailAddress(
127 HttpPrincipal httpPrincipal, long emailAddressId)
128 throws com.liferay.portal.kernel.exception.PortalException,
129 com.liferay.portal.kernel.exception.SystemException {
130 try {
131 MethodKey methodKey = new MethodKey(EmailAddressServiceUtil.class.getName(),
132 "getEmailAddress", _getEmailAddressParameterTypes2);
133
134 MethodHandler methodHandler = new MethodHandler(methodKey,
135 emailAddressId);
136
137 Object returnObj = null;
138
139 try {
140 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
141 }
142 catch (Exception e) {
143 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
144 throw (com.liferay.portal.kernel.exception.PortalException)e;
145 }
146
147 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
148 throw (com.liferay.portal.kernel.exception.SystemException)e;
149 }
150
151 throw new com.liferay.portal.kernel.exception.SystemException(e);
152 }
153
154 return (com.liferay.portal.model.EmailAddress)returnObj;
155 }
156 catch (com.liferay.portal.kernel.exception.SystemException se) {
157 _log.error(se, se);
158
159 throw se;
160 }
161 }
162
163 public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(
164 HttpPrincipal httpPrincipal, java.lang.String className, long classPK)
165 throws com.liferay.portal.kernel.exception.PortalException,
166 com.liferay.portal.kernel.exception.SystemException {
167 try {
168 MethodKey methodKey = new MethodKey(EmailAddressServiceUtil.class.getName(),
169 "getEmailAddresses", _getEmailAddressesParameterTypes3);
170
171 MethodHandler methodHandler = new MethodHandler(methodKey,
172 className, classPK);
173
174 Object returnObj = null;
175
176 try {
177 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
178 }
179 catch (Exception e) {
180 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
181 throw (com.liferay.portal.kernel.exception.PortalException)e;
182 }
183
184 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
185 throw (com.liferay.portal.kernel.exception.SystemException)e;
186 }
187
188 throw new com.liferay.portal.kernel.exception.SystemException(e);
189 }
190
191 return (java.util.List<com.liferay.portal.model.EmailAddress>)returnObj;
192 }
193 catch (com.liferay.portal.kernel.exception.SystemException se) {
194 _log.error(se, se);
195
196 throw se;
197 }
198 }
199
200 public static com.liferay.portal.model.EmailAddress updateEmailAddress(
201 HttpPrincipal httpPrincipal, long emailAddressId,
202 java.lang.String address, int typeId, boolean primary)
203 throws com.liferay.portal.kernel.exception.PortalException,
204 com.liferay.portal.kernel.exception.SystemException {
205 try {
206 MethodKey methodKey = new MethodKey(EmailAddressServiceUtil.class.getName(),
207 "updateEmailAddress", _updateEmailAddressParameterTypes4);
208
209 MethodHandler methodHandler = new MethodHandler(methodKey,
210 emailAddressId, address, typeId, primary);
211
212 Object returnObj = null;
213
214 try {
215 returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
216 }
217 catch (Exception e) {
218 if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
219 throw (com.liferay.portal.kernel.exception.PortalException)e;
220 }
221
222 if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
223 throw (com.liferay.portal.kernel.exception.SystemException)e;
224 }
225
226 throw new com.liferay.portal.kernel.exception.SystemException(e);
227 }
228
229 return (com.liferay.portal.model.EmailAddress)returnObj;
230 }
231 catch (com.liferay.portal.kernel.exception.SystemException se) {
232 _log.error(se, se);
233
234 throw se;
235 }
236 }
237
238 private static Log _log = LogFactoryUtil.getLog(EmailAddressServiceHttp.class);
239 private static final Class<?>[] _addEmailAddressParameterTypes0 = new Class[] {
240 java.lang.String.class, long.class, java.lang.String.class,
241 int.class, boolean.class
242 };
243 private static final Class<?>[] _deleteEmailAddressParameterTypes1 = new Class[] {
244 long.class
245 };
246 private static final Class<?>[] _getEmailAddressParameterTypes2 = new Class[] {
247 long.class
248 };
249 private static final Class<?>[] _getEmailAddressesParameterTypes3 = new Class[] {
250 java.lang.String.class, long.class
251 };
252 private static final Class<?>[] _updateEmailAddressParameterTypes4 = new Class[] {
253 long.class, java.lang.String.class, int.class, boolean.class
254 };
255 }