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