001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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.PasswordPolicyServiceUtil;
023    
024    /**
025     * <p>
026     * This class provides a HTTP utility for the
027     * {@link com.liferay.portal.service.PasswordPolicyServiceUtil} service utility. The
028     * static methods of this class calls the same methods of the service utility.
029     * However, the signatures are different because it requires an additional
030     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
031     * </p>
032     *
033     * <p>
034     * The benefits of using the HTTP utility is that it is fast and allows for
035     * tunneling without the cost of serializing to text. The drawback is that it
036     * only works with Java.
037     * </p>
038     *
039     * <p>
040     * Set the property <b>tunnel.servlet.hosts.allowed</b> in portal.properties to
041     * configure security.
042     * </p>
043     *
044     * <p>
045     * The HTTP utility is only generated for remote services.
046     * </p>
047     *
048     * @author    Brian Wing Shun Chan
049     * @see       PasswordPolicyServiceSoap
050     * @see       com.liferay.portal.security.auth.HttpPrincipal
051     * @see       com.liferay.portal.service.PasswordPolicyServiceUtil
052     * @generated
053     */
054    public class PasswordPolicyServiceHttp {
055            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
056                    HttpPrincipal httpPrincipal, java.lang.String name,
057                    java.lang.String description, boolean changeable,
058                    boolean changeRequired, long minAge, boolean checkSyntax,
059                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
060                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
061                    boolean history, int historyCount, boolean expireable, long maxAge,
062                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
063                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
064                    throws com.liferay.portal.kernel.exception.PortalException,
065                            com.liferay.portal.kernel.exception.SystemException {
066                    try {
067                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
068                                            "addPasswordPolicy", _addPasswordPolicyParameterTypes0);
069    
070                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
071                                            description, changeable, changeRequired, minAge,
072                                            checkSyntax, allowDictionaryWords, minAlphanumeric,
073                                            minLength, minLowerCase, minNumbers, minSymbols,
074                                            minUpperCase, history, historyCount, expireable, maxAge,
075                                            warningTime, graceLimit, lockout, maxFailure,
076                                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
077    
078                            Object returnObj = null;
079    
080                            try {
081                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
082                            }
083                            catch (Exception e) {
084                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
085                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
086                                    }
087    
088                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
089                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
090                                    }
091    
092                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
093                            }
094    
095                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
096                    }
097                    catch (com.liferay.portal.kernel.exception.SystemException se) {
098                            _log.error(se, se);
099    
100                            throw se;
101                    }
102            }
103    
104            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
105                    HttpPrincipal httpPrincipal, java.lang.String name,
106                    java.lang.String description, boolean changeable,
107                    boolean changeRequired, long minAge, boolean checkSyntax,
108                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
109                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
110                    java.lang.String regex, boolean history, int historyCount,
111                    boolean expireable, long maxAge, long warningTime, int graceLimit,
112                    boolean lockout, int maxFailure, long lockoutDuration,
113                    long resetFailureCount, long resetTicketMaxAge,
114                    com.liferay.portal.service.ServiceContext serviceContext)
115                    throws com.liferay.portal.kernel.exception.PortalException,
116                            com.liferay.portal.kernel.exception.SystemException {
117                    try {
118                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
119                                            "addPasswordPolicy", _addPasswordPolicyParameterTypes1);
120    
121                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
122                                            description, changeable, changeRequired, minAge,
123                                            checkSyntax, allowDictionaryWords, minAlphanumeric,
124                                            minLength, minLowerCase, minNumbers, minSymbols,
125                                            minUpperCase, regex, history, historyCount, expireable,
126                                            maxAge, warningTime, graceLimit, lockout, maxFailure,
127                                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
128                                            serviceContext);
129    
130                            Object returnObj = null;
131    
132                            try {
133                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
134                            }
135                            catch (Exception e) {
136                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
137                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
138                                    }
139    
140                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
141                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
142                                    }
143    
144                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
145                            }
146    
147                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
148                    }
149                    catch (com.liferay.portal.kernel.exception.SystemException se) {
150                            _log.error(se, se);
151    
152                            throw se;
153                    }
154            }
155    
156            public static void deletePasswordPolicy(HttpPrincipal httpPrincipal,
157                    long passwordPolicyId)
158                    throws com.liferay.portal.kernel.exception.PortalException,
159                            com.liferay.portal.kernel.exception.SystemException {
160                    try {
161                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
162                                            "deletePasswordPolicy", _deletePasswordPolicyParameterTypes2);
163    
164                            MethodHandler methodHandler = new MethodHandler(methodKey,
165                                            passwordPolicyId);
166    
167                            try {
168                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
169                            }
170                            catch (Exception e) {
171                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
172                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
173                                    }
174    
175                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
176                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
177                                    }
178    
179                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
180                            }
181                    }
182                    catch (com.liferay.portal.kernel.exception.SystemException se) {
183                            _log.error(se, se);
184    
185                            throw se;
186                    }
187            }
188    
189            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
190                    HttpPrincipal httpPrincipal, long passwordPolicyId,
191                    java.lang.String name, java.lang.String description,
192                    boolean changeable, boolean changeRequired, long minAge,
193                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
194                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
195                    int minUpperCase, boolean history, int historyCount,
196                    boolean expireable, long maxAge, long warningTime, int graceLimit,
197                    boolean lockout, int maxFailure, long lockoutDuration,
198                    long resetFailureCount, long resetTicketMaxAge)
199                    throws com.liferay.portal.kernel.exception.PortalException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    try {
202                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
203                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes3);
204    
205                            MethodHandler methodHandler = new MethodHandler(methodKey,
206                                            passwordPolicyId, name, description, changeable,
207                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
208                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
209                                            minSymbols, minUpperCase, history, historyCount,
210                                            expireable, maxAge, warningTime, graceLimit, lockout,
211                                            maxFailure, lockoutDuration, resetFailureCount,
212                                            resetTicketMaxAge);
213    
214                            Object returnObj = null;
215    
216                            try {
217                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
218                            }
219                            catch (Exception e) {
220                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
221                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
222                                    }
223    
224                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
225                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
226                                    }
227    
228                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
229                            }
230    
231                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
232                    }
233                    catch (com.liferay.portal.kernel.exception.SystemException se) {
234                            _log.error(se, se);
235    
236                            throw se;
237                    }
238            }
239    
240            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
241                    HttpPrincipal httpPrincipal, long passwordPolicyId,
242                    java.lang.String name, java.lang.String description,
243                    boolean changeable, boolean changeRequired, long minAge,
244                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
245                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
246                    int minUpperCase, java.lang.String regex, boolean history,
247                    int historyCount, boolean expireable, long maxAge, long warningTime,
248                    int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
249                    long resetFailureCount, long resetTicketMaxAge,
250                    com.liferay.portal.service.ServiceContext serviceContext)
251                    throws com.liferay.portal.kernel.exception.PortalException,
252                            com.liferay.portal.kernel.exception.SystemException {
253                    try {
254                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
255                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes4);
256    
257                            MethodHandler methodHandler = new MethodHandler(methodKey,
258                                            passwordPolicyId, name, description, changeable,
259                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
260                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
261                                            minSymbols, minUpperCase, regex, history, historyCount,
262                                            expireable, maxAge, warningTime, graceLimit, lockout,
263                                            maxFailure, lockoutDuration, resetFailureCount,
264                                            resetTicketMaxAge, serviceContext);
265    
266                            Object returnObj = null;
267    
268                            try {
269                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
270                            }
271                            catch (Exception e) {
272                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
273                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
274                                    }
275    
276                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
277                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
278                                    }
279    
280                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
281                            }
282    
283                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
284                    }
285                    catch (com.liferay.portal.kernel.exception.SystemException se) {
286                            _log.error(se, se);
287    
288                            throw se;
289                    }
290            }
291    
292            private static Log _log = LogFactoryUtil.getLog(PasswordPolicyServiceHttp.class);
293            private static final Class<?>[] _addPasswordPolicyParameterTypes0 = new Class[] {
294                            java.lang.String.class, java.lang.String.class, boolean.class,
295                            boolean.class, long.class, boolean.class, boolean.class, int.class,
296                            int.class, int.class, int.class, int.class, int.class, boolean.class,
297                            int.class, boolean.class, long.class, long.class, int.class,
298                            boolean.class, int.class, long.class, long.class, long.class
299                    };
300            private static final Class<?>[] _addPasswordPolicyParameterTypes1 = new Class[] {
301                            java.lang.String.class, java.lang.String.class, boolean.class,
302                            boolean.class, long.class, boolean.class, boolean.class, int.class,
303                            int.class, int.class, int.class, int.class, int.class,
304                            java.lang.String.class, boolean.class, int.class, boolean.class,
305                            long.class, long.class, int.class, boolean.class, int.class,
306                            long.class, long.class, long.class,
307                            com.liferay.portal.service.ServiceContext.class
308                    };
309            private static final Class<?>[] _deletePasswordPolicyParameterTypes2 = new Class[] {
310                            long.class
311                    };
312            private static final Class<?>[] _updatePasswordPolicyParameterTypes3 = new Class[] {
313                            long.class, java.lang.String.class, java.lang.String.class,
314                            boolean.class, boolean.class, long.class, boolean.class,
315                            boolean.class, int.class, int.class, int.class, int.class, int.class,
316                            int.class, boolean.class, int.class, boolean.class, long.class,
317                            long.class, int.class, boolean.class, int.class, long.class,
318                            long.class, long.class
319                    };
320            private static final Class<?>[] _updatePasswordPolicyParameterTypes4 = new Class[] {
321                            long.class, java.lang.String.class, java.lang.String.class,
322                            boolean.class, boolean.class, long.class, boolean.class,
323                            boolean.class, int.class, int.class, int.class, int.class, int.class,
324                            int.class, java.lang.String.class, boolean.class, int.class,
325                            boolean.class, long.class, long.class, int.class, boolean.class,
326                            int.class, long.class, long.class, long.class,
327                            com.liferay.portal.service.ServiceContext.class
328                    };
329    }