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 /** 227 * Returns the Spring bean ID for this bean. 228 * 229 * @return the Spring bean ID for this bean 230 */ 231 public java.lang.String getBeanIdentifier(); 232 233 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 234 public com.liferay.portal.model.PasswordPolicy getDefaultPasswordPolicy( 235 long companyId) throws PortalException; 236 237 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 238 public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 239 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext); 240 241 /** 242 * Returns a range of all the password policies. 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 start the lower bound of the range of password policies 249 * @param end the upper bound of the range of password policies (not inclusive) 250 * @return the range of password policies 251 */ 252 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 253 public java.util.List<com.liferay.portal.model.PasswordPolicy> getPasswordPolicies( 254 int start, int end); 255 256 /** 257 * Returns the number of password policies. 258 * 259 * @return the number of password policies 260 */ 261 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 262 public int getPasswordPoliciesCount(); 263 264 /** 265 * @deprecated As of 6.1.0 266 */ 267 @java.lang.Deprecated 268 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 269 public com.liferay.portal.model.PasswordPolicy getPasswordPolicy( 270 long companyId, long organizationId, long locationId) 271 throws PortalException; 272 273 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 274 public com.liferay.portal.model.PasswordPolicy getPasswordPolicy( 275 long companyId, long[] organizationIds) throws PortalException; 276 277 /** 278 * Returns the password policy with the primary key. 279 * 280 * @param passwordPolicyId the primary key of the password policy 281 * @return the password policy 282 * @throws PortalException if a password policy with the primary key could not be found 283 */ 284 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 285 public com.liferay.portal.model.PasswordPolicy getPasswordPolicy( 286 long passwordPolicyId) throws PortalException; 287 288 @com.liferay.portal.kernel.cache.ThreadLocalCachable 289 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 290 public com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUserId( 291 long userId) throws PortalException; 292 293 /** 294 * Returns the password policy with the matching UUID and company. 295 * 296 * @param uuid the password policy's UUID 297 * @param companyId the primary key of the company 298 * @return the matching password policy 299 * @throws PortalException if a matching password policy could not be found 300 */ 301 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 302 public com.liferay.portal.model.PasswordPolicy getPasswordPolicyByUuidAndCompanyId( 303 java.lang.String uuid, long companyId) throws PortalException; 304 305 @Override 306 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 307 public com.liferay.portal.model.PersistedModel getPersistedModel( 308 java.io.Serializable primaryKeyObj) throws PortalException; 309 310 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 311 public java.util.List<com.liferay.portal.model.PasswordPolicy> search( 312 long companyId, java.lang.String name, int start, int end, 313 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.PasswordPolicy> obc); 314 315 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 316 public int searchCount(long companyId, java.lang.String name); 317 318 /** 319 * Sets the Spring bean ID for this bean. 320 * 321 * @param beanIdentifier the Spring bean ID for this bean 322 */ 323 public void setBeanIdentifier(java.lang.String beanIdentifier); 324 325 /** 326 * Updates the password policy in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 327 * 328 * @param passwordPolicy the password policy 329 * @return the password policy that was updated 330 */ 331 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 332 public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy( 333 com.liferay.portal.model.PasswordPolicy passwordPolicy); 334 335 /** 336 * @deprecated As of 6.2.0, replaced by {@link #updatePasswordPolicy(long, 337 String, String, boolean, boolean, long, boolean, boolean, 338 int, int, int, int, int, int, String, boolean, int, boolean, 339 long, long, int, boolean, int, long, long, long, 340 ServiceContext)} 341 */ 342 @java.lang.Deprecated 343 public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy( 344 long passwordPolicyId, java.lang.String name, 345 java.lang.String description, boolean changeable, 346 boolean changeRequired, long minAge, boolean checkSyntax, 347 boolean allowDictionaryWords, int minAlphanumeric, int minLength, 348 int minLowerCase, int minNumbers, int minSymbols, int minUpperCase, 349 boolean history, int historyCount, boolean expireable, long maxAge, 350 long warningTime, int graceLimit, boolean lockout, int maxFailure, 351 long lockoutDuration, long resetFailureCount, long resetTicketMaxAge) 352 throws PortalException; 353 354 public com.liferay.portal.model.PasswordPolicy updatePasswordPolicy( 355 long passwordPolicyId, java.lang.String name, 356 java.lang.String description, boolean changeable, 357 boolean changeRequired, long minAge, boolean checkSyntax, 358 boolean allowDictionaryWords, int minAlphanumeric, int minLength, 359 int minLowerCase, int minNumbers, int minSymbols, int minUpperCase, 360 java.lang.String regex, boolean history, int historyCount, 361 boolean expireable, long maxAge, long warningTime, int graceLimit, 362 boolean lockout, int maxFailure, long lockoutDuration, 363 long resetFailureCount, long resetTicketMaxAge, 364 com.liferay.portal.service.ServiceContext serviceContext) 365 throws PortalException; 366 }