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