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            public com.liferay.portal.model.PasswordPolicy addPasswordPolicy(
061                    long userId, boolean defaultPolicy, java.lang.String name,
062                    java.lang.String description, boolean changeable,
063                    boolean changeRequired, long minAge, boolean checkSyntax,
064                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
065                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
066                    java.lang.String regex, boolean history, int historyCount,
067                    boolean expireable, long maxAge, long warningTime, int graceLimit,
068                    boolean lockout, int maxFailure, long lockoutDuration,
069                    long resetFailureCount, long resetTicketMaxAge,
070                    com.liferay.portal.service.ServiceContext serviceContext)
071                    throws PortalException;
072    
073            public void checkDefaultPasswordPolicy(long companyId)
074                    throws PortalException;
075    
076            /**
077            * Creates a new password policy with the primary key. Does not add the password policy to the database.
078            *
079            * @param passwordPolicyId the primary key for the new password policy
080            * @return the new password policy
081            */
082            public com.liferay.portal.model.PasswordPolicy createPasswordPolicy(
083                    long passwordPolicyId);
084    
085            public void deleteNondefaultPasswordPolicies(long companyId)
086                    throws PortalException;
087    
088            /**
089            * Deletes the password policy from the database. Also notifies the appropriate model listeners.
090            *
091            * @param passwordPolicy the password policy
092            * @return the password policy that was removed
093            * @throws PortalException
094            */
095            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
096            @com.liferay.portal.kernel.systemevent.SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
097            public com.liferay.portal.model.PasswordPolicy deletePasswordPolicy(
098                    com.liferay.portal.model.PasswordPolicy passwordPolicy)
099                    throws PortalException;
100    
101            /**
102            * Deletes the password policy with the primary key from the database. Also notifies the appropriate model listeners.
103            *
104            * @param passwordPolicyId the primary key of the password policy
105            * @return the password policy that was removed
106            * @throws PortalException if a password policy with the primary key could not be found
107            */
108            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
109            public com.liferay.portal.model.PasswordPolicy deletePasswordPolicy(
110                    long passwordPolicyId) throws PortalException;
111    
112            /**
113            * @throws PortalException
114            */
115            @Override
116            public com.liferay.portal.model.PersistedModel deletePersistedModel(
117                    com.liferay.portal.model.PersistedModel persistedModel)
118                    throws PortalException;
119    
120            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
121    
122            /**
123            * Performs a dynamic query on the database and returns the matching rows.
124            *
125            * @param dynamicQuery the dynamic query
126            * @return the matching rows
127            */
128            public <T> java.util.List<T> dynamicQuery(
129                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
130    
131            /**
132            * Performs a dynamic query on the database and returns a range of the matching rows.
133            *
134            * <p>
135            * 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.
136            * </p>
137            *
138            * @param dynamicQuery the dynamic query
139            * @param start the lower bound of the range of model instances
140            * @param end the upper bound of the range of model instances (not inclusive)
141            * @return the range of matching rows
142            */
143            public <T> java.util.List<T> dynamicQuery(
144                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
145                    int end);
146    
147            /**
148            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
149            *
150            * <p>
151            * 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.
152            * </p>
153            *
154            * @param dynamicQuery the dynamic query
155            * @param start the lower bound of the range of model instances
156            * @param end the upper bound of the range of model instances (not inclusive)
157            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
158            * @return the ordered range of matching rows
159            */
160            public <T> java.util.List<T> dynamicQuery(
161                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
162                    int end,
163                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
164    
165            /**
166            * Returns the number of rows matching the dynamic query.
167            *
168            * @param dynamicQuery the dynamic query
169            * @return the number of rows matching the dynamic query
170            */
171            public long dynamicQueryCount(
172                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
173    
174            /**
175            * Returns the number of rows matching the dynamic query.
176            *
177            * @param dynamicQuery the dynamic query
178            * @param projection the projection to apply to the query
179            * @return the number of rows matching the dynamic query
180            */
181            public long dynamicQueryCount(
182                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
183                    com.liferay.portal.kernel.dao.orm.Projection projection);
184    
185            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186            public com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
187                    long companyId, java.lang.String name);
188    
189            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
190            public com.liferay.portal.model.PasswordPolicy fetchPasswordPolicy(
191                    long passwordPolicyId);
192    
193            /**
194            * Returns the password policy with the matching UUID and company.
195            *
196            * @param uuid the password policy's UUID
197            * @param companyId the primary key of the company
198            * @return the matching password policy, or <code>null</code> if a matching password policy could not be found
199            */
200            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201            public com.liferay.portal.model.PasswordPolicy fetchPasswordPolicyByUuidAndCompanyId(
202                    java.lang.String uuid, long companyId);
203    
204            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
206    
207            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208            public com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy(
209                    long companyId) throws PortalException;
210    
211            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
212            public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
213                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext);
214    
215            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
216            public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery();
217    
218            /**
219            * Returns the OSGi service identifier.
220            *
221            * @return the OSGi service identifier
222            */
223            public java.lang.String getOSGiServiceIdentifier();
224    
225            /**
226            * Returns a range of all the password policies.
227            *
228            * <p>
229            * 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.
230            * </p>
231            *
232            * @param start the lower bound of the range of password policies
233            * @param end the upper bound of the range of password policies (not inclusive)
234            * @return the range of password policies
235            */
236            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
237            public java.util.List<com.liferay.portal.model.PasswordPolicy> getPasswordPolicies(
238                    int start, int end);
239    
240            /**
241            * Returns the number of password policies.
242            *
243            * @return the number of password policies
244            */
245            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
246            public int getPasswordPoliciesCount();
247    
248            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249            public com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
250                    long companyId, long[] organizationIds) throws PortalException;
251    
252            /**
253            * Returns the password policy with the primary key.
254            *
255            * @param passwordPolicyId the primary key of the password policy
256            * @return the password policy
257            * @throws PortalException if a password policy with the primary key could not be found
258            */
259            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
260            public com.liferay.portal.model.PasswordPolicy getPasswordPolicy(
261                    long passwordPolicyId) throws PortalException;
262    
263            @com.liferay.portal.kernel.cache.thread.local.ThreadLocalCachable
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId(
266                    long userId) throws PortalException;
267    
268            /**
269            * Returns the password policy with the matching UUID and company.
270            *
271            * @param uuid the password policy's UUID
272            * @param companyId the primary key of the company
273            * @return the matching password policy
274            * @throws PortalException if a matching password policy could not be found
275            */
276            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
277            public com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUuidAndCompanyId(
278                    java.lang.String uuid, long companyId) throws PortalException;
279    
280            @Override
281            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282            public com.liferay.portal.model.PersistedModel getPersistedModel(
283                    java.io.Serializable primaryKeyObj) throws PortalException;
284    
285            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
286            public java.util.List<com.liferay.portal.model.PasswordPolicy> search(
287                    long companyId, java.lang.String name, int start, int end,
288                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.PasswordPolicy> obc);
289    
290            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
291            public int searchCount(long companyId, java.lang.String name);
292    
293            /**
294            * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
295            *
296            * @param passwordPolicy the password policy
297            * @return the password policy that was updated
298            */
299            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
300            public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
301                    com.liferay.portal.model.PasswordPolicy passwordPolicy);
302    
303            public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy(
304                    long passwordPolicyId, java.lang.String name,
305                    java.lang.String description, boolean changeable,
306                    boolean changeRequired, long minAge, boolean checkSyntax,
307                    boolean allowDictionaryWords, int minAlphanumeric, int minLength,
308                    int minLowerCase, int minNumbers, int minSymbols, int minUpperCase,
309                    java.lang.String regex, boolean history, int historyCount,
310                    boolean expireable, long maxAge, long warningTime, int graceLimit,
311                    boolean lockout, int maxFailure, long lockoutDuration,
312                    long resetFailureCount, long resetTicketMaxAge,
313                    com.liferay.portal.service.ServiceContext serviceContext)
314                    throws PortalException;
315    }