001    /**
002     * Copyright (c) 2000-2012 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                    throws com.liferay.portal.kernel.exception.PortalException,
115                            com.liferay.portal.kernel.exception.SystemException {
116                    try {
117                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
118                                            "addPasswordPolicy", _addPasswordPolicyParameterTypes1);
119    
120                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
121                                            description, changeable, changeRequired, minAge,
122                                            checkSyntax, allowDictionaryWords, minAlphanumeric,
123                                            minLength, minLowerCase, minNumbers, minSymbols,
124                                            minUpperCase, regex, history, historyCount, expireable,
125                                            maxAge, warningTime, graceLimit, lockout, maxFailure,
126                                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
127    
128                            Object returnObj = null;
129    
130                            try {
131                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
132                            }
133                            catch (Exception e) {
134                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
135                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
136                                    }
137    
138                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
139                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
140                                    }
141    
142                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
143                            }
144    
145                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
146                    }
147                    catch (com.liferay.portal.kernel.exception.SystemException se) {
148                            _log.error(se, se);
149    
150                            throw se;
151                    }
152            }
153    
154            public static void deletePasswordPolicy(HttpPrincipal httpPrincipal,
155                    long passwordPolicyId)
156                    throws com.liferay.portal.kernel.exception.PortalException,
157                            com.liferay.portal.kernel.exception.SystemException {
158                    try {
159                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
160                                            "deletePasswordPolicy", _deletePasswordPolicyParameterTypes2);
161    
162                            MethodHandler methodHandler = new MethodHandler(methodKey,
163                                            passwordPolicyId);
164    
165                            try {
166                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
167                            }
168                            catch (Exception e) {
169                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
170                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
171                                    }
172    
173                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
174                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
175                                    }
176    
177                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
178                            }
179                    }
180                    catch (com.liferay.portal.kernel.exception.SystemException se) {
181                            _log.error(se, se);
182    
183                            throw se;
184                    }
185            }
186    
187            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
188                    HttpPrincipal httpPrincipal, long passwordPolicyId,
189                    java.lang.String name, java.lang.String description,
190                    boolean changeable, boolean changeRequired, long minAge,
191                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
192                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
193                    int minUpperCase, boolean history, int historyCount,
194                    boolean expireable, long maxAge, long warningTime, int graceLimit,
195                    boolean lockout, int maxFailure, long lockoutDuration,
196                    long resetFailureCount, long resetTicketMaxAge)
197                    throws com.liferay.portal.kernel.exception.PortalException,
198                            com.liferay.portal.kernel.exception.SystemException {
199                    try {
200                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
201                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes3);
202    
203                            MethodHandler methodHandler = new MethodHandler(methodKey,
204                                            passwordPolicyId, name, description, changeable,
205                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
206                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
207                                            minSymbols, minUpperCase, history, historyCount,
208                                            expireable, maxAge, warningTime, graceLimit, lockout,
209                                            maxFailure, lockoutDuration, resetFailureCount,
210                                            resetTicketMaxAge);
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.PasswordPolicy)returnObj;
230                    }
231                    catch (com.liferay.portal.kernel.exception.SystemException se) {
232                            _log.error(se, se);
233    
234                            throw se;
235                    }
236            }
237    
238            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
239                    HttpPrincipal httpPrincipal, long passwordPolicyId,
240                    java.lang.String name, java.lang.String description,
241                    boolean changeable, boolean changeRequired, long minAge,
242                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
243                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
244                    int minUpperCase, java.lang.String regex, boolean history,
245                    int historyCount, boolean expireable, long maxAge, long warningTime,
246                    int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
247                    long resetFailureCount, long resetTicketMaxAge)
248                    throws com.liferay.portal.kernel.exception.PortalException,
249                            com.liferay.portal.kernel.exception.SystemException {
250                    try {
251                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
252                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes4);
253    
254                            MethodHandler methodHandler = new MethodHandler(methodKey,
255                                            passwordPolicyId, name, description, changeable,
256                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
257                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
258                                            minSymbols, minUpperCase, regex, history, historyCount,
259                                            expireable, maxAge, warningTime, graceLimit, lockout,
260                                            maxFailure, lockoutDuration, resetFailureCount,
261                                            resetTicketMaxAge);
262    
263                            Object returnObj = null;
264    
265                            try {
266                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
267                            }
268                            catch (Exception e) {
269                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
270                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
271                                    }
272    
273                                    if (e instanceof com.liferay.portal.kernel.exception.SystemException) {
274                                            throw (com.liferay.portal.kernel.exception.SystemException)e;
275                                    }
276    
277                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
278                            }
279    
280                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
281                    }
282                    catch (com.liferay.portal.kernel.exception.SystemException se) {
283                            _log.error(se, se);
284    
285                            throw se;
286                    }
287            }
288    
289            private static Log _log = LogFactoryUtil.getLog(PasswordPolicyServiceHttp.class);
290            private static final Class<?>[] _addPasswordPolicyParameterTypes0 = new Class[] {
291                            java.lang.String.class, java.lang.String.class, boolean.class,
292                            boolean.class, long.class, boolean.class, boolean.class, int.class,
293                            int.class, int.class, int.class, int.class, int.class, boolean.class,
294                            int.class, boolean.class, long.class, long.class, int.class,
295                            boolean.class, int.class, long.class, long.class, long.class
296                    };
297            private static final Class<?>[] _addPasswordPolicyParameterTypes1 = new Class[] {
298                            java.lang.String.class, java.lang.String.class, boolean.class,
299                            boolean.class, long.class, boolean.class, boolean.class, int.class,
300                            int.class, int.class, int.class, int.class, int.class,
301                            java.lang.String.class, boolean.class, int.class, boolean.class,
302                            long.class, long.class, int.class, boolean.class, int.class,
303                            long.class, long.class, long.class
304                    };
305            private static final Class<?>[] _deletePasswordPolicyParameterTypes2 = new Class[] {
306                            long.class
307                    };
308            private static final Class<?>[] _updatePasswordPolicyParameterTypes3 = new Class[] {
309                            long.class, java.lang.String.class, java.lang.String.class,
310                            boolean.class, boolean.class, long.class, boolean.class,
311                            boolean.class, int.class, int.class, int.class, int.class, int.class,
312                            int.class, boolean.class, int.class, boolean.class, long.class,
313                            long.class, int.class, boolean.class, int.class, long.class,
314                            long.class, long.class
315                    };
316            private static final Class<?>[] _updatePasswordPolicyParameterTypes4 = new Class[] {
317                            long.class, java.lang.String.class, java.lang.String.class,
318                            boolean.class, boolean.class, long.class, boolean.class,
319                            boolean.class, int.class, int.class, int.class, int.class, int.class,
320                            int.class, java.lang.String.class, boolean.class, int.class,
321                            boolean.class, long.class, long.class, int.class, boolean.class,
322                            int.class, long.class, long.class, long.class
323                    };
324    }