001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.log.Log;
020    import com.liferay.portal.kernel.log.LogFactoryUtil;
021    import com.liferay.portal.kernel.util.MethodHandler;
022    import com.liferay.portal.kernel.util.MethodKey;
023    import com.liferay.portal.security.auth.HttpPrincipal;
024    import com.liferay.portal.service.PasswordPolicyServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link com.liferay.portal.service.PasswordPolicyServiceUtil} service utility. The
029     * static methods of this class calls the same methods of the service utility.
030     * However, the signatures are different because it requires an additional
031     * {@link com.liferay.portal.security.auth.HttpPrincipal} parameter.
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    @ProviderType
055    public class PasswordPolicyServiceHttp {
056            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
057                    HttpPrincipal httpPrincipal, java.lang.String name,
058                    java.lang.String description, boolean changeable,
059                    boolean changeRequired, long minAge, boolean checkSyntax,
060                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
061                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
062                    boolean history, int historyCount, boolean expireable, long maxAge,
063                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
064                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
065                    throws com.liferay.portal.kernel.exception.PortalException {
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                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
089                            }
090    
091                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
092                    }
093                    catch (com.liferay.portal.kernel.exception.SystemException se) {
094                            _log.error(se, se);
095    
096                            throw se;
097                    }
098            }
099    
100            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
101                    HttpPrincipal httpPrincipal, java.lang.String name,
102                    java.lang.String description, boolean changeable,
103                    boolean changeRequired, long minAge, boolean checkSyntax,
104                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
105                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
106                    java.lang.String regex, boolean history, int historyCount,
107                    boolean expireable, long maxAge, long warningTime, int graceLimit,
108                    boolean lockout, int maxFailure, long lockoutDuration,
109                    long resetFailureCount, long resetTicketMaxAge,
110                    com.liferay.portal.service.ServiceContext serviceContext)
111                    throws com.liferay.portal.kernel.exception.PortalException {
112                    try {
113                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
114                                            "addPasswordPolicy", _addPasswordPolicyParameterTypes1);
115    
116                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
117                                            description, changeable, changeRequired, minAge,
118                                            checkSyntax, allowDictionaryWords, minAlphanumeric,
119                                            minLength, minLowerCase, minNumbers, minSymbols,
120                                            minUpperCase, regex, history, historyCount, expireable,
121                                            maxAge, warningTime, graceLimit, lockout, maxFailure,
122                                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
123                                            serviceContext);
124    
125                            Object returnObj = null;
126    
127                            try {
128                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
129                            }
130                            catch (Exception e) {
131                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
132                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
133                                    }
134    
135                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
136                            }
137    
138                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
139                    }
140                    catch (com.liferay.portal.kernel.exception.SystemException se) {
141                            _log.error(se, se);
142    
143                            throw se;
144                    }
145            }
146    
147            public static void deletePasswordPolicy(HttpPrincipal httpPrincipal,
148                    long passwordPolicyId)
149                    throws com.liferay.portal.kernel.exception.PortalException {
150                    try {
151                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
152                                            "deletePasswordPolicy", _deletePasswordPolicyParameterTypes2);
153    
154                            MethodHandler methodHandler = new MethodHandler(methodKey,
155                                            passwordPolicyId);
156    
157                            try {
158                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
159                            }
160                            catch (Exception e) {
161                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
162                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
163                                    }
164    
165                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
166                            }
167                    }
168                    catch (com.liferay.portal.kernel.exception.SystemException se) {
169                            _log.error(se, se);
170    
171                            throw se;
172                    }
173            }
174    
175            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
176                    HttpPrincipal httpPrincipal, long passwordPolicyId,
177                    java.lang.String name, java.lang.String description,
178                    boolean changeable, boolean changeRequired, long minAge,
179                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
180                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
181                    int minUpperCase, boolean history, int historyCount,
182                    boolean expireable, long maxAge, long warningTime, int graceLimit,
183                    boolean lockout, int maxFailure, long lockoutDuration,
184                    long resetFailureCount, long resetTicketMaxAge)
185                    throws com.liferay.portal.kernel.exception.PortalException {
186                    try {
187                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
188                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes3);
189    
190                            MethodHandler methodHandler = new MethodHandler(methodKey,
191                                            passwordPolicyId, name, description, changeable,
192                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
193                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
194                                            minSymbols, minUpperCase, history, historyCount,
195                                            expireable, maxAge, warningTime, graceLimit, lockout,
196                                            maxFailure, lockoutDuration, resetFailureCount,
197                                            resetTicketMaxAge);
198    
199                            Object returnObj = null;
200    
201                            try {
202                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
203                            }
204                            catch (Exception e) {
205                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
206                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
207                                    }
208    
209                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
210                            }
211    
212                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
213                    }
214                    catch (com.liferay.portal.kernel.exception.SystemException se) {
215                            _log.error(se, se);
216    
217                            throw se;
218                    }
219            }
220    
221            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
222                    HttpPrincipal httpPrincipal, long passwordPolicyId,
223                    java.lang.String name, java.lang.String description,
224                    boolean changeable, boolean changeRequired, long minAge,
225                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
226                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
227                    int minUpperCase, java.lang.String regex, boolean history,
228                    int historyCount, boolean expireable, long maxAge, long warningTime,
229                    int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
230                    long resetFailureCount, long resetTicketMaxAge,
231                    com.liferay.portal.service.ServiceContext serviceContext)
232                    throws com.liferay.portal.kernel.exception.PortalException {
233                    try {
234                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
235                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes4);
236    
237                            MethodHandler methodHandler = new MethodHandler(methodKey,
238                                            passwordPolicyId, name, description, changeable,
239                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
240                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
241                                            minSymbols, minUpperCase, regex, history, historyCount,
242                                            expireable, maxAge, warningTime, graceLimit, lockout,
243                                            maxFailure, lockoutDuration, resetFailureCount,
244                                            resetTicketMaxAge, serviceContext);
245    
246                            Object returnObj = null;
247    
248                            try {
249                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
250                            }
251                            catch (Exception e) {
252                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
253                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
254                                    }
255    
256                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
257                            }
258    
259                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
260                    }
261                    catch (com.liferay.portal.kernel.exception.SystemException se) {
262                            _log.error(se, se);
263    
264                            throw se;
265                    }
266            }
267    
268            private static Log _log = LogFactoryUtil.getLog(PasswordPolicyServiceHttp.class);
269            private static final Class<?>[] _addPasswordPolicyParameterTypes0 = new Class[] {
270                            java.lang.String.class, java.lang.String.class, boolean.class,
271                            boolean.class, long.class, boolean.class, boolean.class, int.class,
272                            int.class, int.class, int.class, int.class, int.class, boolean.class,
273                            int.class, boolean.class, long.class, long.class, int.class,
274                            boolean.class, int.class, long.class, long.class, long.class
275                    };
276            private static final Class<?>[] _addPasswordPolicyParameterTypes1 = new Class[] {
277                            java.lang.String.class, java.lang.String.class, boolean.class,
278                            boolean.class, long.class, boolean.class, boolean.class, int.class,
279                            int.class, int.class, int.class, int.class, int.class,
280                            java.lang.String.class, boolean.class, int.class, boolean.class,
281                            long.class, long.class, int.class, boolean.class, int.class,
282                            long.class, long.class, long.class,
283                            com.liferay.portal.service.ServiceContext.class
284                    };
285            private static final Class<?>[] _deletePasswordPolicyParameterTypes2 = new Class[] {
286                            long.class
287                    };
288            private static final Class<?>[] _updatePasswordPolicyParameterTypes3 = new Class[] {
289                            long.class, java.lang.String.class, java.lang.String.class,
290                            boolean.class, boolean.class, long.class, boolean.class,
291                            boolean.class, int.class, int.class, int.class, int.class, int.class,
292                            int.class, boolean.class, int.class, boolean.class, long.class,
293                            long.class, int.class, boolean.class, int.class, long.class,
294                            long.class, long.class
295                    };
296            private static final Class<?>[] _updatePasswordPolicyParameterTypes4 = new Class[] {
297                            long.class, java.lang.String.class, java.lang.String.class,
298                            boolean.class, boolean.class, long.class, boolean.class,
299                            boolean.class, int.class, int.class, int.class, int.class, int.class,
300                            int.class, java.lang.String.class, boolean.class, int.class,
301                            boolean.class, long.class, long.class, int.class, boolean.class,
302                            int.class, long.class, long.class, long.class,
303                            com.liferay.portal.service.ServiceContext.class
304                    };
305    }