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            /**
277            * Returns the OSGi service identifier.
278            *
279            * @return the OSGi service identifier
280            */
281            public static java.lang.String getOSGiServiceIdentifier() {
282                    return getService().getOSGiServiceIdentifier();
283            }
284    
285            /**
286            * Returns a range of all the password policies.
287            *
288            * <p>
289            * 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.
290            * </p>
291            *
292            * @param start the lower bound of the range of password policies
293            * @param end the upper bound of the range of password policies (not inclusive)
294            * @return the range of password policies
295            */
296            public static java.util.List<com.liferay.portal.model.PasswordPolicy> getPasswordPolicies(
297                    int start, int end) {
298                    return getService().getPasswordPolicies(start, end);
299            }
300    
301            /**
302            * Returns the number of password policies.
303            *
304            * @return the number of password policies
305            */
306            public static int getPasswordPoliciesCount() {
307                    return getService().getPasswordPoliciesCount();
308            }
309    
310            /**
311            * @deprecated As of 6.1.0
312            */
313            @Deprecated
314            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
315                    long companyId, long organizationId, long locationId)
316                    throws com.liferay.portal.kernel.exception.PortalException {
317                    return getService()
318                                       .getPasswordPolicy(companyId, organizationId, locationId);
319            }
320    
321            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
322                    long companyId, long[] organizationIds)
323                    throws com.liferay.portal.kernel.exception.PortalException {
324                    return getService().getPasswordPolicy(companyId, organizationIds);
325            }
326    
327            /**
328            * Returns the password policy with the primary key.
329            *
330            * @param passwordPolicyId the primary key of the password policy
331            * @return the password policy
332            * @throws PortalException if a password policy with the primary key could not be found
333            */
334            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
335                    long passwordPolicyId)
336                    throws com.liferay.portal.kernel.exception.PortalException {
337                    return getService().getPasswordPolicy(passwordPolicyId);
338            }
339    
340            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
341                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
342                    return getService().getPasswordPolicyByUserId(userId);
343            }
344    
345            /**
346            * Returns the password policy with the matching UUID and company.
347            *
348            * @param uuid the password policy's UUID
349            * @param companyId the primary key of the company
350            * @return the matching password policy
351            * @throws PortalException if a matching password policy could not be found
352            */
353            public static com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUuidAndCompanyId(
354                    java.lang.String uuid, long companyId)
355                    throws com.liferay.portal.kernel.exception.PortalException {
356                    return getService().getPasswordPolicyByUuidAndCompanyId(uuid, companyId);
357            }
358    
359            public static com.liferay.portal.model.PersistedModel getPersistedModel(
360                    java.io.Serializable primaryKeyObj)
361                    throws com.liferay.portal.kernel.exception.PortalException {
362                    return getService().getPersistedModel(primaryKeyObj);
363            }
364    
365            public static java.util.List<com.liferay.portal.model.PasswordPolicy> search(
366                    long companyId, java.lang.String name, int start, int end,
367                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.PasswordPolicy> obc) {
368                    return getService().search(companyId, name, start, end, obc);
369            }
370    
371            public static int searchCount(long companyId, java.lang.String name) {
372                    return getService().searchCount(companyId, name);
373            }
374    
375            /**
376            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
377            *
378            * @param passwordPolicy the password policy
379            * @return the password policy that was updated
380            */
381            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
382                    com.liferay.portal.model.PasswordPolicy passwordPolicy) {
383                    return getService().updatePasswordPolicy(passwordPolicy);
384            }
385    
386            /**
387            * @deprecated As of 6.2.0, replaced by {@link #updatePasswordPolicy(long,
388            String, String, boolean, boolean, long, boolean, boolean,
389            int, int, int, int, int, int, String, boolean, int, boolean,
390            long, long, int, boolean, int, long, long, long,
391            ServiceContext)}
392            */
393            @Deprecated
394            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
395                    long passwordPolicyId, java.lang.String name,
396                    java.lang.String description, boolean changeable,
397                    boolean changeRequired, long minAge, boolean checkSyntax,
398                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
399                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
400                    boolean history, int historyCount, boolean expireable, long maxAge,
401                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
402                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
403                    throws com.liferay.portal.kernel.exception.PortalException {
404                    return getService()
405                                       .updatePasswordPolicy(passwordPolicyId, name, description,
406                            changeable, changeRequired, minAge, checkSyntax,
407                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
408                            minNumbers, minSymbols, minUpperCase, history, historyCount,
409                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
410                            lockoutDuration, resetFailureCount, resetTicketMaxAge);
411            }
412    
413            public static com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
414                    long passwordPolicyId, java.lang.String name,
415                    java.lang.String description, boolean changeable,
416                    boolean changeRequired, long minAge, boolean checkSyntax,
417                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
418                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
419                    java.lang.String regex, boolean history, int historyCount,
420                    boolean expireable, long maxAge, long warningTime, int graceLimit,
421                    boolean lockout, int maxFailure, long lockoutDuration,
422                    long resetFailureCount, long resetTicketMaxAge,
423                    com.liferay.portal.service.ServiceContext serviceContext)
424                    throws com.liferay.portal.kernel.exception.PortalException {
425                    return getService()
426                                       .updatePasswordPolicy(passwordPolicyId, name, description,
427                            changeable, changeRequired, minAge, checkSyntax,
428                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
429                            minNumbers, minSymbols, minUpperCase, regex, history, historyCount,
430                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
431                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
432                            serviceContext);
433            }
434    
435            public static PasswordPolicyLocalService getService() {
436                    if (_service == null) {
437                            _service = (PasswordPolicyLocalService)PortalBeanLocatorUtil.locate(PasswordPolicyLocalService.class.getName());
438    
439                            ReferenceRegistry.registerReference(PasswordPolicyLocalServiceUtil.class,
440                                    "_service");
441                    }
442    
443                    return _service;
444            }
445    
446            /**
447             * @deprecated As of 6.2.0
448             */
449            @Deprecated
450            public void setService(PasswordPolicyLocalService service) {
451            }
452    
453            private static PasswordPolicyLocalService _service;
454    }