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;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the password policy local service. This utility wraps {@link com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see PasswordPolicyLocalService
030     * @see com.liferay.portal.service.base.PasswordPolicyLocalServiceBaseImpl
031     * @see com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl
032     * @generated
033     */
034    public class PasswordPolicyLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the password policy to the database. Also notifies the appropriate model listeners.
043            *
044            * @param passwordPolicy the password policy
045            * @return the password policy that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
049                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addPasswordPolicy(passwordPolicy);
052            }
053    
054            /**
055            * Creates a new password policy with the primary key. Does not add the password policy to the database.
056            *
057            * @param passwordPolicyId the primary key for the new password policy
058            * @return the new password policy
059            */
060            public static com.liferay.portal.model.PasswordPolicy createPasswordPolicy(
061                    long passwordPolicyId) {
062                    return getService().createPasswordPolicy(passwordPolicyId);
063            }
064    
065            /**
066            * Deletes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param passwordPolicyId the primary key of the password policy
069            * @throws PortalException if a password policy with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deletePasswordPolicy(long passwordPolicyId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deletePasswordPolicy(passwordPolicyId);
076            }
077    
078            /**
079            * Deletes the password policy from the database. Also notifies the appropriate model listeners.
080            *
081            * @param passwordPolicy the password policy
082            * @throws PortalException
083            * @throws SystemException if a system exception occurred
084            */
085            public static void deletePasswordPolicy(
086                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
087                    throws com.liferay.portal.kernel.exception.PortalException,
088                            com.liferay.portal.kernel.exception.SystemException {
089                    getService().deletePasswordPolicy(passwordPolicy);
090            }
091    
092            /**
093            * Performs a dynamic query on the database and returns the matching rows.
094            *
095            * @param dynamicQuery the dynamic query
096            * @return the matching rows
097            * @throws SystemException if a system exception occurred
098            */
099            @SuppressWarnings("rawtypes")
100            public static java.util.List dynamicQuery(
101                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
102                    throws com.liferay.portal.kernel.exception.SystemException {
103                    return getService().dynamicQuery(dynamicQuery);
104            }
105    
106            /**
107            * Performs a dynamic query on the database and returns a range of the matching rows.
108            *
109            * <p>
110            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
111            * </p>
112            *
113            * @param dynamicQuery the dynamic query
114            * @param start the lower bound of the range of model instances
115            * @param end the upper bound of the range of model instances (not inclusive)
116            * @return the range of matching rows
117            * @throws SystemException if a system exception occurred
118            */
119            @SuppressWarnings("rawtypes")
120            public static java.util.List dynamicQuery(
121                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
122                    int end) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getService().dynamicQuery(dynamicQuery, start, end);
124            }
125    
126            /**
127            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
128            *
129            * <p>
130            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
131            * </p>
132            *
133            * @param dynamicQuery the dynamic query
134            * @param start the lower bound of the range of model instances
135            * @param end the upper bound of the range of model instances (not inclusive)
136            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
137            * @return the ordered range of matching rows
138            * @throws SystemException if a system exception occurred
139            */
140            @SuppressWarnings("rawtypes")
141            public static java.util.List dynamicQuery(
142                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
143                    int end,
144                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
145                    throws com.liferay.portal.kernel.exception.SystemException {
146                    return getService()
147                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
148            }
149    
150            /**
151            * Returns the number of rows that match the dynamic query.
152            *
153            * @param dynamicQuery the dynamic query
154            * @return the number of rows that match the dynamic query
155            * @throws SystemException if a system exception occurred
156            */
157            public static long dynamicQueryCount(
158                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
159                    throws com.liferay.portal.kernel.exception.SystemException {
160                    return getService().dynamicQueryCount(dynamicQuery);
161            }
162    
163            public static com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
164                    long passwordPolicyId)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getService().fetchPasswordPolicy(passwordPolicyId);
167            }
168    
169            /**
170            * Returns the password policy with the primary key.
171            *
172            * @param passwordPolicyId the primary key of the password policy
173            * @return the password policy
174            * @throws PortalException if a password policy with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
178                    long passwordPolicyId)
179                    throws com.liferay.portal.kernel.exception.PortalException,
180                            com.liferay.portal.kernel.exception.SystemException {
181                    return getService().getPasswordPolicy(passwordPolicyId);
182            }
183    
184            public static com.liferay.portal.model.PersistedModel getPersistedModel(
185                    java.io.Serializable primaryKeyObj)
186                    throws com.liferay.portal.kernel.exception.PortalException,
187                            com.liferay.portal.kernel.exception.SystemException {
188                    return getService().getPersistedModel(primaryKeyObj);
189            }
190    
191            /**
192            * Returns a range of all the password policies.
193            *
194            * <p>
195            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
196            * </p>
197            *
198            * @param start the lower bound of the range of password policies
199            * @param end the upper bound of the range of password policies (not inclusive)
200            * @return the range of password policies
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portal.model.PasswordPolicy> getPasswordPolicies(
204                    int start, int end)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getService().getPasswordPolicies(start, end);
207            }
208    
209            /**
210            * Returns the number of password policies.
211            *
212            * @return the number of password policies
213            * @throws SystemException if a system exception occurred
214            */
215            public static int getPasswordPoliciesCount()
216                    throws com.liferay.portal.kernel.exception.SystemException {
217                    return getService().getPasswordPoliciesCount();
218            }
219    
220            /**
221            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
222            *
223            * @param passwordPolicy the password policy
224            * @return the password policy that was updated
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
228                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
229                    throws com.liferay.portal.kernel.exception.SystemException {
230                    return getService().updatePasswordPolicy(passwordPolicy);
231            }
232    
233            /**
234            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
235            *
236            * @param passwordPolicy the password policy
237            * @param merge whether to merge the password policy with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
238            * @return the password policy that was updated
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
242                    com.liferay.portal.model.PasswordPolicy passwordPolicy, boolean merge)
243                    throws com.liferay.portal.kernel.exception.SystemException {
244                    return getService().updatePasswordPolicy(passwordPolicy, merge);
245            }
246    
247            /**
248            * Returns the Spring bean ID for this bean.
249            *
250            * @return the Spring bean ID for this bean
251            */
252            public static java.lang.String getBeanIdentifier() {
253                    return getService().getBeanIdentifier();
254            }
255    
256            /**
257            * Sets the Spring bean ID for this bean.
258            *
259            * @param beanIdentifier the Spring bean ID for this bean
260            */
261            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
262                    getService().setBeanIdentifier(beanIdentifier);
263            }
264    
265            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
266                    long userId, boolean defaultPolicy, java.lang.String name,
267                    java.lang.String description, boolean changeable,
268                    boolean changeRequired, long minAge, boolean checkSyntax,
269                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
270                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
271                    boolean history, int historyCount, boolean expireable, long maxAge,
272                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
273                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
274                    throws com.liferay.portal.kernel.exception.PortalException,
275                            com.liferay.portal.kernel.exception.SystemException {
276                    return getService()
277                                       .addPasswordPolicy(userId, defaultPolicy, name, description,
278                            changeable, changeRequired, minAge, checkSyntax,
279                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
280                            minNumbers, minSymbols, minUpperCase, history, historyCount,
281                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
282                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
283            }
284    
285            public static void checkDefaultPasswordPolicy(long companyId)
286                    throws com.liferay.portal.kernel.exception.PortalException,
287                            com.liferay.portal.kernel.exception.SystemException {
288                    getService().checkDefaultPasswordPolicy(companyId);
289            }
290    
291            public static com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
292                    long companyId)
293                    throws com.liferay.portal.kernel.exception.PortalException,
294                            com.liferay.portal.kernel.exception.SystemException {
295                    return getService().getDefaultPasswordPolicy(companyId);
296            }
297    
298            /**
299            * @deprecated
300            */
301            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
302                    long companyId, long organizationId, long locationId)
303                    throws com.liferay.portal.kernel.exception.PortalException,
304                            com.liferay.portal.kernel.exception.SystemException {
305                    return getService()
306                                       .getPasswordPolicy(companyId, organizationId, locationId);
307            }
308    
309            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
310                    long companyId, long[] organizationIds)
311                    throws com.liferay.portal.kernel.exception.PortalException,
312                            com.liferay.portal.kernel.exception.SystemException {
313                    return getService().getPasswordPolicy(companyId, organizationIds);
314            }
315    
316            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
317                    long userId)
318                    throws com.liferay.portal.kernel.exception.PortalException,
319                            com.liferay.portal.kernel.exception.SystemException {
320                    return getService().getPasswordPolicyByUserId(userId);
321            }
322    
323            public static java.util.List<com.liferay.portal.model.PasswordPolicy> search(
324                    long companyId, java.lang.String name, int start, int end,
325                    com.liferay.portal.kernel.util.OrderByComparator obc)
326                    throws com.liferay.portal.kernel.exception.SystemException {
327                    return getService().search(companyId, name, start, end, obc);
328            }
329    
330            public static int searchCount(long companyId, java.lang.String name)
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return getService().searchCount(companyId, name);
333            }
334    
335            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
336                    long passwordPolicyId, java.lang.String name,
337                    java.lang.String description, boolean changeable,
338                    boolean changeRequired, long minAge, boolean checkSyntax,
339                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
340                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
341                    boolean history, int historyCount, boolean expireable, long maxAge,
342                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
343                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
344                    throws com.liferay.portal.kernel.exception.PortalException,
345                            com.liferay.portal.kernel.exception.SystemException {
346                    return getService()
347                                       .updatePasswordPolicy(passwordPolicyId, name, description,
348                            changeable, changeRequired, minAge, checkSyntax,
349                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
350                            minNumbers, minSymbols, minUpperCase, history, historyCount,
351                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
352                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
353            }
354    
355            public static PasswordPolicyLocalService getService() {
356                    if (_service == null) {
357                            _service = (PasswordPolicyLocalService)PortalBeanLocatorUtil.locate(PasswordPolicyLocalService.class.getName());
358    
359                            ReferenceRegistry.registerReference(PasswordPolicyLocalServiceUtil.class,
360                                    "_service");
361                            MethodCache.remove(PasswordPolicyLocalService.class);
362                    }
363    
364                    return _service;
365            }
366    
367            public void setService(PasswordPolicyLocalService service) {
368                    MethodCache.remove(PasswordPolicyLocalService.class);
369    
370                    _service = service;
371    
372                    ReferenceRegistry.registerReference(PasswordPolicyLocalServiceUtil.class,
373                            "_service");
374                    MethodCache.remove(PasswordPolicyLocalService.class);
375            }
376    
377            private static PasswordPolicyLocalService _service;
378    }