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.security.auth.HttpPrincipal;
022    import com.liferay.portal.kernel.util.MethodHandler;
023    import com.liferay.portal.kernel.util.MethodKey;
024    import com.liferay.portal.service.PasswordPolicyServiceUtil;
025    
026    /**
027     * Provides the HTTP utility for the
028     * {@link 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 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 HttpPrincipal
051     * @see 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                    java.lang.String regex, boolean history, int historyCount,
063                    boolean expireable, long maxAge, long warningTime, int graceLimit,
064                    boolean lockout, int maxFailure, long lockoutDuration,
065                    long resetFailureCount, long resetTicketMaxAge,
066                    com.liferay.portal.service.ServiceContext serviceContext)
067                    throws com.liferay.portal.kernel.exception.PortalException {
068                    try {
069                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
070                                            "addPasswordPolicy", _addPasswordPolicyParameterTypes0);
071    
072                            MethodHandler methodHandler = new MethodHandler(methodKey, name,
073                                            description, changeable, changeRequired, minAge,
074                                            checkSyntax, allowDictionaryWords, minAlphanumeric,
075                                            minLength, minLowerCase, minNumbers, minSymbols,
076                                            minUpperCase, regex, history, historyCount, expireable,
077                                            maxAge, warningTime, graceLimit, lockout, maxFailure,
078                                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
079                                            serviceContext);
080    
081                            Object returnObj = null;
082    
083                            try {
084                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
085                            }
086                            catch (Exception e) {
087                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
088                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
089                                    }
090    
091                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
092                            }
093    
094                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
095                    }
096                    catch (com.liferay.portal.kernel.exception.SystemException se) {
097                            _log.error(se, se);
098    
099                            throw se;
100                    }
101            }
102    
103            public static void deletePasswordPolicy(HttpPrincipal httpPrincipal,
104                    long passwordPolicyId)
105                    throws com.liferay.portal.kernel.exception.PortalException {
106                    try {
107                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
108                                            "deletePasswordPolicy", _deletePasswordPolicyParameterTypes1);
109    
110                            MethodHandler methodHandler = new MethodHandler(methodKey,
111                                            passwordPolicyId);
112    
113                            try {
114                                    TunnelUtil.invoke(httpPrincipal, methodHandler);
115                            }
116                            catch (Exception e) {
117                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
118                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
119                                    }
120    
121                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
122                            }
123                    }
124                    catch (com.liferay.portal.kernel.exception.SystemException se) {
125                            _log.error(se, se);
126    
127                            throw se;
128                    }
129            }
130    
131            public static com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
132                    HttpPrincipal httpPrincipal, long passwordPolicyId)
133                    throws com.liferay.portal.kernel.exception.PortalException {
134                    try {
135                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
136                                            "fetchPasswordPolicy", _fetchPasswordPolicyParameterTypes2);
137    
138                            MethodHandler methodHandler = new MethodHandler(methodKey,
139                                            passwordPolicyId);
140    
141                            Object returnObj = null;
142    
143                            try {
144                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
145                            }
146                            catch (Exception e) {
147                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
148                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
149                                    }
150    
151                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
152                            }
153    
154                            return (com.liferay.portal.model.PasswordPolicy)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 com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
164                    HttpPrincipal httpPrincipal, long passwordPolicyId,
165                    java.lang.String name, java.lang.String description,
166                    boolean changeable, boolean changeRequired, long minAge,
167                    boolean checkSyntax, boolean allowDictionaryWords, int minAlphanumeric,
168                    int minLength, int minLowerCase, int minNumbers, int minSymbols,
169                    int minUpperCase, java.lang.String regex, boolean history,
170                    int historyCount, boolean expireable, long maxAge, long warningTime,
171                    int graceLimit, boolean lockout, int maxFailure, long lockoutDuration,
172                    long resetFailureCount, long resetTicketMaxAge,
173                    com.liferay.portal.service.ServiceContext serviceContext)
174                    throws com.liferay.portal.kernel.exception.PortalException {
175                    try {
176                            MethodKey methodKey = new MethodKey(PasswordPolicyServiceUtil.class,
177                                            "updatePasswordPolicy", _updatePasswordPolicyParameterTypes3);
178    
179                            MethodHandler methodHandler = new MethodHandler(methodKey,
180                                            passwordPolicyId, name, description, changeable,
181                                            changeRequired, minAge, checkSyntax, allowDictionaryWords,
182                                            minAlphanumeric, minLength, minLowerCase, minNumbers,
183                                            minSymbols, minUpperCase, regex, history, historyCount,
184                                            expireable, maxAge, warningTime, graceLimit, lockout,
185                                            maxFailure, lockoutDuration, resetFailureCount,
186                                            resetTicketMaxAge, serviceContext);
187    
188                            Object returnObj = null;
189    
190                            try {
191                                    returnObj = TunnelUtil.invoke(httpPrincipal, methodHandler);
192                            }
193                            catch (Exception e) {
194                                    if (e instanceof com.liferay.portal.kernel.exception.PortalException) {
195                                            throw (com.liferay.portal.kernel.exception.PortalException)e;
196                                    }
197    
198                                    throw new com.liferay.portal.kernel.exception.SystemException(e);
199                            }
200    
201                            return (com.liferay.portal.model.PasswordPolicy)returnObj;
202                    }
203                    catch (com.liferay.portal.kernel.exception.SystemException se) {
204                            _log.error(se, se);
205    
206                            throw se;
207                    }
208            }
209    
210            private static Log _log = LogFactoryUtil.getLog(PasswordPolicyServiceHttp.class);
211            private static final Class<?>[] _addPasswordPolicyParameterTypes0 = new Class[] {
212                            java.lang.String.class, java.lang.String.class, boolean.class,
213                            boolean.class, long.class, boolean.class, boolean.class, int.class,
214                            int.class, int.class, int.class, int.class, int.class,
215                            java.lang.String.class, boolean.class, int.class, boolean.class,
216                            long.class, long.class, int.class, boolean.class, int.class,
217                            long.class, long.class, long.class,
218                            com.liferay.portal.service.ServiceContext.class
219                    };
220            private static final Class<?>[] _deletePasswordPolicyParameterTypes1 = new Class[] {
221                            long.class
222                    };
223            private static final Class<?>[] _fetchPasswordPolicyParameterTypes2 = new Class[] {
224                            long.class
225                    };
226            private static final Class<?>[] _updatePasswordPolicyParameterTypes3 = new Class[] {
227                            long.class, java.lang.String.class, java.lang.String.class,
228                            boolean.class, boolean.class, long.class, boolean.class,
229                            boolean.class, int.class, int.class, int.class, int.class, int.class,
230                            int.class, java.lang.String.class, boolean.class, int.class,
231                            boolean.class, long.class, long.class, int.class, boolean.class,
232                            int.class, long.class, long.class, long.class,
233                            com.liferay.portal.service.ServiceContext.class
234                    };
235    }