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.kernel.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            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
052                    com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) {
053                    return getService().getExportActionableDynamicQuery(portletDataContext);
054            }
055    
056            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
057                    return getService().getIndexableActionableDynamicQuery();
058            }
059    
060            /**
061            * Adds the password policy to the database. Also notifies the appropriate model listeners.
062            *
063            * @param passwordPolicy the password policy
064            * @return the password policy that was added
065            */
066            public static com.liferay.portal.kernel.model.PasswordPolicy addPasswordPolicy(
067                    com.liferay.portal.kernel.model.PasswordPolicy passwordPolicy) {
068                    return getService().addPasswordPolicy(passwordPolicy);
069            }
070    
071            public static com.liferay.portal.kernel.model.PasswordPolicy addPasswordPolicy(
072                    long userId, boolean defaultPolicy, java.lang.String name,
073                    java.lang.String description, boolean changeable,
074                    boolean changeRequired, long minAge, boolean checkSyntax,
075                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
076                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
077                    java.lang.String regex, boolean history, int historyCount,
078                    boolean expireable, long maxAge, long warningTime, int graceLimit,
079                    boolean lockout, int maxFailure, long lockoutDuration,
080                    long resetFailureCount, long resetTicketMaxAge,
081                    ServiceContext serviceContext)
082                    throws com.liferay.portal.kernel.exception.PortalException {
083                    return getService()
084                                       .addPasswordPolicy(userId, defaultPolicy, name, description,
085                            changeable, changeRequired, minAge, checkSyntax,
086                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
087                            minNumbers, minSymbols, minUpperCase, regex, history, historyCount,
088                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
089                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
090                            serviceContext);
091            }
092    
093            /**
094            * Creates a new password policy with the primary key. Does not add the password policy to the database.
095            *
096            * @param passwordPolicyId the primary key for the new password policy
097            * @return the new password policy
098            */
099            public static com.liferay.portal.kernel.model.PasswordPolicy createPasswordPolicy(
100                    long passwordPolicyId) {
101                    return getService().createPasswordPolicy(passwordPolicyId);
102            }
103    
104            /**
105            * Deletes the password policy from the database. Also notifies the appropriate model listeners.
106            *
107            * @param passwordPolicy the password policy
108            * @return the password policy that was removed
109            * @throws PortalException
110            */
111            public static com.liferay.portal.kernel.model.PasswordPolicy deletePasswordPolicy(
112                    com.liferay.portal.kernel.model.PasswordPolicy passwordPolicy)
113                    throws com.liferay.portal.kernel.exception.PortalException {
114                    return getService().deletePasswordPolicy(passwordPolicy);
115            }
116    
117            /**
118            * Deletes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
119            *
120            * @param passwordPolicyId the primary key of the password policy
121            * @return the password policy that was removed
122            * @throws PortalException if a password policy with the primary key could not be found
123            */
124            public static com.liferay.portal.kernel.model.PasswordPolicy deletePasswordPolicy(
125                    long passwordPolicyId)
126                    throws com.liferay.portal.kernel.exception.PortalException {
127                    return getService().deletePasswordPolicy(passwordPolicyId);
128            }
129    
130            public static com.liferay.portal.kernel.model.PasswordPolicy fetchPasswordPolicy(
131                    long companyId, java.lang.String name) {
132                    return getService().fetchPasswordPolicy(companyId, name);
133            }
134    
135            public static com.liferay.portal.kernel.model.PasswordPolicy fetchPasswordPolicy(
136                    long passwordPolicyId) {
137                    return getService().fetchPasswordPolicy(passwordPolicyId);
138            }
139    
140            /**
141            * Returns the password policy with the matching UUID and company.
142            *
143            * @param uuid the password policy's UUID
144            * @param companyId the primary key of the company
145            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
146            */
147            public static com.liferay.portal.kernel.model.PasswordPolicy fetchPasswordPolicyByUuidAndCompanyId(
148                    java.lang.String uuid, long companyId) {
149                    return getService()
150                                       .fetchPasswordPolicyByUuidAndCompanyId(uuid, companyId);
151            }
152    
153            public static com.liferay.portal.kernel.model.PasswordPolicy getDefaultPasswordPolicy(
154                    long companyId)
155                    throws com.liferay.portal.kernel.exception.PortalException {
156                    return getService().getDefaultPasswordPolicy(companyId);
157            }
158    
159            public static com.liferay.portal.kernel.model.PasswordPolicy getPasswordPolicy(
160                    long companyId, long[] organizationIds)
161                    throws com.liferay.portal.kernel.exception.PortalException {
162                    return getService().getPasswordPolicy(companyId, organizationIds);
163            }
164    
165            /**
166            * Returns the password policy with the primary key.
167            *
168            * @param passwordPolicyId the primary key of the password policy
169            * @return the password policy
170            * @throws PortalException if a password policy with the primary key could not be found
171            */
172            public static com.liferay.portal.kernel.model.PasswordPolicy getPasswordPolicy(
173                    long passwordPolicyId)
174                    throws com.liferay.portal.kernel.exception.PortalException {
175                    return getService().getPasswordPolicy(passwordPolicyId);
176            }
177    
178            public static com.liferay.portal.kernel.model.PasswordPolicy getPasswordPolicyByUserId(
179                    long userId) throws com.liferay.portal.kernel.exception.PortalException {
180                    return getService().getPasswordPolicyByUserId(userId);
181            }
182    
183            /**
184            * Returns the password policy with the matching UUID and company.
185            *
186            * @param uuid the password policy's UUID
187            * @param companyId the primary key of the company
188            * @return the matching password policy
189            * @throws PortalException if a matching password policy could not be found
190            */
191            public static com.liferay.portal.kernel.model.PasswordPolicy getPasswordPolicyByUuidAndCompanyId(
192                    java.lang.String uuid, long companyId)
193                    throws com.liferay.portal.kernel.exception.PortalException {
194                    return getService().getPasswordPolicyByUuidAndCompanyId(uuid, companyId);
195            }
196    
197            /**
198            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
199            *
200            * @param passwordPolicy the password policy
201            * @return the password policy that was updated
202            */
203            public static com.liferay.portal.kernel.model.PasswordPolicy updatePasswordPolicy(
204                    com.liferay.portal.kernel.model.PasswordPolicy passwordPolicy) {
205                    return getService().updatePasswordPolicy(passwordPolicy);
206            }
207    
208            public static com.liferay.portal.kernel.model.PasswordPolicy updatePasswordPolicy(
209                    long passwordPolicyId, java.lang.String name,
210                    java.lang.String description, boolean changeable,
211                    boolean changeRequired, long minAge, boolean checkSyntax,
212                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
213                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
214                    java.lang.String regex, boolean history, int historyCount,
215                    boolean expireable, long maxAge, long warningTime, int graceLimit,
216                    boolean lockout, int maxFailure, long lockoutDuration,
217                    long resetFailureCount, long resetTicketMaxAge,
218                    ServiceContext serviceContext)
219                    throws com.liferay.portal.kernel.exception.PortalException {
220                    return getService()
221                                       .updatePasswordPolicy(passwordPolicyId, name, description,
222                            changeable, changeRequired, minAge, checkSyntax,
223                            allowDictionaryWords, minAlphanumeric, minLength, minLowerCase,
224                            minNumbers, minSymbols, minUpperCase, regex, history, historyCount,
225                            expireable, maxAge, warningTime, graceLimit, lockout, maxFailure,
226                            lockoutDuration, resetFailureCount, resetTicketMaxAge,
227                            serviceContext);
228            }
229    
230            /**
231            * @throws PortalException
232            */
233            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
234                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
235                    throws com.liferay.portal.kernel.exception.PortalException {
236                    return getService().deletePersistedModel(persistedModel);
237            }
238    
239            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
240                    java.io.Serializable primaryKeyObj)
241                    throws com.liferay.portal.kernel.exception.PortalException {
242                    return getService().getPersistedModel(primaryKeyObj);
243            }
244    
245            /**
246            * Returns the number of password policies.
247            *
248            * @return the number of password policies
249            */
250            public static int getPasswordPoliciesCount() {
251                    return getService().getPasswordPoliciesCount();
252            }
253    
254            public static int searchCount(long companyId, java.lang.String name) {
255                    return getService().searchCount(companyId, name);
256            }
257    
258            /**
259            * Returns the OSGi service identifier.
260            *
261            * @return the OSGi service identifier
262            */
263            public static java.lang.String getOSGiServiceIdentifier() {
264                    return getService().getOSGiServiceIdentifier();
265            }
266    
267            /**
268            * Performs a dynamic query on the database and returns the matching rows.
269            *
270            * @param dynamicQuery the dynamic query
271            * @return the matching rows
272            */
273            public static <T> java.util.List<T> dynamicQuery(
274                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
275                    return getService().dynamicQuery(dynamicQuery);
276            }
277    
278            /**
279            * Performs a dynamic query on the database and returns a range of the matching rows.
280            *
281            * <p>
282            * 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.
283            * </p>
284            *
285            * @param dynamicQuery the dynamic query
286            * @param start the lower bound of the range of model instances
287            * @param end the upper bound of the range of model instances (not inclusive)
288            * @return the range of matching rows
289            */
290            public static <T> java.util.List<T> dynamicQuery(
291                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
292                    int end) {
293                    return getService().dynamicQuery(dynamicQuery, start, end);
294            }
295    
296            /**
297            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
298            *
299            * <p>
300            * 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.
301            * </p>
302            *
303            * @param dynamicQuery the dynamic query
304            * @param start the lower bound of the range of model instances
305            * @param end the upper bound of the range of model instances (not inclusive)
306            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
307            * @return the ordered range of matching rows
308            */
309            public static <T> java.util.List<T> dynamicQuery(
310                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
311                    int end,
312                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
313                    return getService()
314                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
315            }
316    
317            /**
318            * Returns a range of all the password policies.
319            *
320            * <p>
321            * 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.
322            * </p>
323            *
324            * @param start the lower bound of the range of password policies
325            * @param end the upper bound of the range of password policies (not inclusive)
326            * @return the range of password policies
327            */
328            public static java.util.List<com.liferay.portal.kernel.model.PasswordPolicy> getPasswordPolicies(
329                    int start, int end) {
330                    return getService().getPasswordPolicies(start, end);
331            }
332    
333            public static java.util.List<com.liferay.portal.kernel.model.PasswordPolicy> search(
334                    long companyId, java.lang.String name, int start, int end,
335                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.PasswordPolicy> obc) {
336                    return getService().search(companyId, name, start, end, obc);
337            }
338    
339            /**
340            * Returns the number of rows matching the dynamic query.
341            *
342            * @param dynamicQuery the dynamic query
343            * @return the number of rows matching the dynamic query
344            */
345            public static long dynamicQueryCount(
346                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
347                    return getService().dynamicQueryCount(dynamicQuery);
348            }
349    
350            /**
351            * Returns the number of rows matching the dynamic query.
352            *
353            * @param dynamicQuery the dynamic query
354            * @param projection the projection to apply to the query
355            * @return the number of rows matching the dynamic query
356            */
357            public static long dynamicQueryCount(
358                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
359                    com.liferay.portal.kernel.dao.orm.Projection projection) {
360                    return getService().dynamicQueryCount(dynamicQuery, projection);
361            }
362    
363            public static void checkDefaultPasswordPolicy(long companyId)
364                    throws com.liferay.portal.kernel.exception.PortalException {
365                    getService().checkDefaultPasswordPolicy(companyId);
366            }
367    
368            public static void deleteNondefaultPasswordPolicies(long companyId)
369                    throws com.liferay.portal.kernel.exception.PortalException {
370                    getService().deleteNondefaultPasswordPolicies(companyId);
371            }
372    
373            public static PasswordPolicyLocalService getService() {
374                    if (_service == null) {
375                            _service = (PasswordPolicyLocalService)PortalBeanLocatorUtil.locate(PasswordPolicyLocalService.class.getName());
376    
377                            ReferenceRegistry.registerReference(PasswordPolicyLocalServiceUtil.class,
378                                    "_service");
379                    }
380    
381                    return _service;
382            }
383    
384            private static PasswordPolicyLocalService _service;
385    }