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 EmailAddress. 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 EmailAddressLocalServiceUtil 035 * @see com.liferay.portal.service.base.EmailAddressLocalServiceBaseImpl 036 * @see com.liferay.portal.service.impl.EmailAddressLocalServiceImpl 037 * @generated 038 */ 039 @ProviderType 040 @Transactional(isolation = Isolation.PORTAL, rollbackFor = { 041 PortalException.class, SystemException.class}) 042 public interface EmailAddressLocalService extends BaseLocalService, 043 PersistedModelLocalService { 044 /* 045 * NOTE FOR DEVELOPERS: 046 * 047 * Never modify or reference this interface directly. Always use {@link EmailAddressLocalServiceUtil} to access the email address local service. Add custom service methods to {@link com.liferay.portal.service.impl.EmailAddressLocalServiceImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface. 048 */ 049 050 /** 051 * Adds the email address to the database. Also notifies the appropriate model listeners. 052 * 053 * @param emailAddress the email address 054 * @return the email address that was added 055 */ 056 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 057 public com.liferay.portal.model.EmailAddress addEmailAddress( 058 com.liferay.portal.model.EmailAddress emailAddress); 059 060 public com.liferay.portal.model.EmailAddress addEmailAddress(long userId, 061 java.lang.String className, long classPK, java.lang.String address, 062 long typeId, boolean primary, 063 com.liferay.portal.service.ServiceContext serviceContext) 064 throws PortalException; 065 066 /** 067 * Creates a new email address with the primary key. Does not add the email address to the database. 068 * 069 * @param emailAddressId the primary key for the new email address 070 * @return the new email address 071 */ 072 public com.liferay.portal.model.EmailAddress createEmailAddress( 073 long emailAddressId); 074 075 /** 076 * Deletes the email address from the database. Also notifies the appropriate model listeners. 077 * 078 * @param emailAddress the email address 079 * @return the email address that was removed 080 */ 081 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 082 @com.liferay.portal.kernel.systemevent.SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE) 083 public com.liferay.portal.model.EmailAddress deleteEmailAddress( 084 com.liferay.portal.model.EmailAddress emailAddress); 085 086 /** 087 * Deletes the email address with the primary key from the database. Also notifies the appropriate model listeners. 088 * 089 * @param emailAddressId the primary key of the email address 090 * @return the email address that was removed 091 * @throws PortalException if a email address with the primary key could not be found 092 */ 093 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE) 094 public com.liferay.portal.model.EmailAddress deleteEmailAddress( 095 long emailAddressId) throws PortalException; 096 097 public void deleteEmailAddresses(long companyId, 098 java.lang.String className, long classPK); 099 100 /** 101 * @throws PortalException 102 */ 103 @Override 104 public com.liferay.portal.model.PersistedModel deletePersistedModel( 105 com.liferay.portal.model.PersistedModel persistedModel) 106 throws PortalException; 107 108 public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery(); 109 110 /** 111 * Performs a dynamic query on the database and returns the matching rows. 112 * 113 * @param dynamicQuery the dynamic query 114 * @return the matching rows 115 */ 116 public <T> java.util.List<T> dynamicQuery( 117 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 118 119 /** 120 * Performs a dynamic query on the database and returns a range of the matching rows. 121 * 122 * <p> 123 * 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.EmailAddressModelImpl}. 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. 124 * </p> 125 * 126 * @param dynamicQuery the dynamic query 127 * @param start the lower bound of the range of model instances 128 * @param end the upper bound of the range of model instances (not inclusive) 129 * @return the range of matching rows 130 */ 131 public <T> java.util.List<T> dynamicQuery( 132 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 133 int end); 134 135 /** 136 * Performs a dynamic query on the database and returns an ordered range of the matching rows. 137 * 138 * <p> 139 * 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.EmailAddressModelImpl}. 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. 140 * </p> 141 * 142 * @param dynamicQuery the dynamic query 143 * @param start the lower bound of the range of model instances 144 * @param end the upper bound of the range of model instances (not inclusive) 145 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 146 * @return the ordered range of matching rows 147 */ 148 public <T> java.util.List<T> dynamicQuery( 149 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, 150 int end, 151 com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator); 152 153 /** 154 * Returns the number of rows matching the dynamic query. 155 * 156 * @param dynamicQuery the dynamic query 157 * @return the number of rows matching the dynamic query 158 */ 159 public long dynamicQueryCount( 160 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery); 161 162 /** 163 * Returns the number of rows matching the dynamic query. 164 * 165 * @param dynamicQuery the dynamic query 166 * @param projection the projection to apply to the query 167 * @return the number of rows matching the dynamic query 168 */ 169 public long dynamicQueryCount( 170 com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, 171 com.liferay.portal.kernel.dao.orm.Projection projection); 172 173 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 174 public com.liferay.portal.model.EmailAddress fetchEmailAddress( 175 long emailAddressId); 176 177 /** 178 * Returns the email address with the matching UUID and company. 179 * 180 * @param uuid the email address's UUID 181 * @param companyId the primary key of the company 182 * @return the matching email address, or <code>null</code> if a matching email address could not be found 183 */ 184 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 185 public com.liferay.portal.model.EmailAddress fetchEmailAddressByUuidAndCompanyId( 186 java.lang.String uuid, long companyId); 187 188 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 189 public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery(); 190 191 /** 192 * Returns the email address with the primary key. 193 * 194 * @param emailAddressId the primary key of the email address 195 * @return the email address 196 * @throws PortalException if a email address with the primary key could not be found 197 */ 198 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 199 public com.liferay.portal.model.EmailAddress getEmailAddress( 200 long emailAddressId) throws PortalException; 201 202 /** 203 * Returns the email address with the matching UUID and company. 204 * 205 * @param uuid the email address's UUID 206 * @param companyId the primary key of the company 207 * @return the matching email address 208 * @throws PortalException if a matching email address could not be found 209 */ 210 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 211 public com.liferay.portal.model.EmailAddress getEmailAddressByUuidAndCompanyId( 212 java.lang.String uuid, long companyId) throws PortalException; 213 214 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 215 public java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(); 216 217 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 218 public java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses( 219 long companyId, java.lang.String className, long classPK); 220 221 /** 222 * Returns a range of all the email addresses. 223 * 224 * <p> 225 * 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.EmailAddressModelImpl}. 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. 226 * </p> 227 * 228 * @param start the lower bound of the range of email addresses 229 * @param end the upper bound of the range of email addresses (not inclusive) 230 * @return the range of email addresses 231 */ 232 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 233 public java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses( 234 int start, int end); 235 236 /** 237 * Returns the number of email addresses. 238 * 239 * @return the number of email addresses 240 */ 241 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 242 public int getEmailAddressesCount(); 243 244 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 245 public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery( 246 com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext); 247 248 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 249 public com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery(); 250 251 /** 252 * Returns the OSGi service identifier. 253 * 254 * @return the OSGi service identifier 255 */ 256 public java.lang.String getOSGiServiceIdentifier(); 257 258 @Override 259 @Transactional(propagation = Propagation.SUPPORTS, readOnly = true) 260 public com.liferay.portal.model.PersistedModel getPersistedModel( 261 java.io.Serializable primaryKeyObj) throws PortalException; 262 263 /** 264 * Updates the email address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners. 265 * 266 * @param emailAddress the email address 267 * @return the email address that was updated 268 */ 269 @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) 270 public com.liferay.portal.model.EmailAddress updateEmailAddress( 271 com.liferay.portal.model.EmailAddress emailAddress); 272 273 public com.liferay.portal.model.EmailAddress updateEmailAddress( 274 long emailAddressId, java.lang.String address, long typeId, 275 boolean primary) throws PortalException; 276 }