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 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 PortalException;
091    
092            public void checkDefaultPasswordPolicy(long companyId)
093                    throws 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 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 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) throws PortalException;
130    
131            /**
132            * @throws PortalException
133            */
134            @Override
135            public com.liferay.portal.model.PersistedModel deletePersistedModel(
136                    com.liferay.portal.model.PersistedModel persistedModel)
137                    throws PortalException;
138    
139            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
140    
141            /**
142            * Performs a dynamic query on the database and returns the matching rows.
143            *
144            * @param dynamicQuery the dynamic query
145            * @return the matching rows
146            */
147            public <T> java.util.List<T> dynamicQuery(
148                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
149    
150            /**
151            * Performs a dynamic query on the database and returns a range of the matching rows.
152            *
153            * <p>
154            * 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.
155            * </p>
156            *
157            * @param dynamicQuery the dynamic query
158            * @param start the lower bound of the range of model instances
159            * @param end the upper bound of the range of model instances (not inclusive)
160            * @return the range of matching rows
161            */
162            public <T> java.util.List<T> dynamicQuery(
163                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
164                    int end);
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 <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    
184            /**
185            * Returns the number of rows matching the dynamic query.
186            *
187            * @param dynamicQuery the dynamic query
188            * @return the number of rows matching the dynamic query
189            */
190            public long dynamicQueryCount(
191                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
192    
193            /**
194            * Returns the number of rows matching the dynamic query.
195            *
196            * @param dynamicQuery the dynamic query
197            * @param projection the projection to apply to the query
198            * @return the number of rows matching the dynamic query
199            */
200            public long dynamicQueryCount(
201                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
202                    com.liferay.portal.kernel.dao.orm.Projection projection);
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
206                    long companyId, java.lang.String name);
207    
208            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209            public com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
210                    long passwordPolicyId);
211    
212            /**
213            * Returns the password policy with the matching UUID and company.
214            *
215            * @param uuid the password policy's UUID
216            * @param companyId the primary key of the company
217            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
218            */
219            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220            public com.liferay.portal.model.PasswordPolicy fetchPasswordPolicyByUuidAndCompanyId(
221                    java.lang.String uuid, long companyId);
222    
223            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
224            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
225    
226            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227            public com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
228                    long companyId) throws PortalException;
229    
230            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231            public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
232                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext);
233    
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
236    
237            /**
238            * Returns the OSGi service identifier.
239            *
240            * @return the OSGi service identifier
241            */
242            public java.lang.String getOSGiServiceIdentifier();
243    
244            /**
245            * Returns a range of all the password policies.
246            *
247            * <p>
248            * 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.
249            * </p>
250            *
251            * @param start the lower bound of the range of password policies
252            * @param end the upper bound of the range of password policies (not inclusive)
253            * @return the range of password policies
254            */
255            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
256            public java.util.List<com.liferay.portal.model.PasswordPolicy> getPasswordPolicies(
257                    int start, int end);
258    
259            /**
260            * Returns the number of password policies.
261            *
262            * @return the number of password policies
263            */
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public int getPasswordPoliciesCount();
266    
267            /**
268            * @deprecated As of 6.1.0
269            */
270            @java.lang.Deprecated
271            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
272            public com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
273                    long companyId, long organizationId, long locationId)
274                    throws PortalException;
275    
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
278                    long companyId, long[] organizationIds) throws 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) throws PortalException;
290    
291            @com.liferay.portal.kernel.cache.thread.local.ThreadLocalCachable
292            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293            public com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
294                    long userId) throws PortalException;
295    
296            /**
297            * Returns the password policy with the matching UUID and company.
298            *
299            * @param uuid the password policy's UUID
300            * @param companyId the primary key of the company
301            * @return the matching password policy
302            * @throws PortalException if a matching password policy could not be found
303            */
304            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305            public com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUuidAndCompanyId(
306                    java.lang.String uuid, long companyId) throws PortalException;
307    
308            @Override
309            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
310            public com.liferay.portal.model.PersistedModel getPersistedModel(
311                    java.io.Serializable primaryKeyObj) throws PortalException;
312    
313            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
314            public java.util.List<com.liferay.portal.model.PasswordPolicy> search(
315                    long companyId, java.lang.String name, int start, int end,
316                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.PasswordPolicy> obc);
317    
318            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
319            public int searchCount(long companyId, java.lang.String name);
320    
321            /**
322            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
323            *
324            * @param passwordPolicy the password policy
325            * @return the password policy that was updated
326            */
327            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
328            public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
329                    com.liferay.portal.model.PasswordPolicy passwordPolicy);
330    
331            /**
332            * @deprecated As of 6.2.0, replaced by {@link #updatePasswordPolicy(long,
333            String, String, boolean, boolean, long, boolean, boolean,
334            int, int, int, int, int, int, String, boolean, int, boolean,
335            long, long, int, boolean, int, long, long, long,
336            ServiceContext)}
337            */
338            @java.lang.Deprecated
339            public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
340                    long passwordPolicyId, java.lang.String name,
341                    java.lang.String description, boolean changeable,
342                    boolean changeRequired, long minAge, boolean checkSyntax,
343                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
344                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
345                    boolean history, int historyCount, boolean expireable, long maxAge,
346                    long warningTime, int graceLimit, boolean lockout, int maxFailure,
347                    long lockoutDuration, long resetFailureCount, long resetTicketMaxAge)
348                    throws PortalException;
349    
350            public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
351                    long passwordPolicyId, java.lang.String name,
352                    java.lang.String description, boolean changeable,
353                    boolean changeRequired, long minAge, boolean checkSyntax,
354                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
355                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
356                    java.lang.String regex, boolean history, int historyCount,
357                    boolean expireable, long maxAge, long warningTime, int graceLimit,
358                    boolean lockout, int maxFailure, long lockoutDuration,
359                    long resetFailureCount, long resetTicketMaxAge,
360                    com.liferay.portal.service.ServiceContext serviceContext)
361                    throws PortalException;
362    }