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;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for PasswordPolicy. This utility wraps
024     * {@link com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see PasswordPolicyLocalService
032     * @see com.liferay.portal.service.base.PasswordPolicyLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class PasswordPolicyLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.PasswordPolicyLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the password policy to the database. Also notifies the appropriate model listeners.
046            *
047            * @param passwordPolicy the password policy
048            * @return the password policy that was added
049            */
050            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
051                    com.liferay.portal.model.PasswordPolicy passwordPolicy) {
052                    return getService().addPasswordPolicy(passwordPolicy);
053            }
054    
055            /**
056            * @deprecated As of 6.2.0, replaced by {@link #addPasswordPolicy(long,
057            boolean, String, String, boolean, boolean, long, boolean,
058            boolean, int, int, int, int, int, int, String, boolean, int,
059            boolean, long, long, int, boolean, int, long, long, long,
060            ServiceContext)}
061            */
062            @Deprecated
063            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
064                    long userId, boolean defaultPolicy, java.lang.String name,
065                    java.lang.String description, boolean changeable,
066                    boolean changeRequired, long minAge, boolean checkSyntax,
067                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
068                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
069                    boolean history, int historyCount, boolean expireable, long maxAge,
070                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
071                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
072                    throws com.liferay.portal.kernel.exception.PortalException {
073                    return getService()
074                                       .addPasswordPolicy(userId, defaultPolicy, name, description,
075                            changeable, changeRequired, minAge, checkSyntax,
076                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
077                            minNumbers, minSymbols, minUpperCase, history, historyCount,
078                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
079                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
080            }
081    
082            public static com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
083                    long userId, boolean defaultPolicy, java.lang.String name,
084                    java.lang.String description, boolean changeable,
085                    boolean changeRequired, long minAge, boolean checkSyntax,
086                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
087                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
088                    java.lang.String regex, boolean history, int historyCount,
089                    boolean expireable, long maxAge, long warningTime, int graceLimit,
090                    boolean lockout, int maxFailure, long lockoutDuration,
091                    long resetFailureCount, long resetTicketMaxAge,
092                    com.liferay.portal.service.ServiceContext serviceContext)
093                    throws com.liferay.portal.kernel.exception.PortalException {
094                    return getService()
095                                       .addPasswordPolicy(userId, defaultPolicy, name, description,
096                            changeable, changeRequired, minAge, checkSyntax,
097                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
098                            minNumbers, minSymbols, minUpperCase, regex, history, historyCount,
099                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
100                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
101                            serviceContext);
102            }
103    
104            public static void checkDefaultPasswordPolicy(long companyId)
105                    throws com.liferay.portal.kernel.exception.PortalException {
106                    getService().checkDefaultPasswordPolicy(companyId);
107            }
108    
109            /**
110            * Creates a new password policy with the primary key. Does not add the password policy to the database.
111            *
112            * @param passwordPolicyId the primary key for the new password policy
113            * @return the new password policy
114            */
115            public static com.liferay.portal.model.PasswordPolicy createPasswordPolicy(
116                    long passwordPolicyId) {
117                    return getService().createPasswordPolicy(passwordPolicyId);
118            }
119    
120            public static void deleteNondefaultPasswordPolicies(long companyId)
121                    throws com.liferay.portal.kernel.exception.PortalException {
122                    getService().deleteNondefaultPasswordPolicies(companyId);
123            }
124    
125            /**
126            * Deletes the password policy from the database. Also notifies the appropriate model listeners.
127            *
128            * @param passwordPolicy the password policy
129            * @return the password policy that was removed
130            * @throws PortalException
131            */
132            public static com.liferay.portal.model.PasswordPolicy deletePasswordPolicy(
133                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
134                    throws com.liferay.portal.kernel.exception.PortalException {
135                    return getService().deletePasswordPolicy(passwordPolicy);
136            }
137    
138            /**
139            * Deletes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
140            *
141            * @param passwordPolicyId the primary key of the password policy
142            * @return the password policy that was removed
143            * @throws PortalException if a password policy with the primary key could not be found
144            */
145            public static com.liferay.portal.model.PasswordPolicy deletePasswordPolicy(
146                    long passwordPolicyId)
147                    throws com.liferay.portal.kernel.exception.PortalException {
148                    return getService().deletePasswordPolicy(passwordPolicyId);
149            }
150    
151            /**
152            * @throws PortalException
153            */
154            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
155                    com.liferay.portal.model.PersistedModel persistedModel)
156                    throws com.liferay.portal.kernel.exception.PortalException {
157                    return getService().deletePersistedModel(persistedModel);
158            }
159    
160            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
161                    return getService().dynamicQuery();
162            }
163    
164            /**
165            * Performs a dynamic query on the database and returns the matching rows.
166            *
167            * @param dynamicQuery the dynamic query
168            * @return the matching rows
169            */
170            public static <T> java.util.List<T> dynamicQuery(
171                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
172                    return getService().dynamicQuery(dynamicQuery);
173            }
174    
175            /**
176            * Performs a dynamic query on the database and returns a range of the matching rows.
177            *
178            * <p>
179            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
180            * </p>
181            *
182            * @param dynamicQuery the dynamic query
183            * @param start the lower bound of the range of model instances
184            * @param end the upper bound of the range of model instances (not inclusive)
185            * @return the range of matching rows
186            */
187            public static <T> java.util.List<T> dynamicQuery(
188                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
189                    int end) {
190                    return getService().dynamicQuery(dynamicQuery, start, end);
191            }
192    
193            /**
194            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
195            *
196            * <p>
197            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
198            * </p>
199            *
200            * @param dynamicQuery the dynamic query
201            * @param start the lower bound of the range of model instances
202            * @param end the upper bound of the range of model instances (not inclusive)
203            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
204            * @return the ordered range of matching rows
205            */
206            public static <T> java.util.List<T> dynamicQuery(
207                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
208                    int end,
209                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
210                    return getService()
211                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
212            }
213    
214            /**
215            * Returns the number of rows matching the dynamic query.
216            *
217            * @param dynamicQuery the dynamic query
218            * @return the number of rows matching the dynamic query
219            */
220            public static long dynamicQueryCount(
221                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
222                    return getService().dynamicQueryCount(dynamicQuery);
223            }
224    
225            /**
226            * Returns the number of rows matching the dynamic query.
227            *
228            * @param dynamicQuery the dynamic query
229            * @param projection the projection to apply to the query
230            * @return the number of rows matching the dynamic query
231            */
232            public static long dynamicQueryCount(
233                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
234                    com.liferay.portal.kernel.dao.orm.Projection projection) {
235                    return getService().dynamicQueryCount(dynamicQuery, projection);
236            }
237    
238            public static com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
239                    long companyId, java.lang.String name) {
240                    return getService().fetchPasswordPolicy(companyId, name);
241            }
242    
243            public static com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
244                    long passwordPolicyId) {
245                    return getService().fetchPasswordPolicy(passwordPolicyId);
246            }
247    
248            /**
249            * Returns the password policy with the matching UUID and company.
250            *
251            * @param uuid the password policy's UUID
252            * @param companyId the primary key of the company
253            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
254            */
255            public static com.liferay.portal.model.PasswordPolicy fetchPasswordPolicyByUuidAndCompanyId(
256                    java.lang.String uuid, long companyId) {
257                    return getService()
258                                       .fetchPasswordPolicyByUuidAndCompanyId(uuid, companyId);
259            }
260    
261            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
262                    return getService().getActionableDynamicQuery();
263            }
264    
265            public static com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
266                    long companyId)
267                    throws com.liferay.portal.kernel.exception.PortalException {
268                    return getService().getDefaultPasswordPolicy(companyId);
269            }
270    
271            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
272                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
273                    return getService().getExportActionableDynamicQuery(portletDataContext);
274            }
275    
276            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
277                    return getService().getIndexableActionableDynamicQuery();
278            }
279    
280            /**
281            * Returns the OSGi service identifier.
282            *
283            * @return the OSGi service identifier
284            */
285            public static java.lang.String getOSGiServiceIdentifier() {
286                    return getService().getOSGiServiceIdentifier();
287            }
288    
289            /**
290            * Returns a range of all the password policies.
291            *
292            * <p>
293            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.PasswordPolicyModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
294            * </p>
295            *
296            * @param start the lower bound of the range of password policies
297            * @param end the upper bound of the range of password policies (not inclusive)
298            * @return the range of password policies
299            */
300            public static java.util.List<com.liferay.portal.model.PasswordPolicy> getPasswordPolicies(
301                    int start, int end) {
302                    return getService().getPasswordPolicies(start, end);
303            }
304    
305            /**
306            * Returns the number of password policies.
307            *
308            * @return the number of password policies
309            */
310            public static int getPasswordPoliciesCount() {
311                    return getService().getPasswordPoliciesCount();
312            }
313    
314            /**
315            * @deprecated As of 6.1.0
316            */
317            @Deprecated
318            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
319                    long companyId, long organizationId, long locationId)
320                    throws com.liferay.portal.kernel.exception.PortalException {
321                    return getService()
322                                       .getPasswordPolicy(companyId, organizationId, locationId);
323            }
324    
325            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
326                    long companyId, long[] organizationIds)
327                    throws com.liferay.portal.kernel.exception.PortalException {
328                    return getService().getPasswordPolicy(companyId, organizationIds);
329            }
330    
331            /**
332            * Returns the password policy with the primary key.
333            *
334            * @param passwordPolicyId the primary key of the password policy
335            * @return the password policy
336            * @throws PortalException if a password policy with the primary key could not be found
337            */
338            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
339                    long passwordPolicyId)
340                    throws com.liferay.portal.kernel.exception.PortalException {
341                    return getService().getPasswordPolicy(passwordPolicyId);
342            }
343    
344            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
345                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
346                    return getService().getPasswordPolicyByUserId(userId);
347            }
348    
349            /**
350            * Returns the password policy with the matching UUID and company.
351            *
352            * @param uuid the password policy's UUID
353            * @param companyId the primary key of the company
354            * @return the matching password policy
355            * @throws PortalException if a matching password policy could not be found
356            */
357            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUuidAndCompanyId(
358                    java.lang.String uuid, long companyId)
359                    throws com.liferay.portal.kernel.exception.PortalException {
360                    return getService().getPasswordPolicyByUuidAndCompanyId(uuid, companyId);
361            }
362    
363            public static com.liferay.portal.model.PersistedModel getPersistedModel(
364                    java.io.Serializable primaryKeyObj)
365                    throws com.liferay.portal.kernel.exception.PortalException {
366                    return getService().getPersistedModel(primaryKeyObj);
367            }
368    
369            public static java.util.List<com.liferay.portal.model.PasswordPolicy> search(
370                    long companyId, java.lang.String name, int start, int end,
371                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.PasswordPolicy> obc) {
372                    return getService().search(companyId, name, start, end, obc);
373            }
374    
375            public static int searchCount(long companyId, java.lang.String name) {
376                    return getService().searchCount(companyId, name);
377            }
378    
379            /**
380            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
381            *
382            * @param passwordPolicy the password policy
383            * @return the password policy that was updated
384            */
385            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
386                    com.liferay.portal.model.PasswordPolicy passwordPolicy) {
387                    return getService().updatePasswordPolicy(passwordPolicy);
388            }
389    
390            /**
391            * @deprecated As of 6.2.0, replaced by {@link #updatePasswordPolicy(long,
392            String, String, boolean, boolean, long, boolean, boolean,
393            int, int, int, int, int, int, String, boolean, int, boolean,
394            long, long, int, boolean, int, long, long, long,
395            ServiceContext)}
396            */
397            @Deprecated
398            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
399                    long passwordPolicyId, java.lang.String name,
400                    java.lang.String description, boolean changeable,
401                    boolean changeRequired, long minAge, boolean checkSyntax,
402                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
403                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
404                    boolean history, int historyCount, boolean expireable, long maxAge,
405                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
406                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
407                    throws com.liferay.portal.kernel.exception.PortalException {
408                    return getService()
409                                       .updatePasswordPolicy(passwordPolicyId, name, description,
410                            changeable, changeRequired, minAge, checkSyntax,
411                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
412                            minNumbers, minSymbols, minUpperCase, history, historyCount,
413                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
414                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
415            }
416    
417            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
418                    long passwordPolicyId, java.lang.String name,
419                    java.lang.String description, boolean changeable,
420                    boolean changeRequired, long minAge, boolean checkSyntax,
421                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
422                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
423                    java.lang.String regex, boolean history, int historyCount,
424                    boolean expireable, long maxAge, long warningTime, int graceLimit,
425                    boolean lockout, int maxFailure, long lockoutDuration,
426                    long resetFailureCount, long resetTicketMaxAge,
427                    com.liferay.portal.service.ServiceContext serviceContext)
428                    throws com.liferay.portal.kernel.exception.PortalException {
429                    return getService()
430                                       .updatePasswordPolicy(passwordPolicyId, name, description,
431                            changeable, changeRequired, minAge, checkSyntax,
432                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
433                            minNumbers, minSymbols, minUpperCase, regex, history, historyCount,
434                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
435                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
436                            serviceContext);
437            }
438    
439            public static PasswordPolicyLocalService getService() {
440                    if (_service == null) {
441                            _service = (PasswordPolicyLocalService)PortalBeanLocatorUtil.locate(PasswordPolicyLocalService.class.getName());
442    
443                            ReferenceRegistry.registerReference(PasswordPolicyLocalServiceUtil.class,
444                                    "_service");
445                    }
446    
447                    return _service;
448            }
449    
450            private static PasswordPolicyLocalService _service;
451    }