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