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