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            /**
061            * @deprecated As of 6.2.0, replaced by {@link #addEmailAddress(long,
062            String, long, String, int, boolean, ServiceContext)}
063            */
064            @java.lang.Deprecated
065            public com.liferay.portal.model.EmailAddress addEmailAddress(long userId,
066                    java.lang.String className, long classPK, java.lang.String address,
067                    int typeId, boolean primary)
068                    throws com.liferay.portal.kernel.exception.PortalException;
069    
070            public com.liferay.portal.model.EmailAddress addEmailAddress(long userId,
071                    java.lang.String className, long classPK, java.lang.String address,
072                    int typeId, boolean primary,
073                    com.liferay.portal.service.ServiceContext serviceContext)
074                    throws com.liferay.portal.kernel.exception.PortalException;
075    
076            /**
077            * Creates a new email address with the primary key. Does not add the email address to the database.
078            *
079            * @param emailAddressId the primary key for the new email address
080            * @return the new email address
081            */
082            public com.liferay.portal.model.EmailAddress createEmailAddress(
083                    long emailAddressId);
084    
085            /**
086            * Deletes the email address from the database. Also notifies the appropriate model listeners.
087            *
088            * @param emailAddress the email address
089            * @return the email address that was removed
090            */
091            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
092            @com.liferay.portal.kernel.systemevent.SystemEvent(action = SystemEventConstants.ACTION_SKIP, type = SystemEventConstants.TYPE_DELETE)
093            public com.liferay.portal.model.EmailAddress deleteEmailAddress(
094                    com.liferay.portal.model.EmailAddress emailAddress);
095    
096            /**
097            * Deletes the email address with the primary key from the database. Also notifies the appropriate model listeners.
098            *
099            * @param emailAddressId the primary key of the email address
100            * @return the email address that was removed
101            * @throws PortalException if a email address with the primary key could not be found
102            */
103            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.DELETE)
104            public com.liferay.portal.model.EmailAddress deleteEmailAddress(
105                    long emailAddressId)
106                    throws com.liferay.portal.kernel.exception.PortalException;
107    
108            public void deleteEmailAddresses(long companyId,
109                    java.lang.String className, long classPK);
110    
111            /**
112            * @throws PortalException
113            */
114            @Override
115            public com.liferay.portal.model.PersistedModel deletePersistedModel(
116                    com.liferay.portal.model.PersistedModel persistedModel)
117                    throws com.liferay.portal.kernel.exception.PortalException;
118    
119            public com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery();
120    
121            /**
122            * Performs a dynamic query on the database and returns the matching rows.
123            *
124            * @param dynamicQuery the dynamic query
125            * @return the matching rows
126            */
127            public <T> java.util.List<T> dynamicQuery(
128                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
129    
130            /**
131            * Performs a dynamic query on the database and returns a range of the matching rows.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param dynamicQuery the dynamic query
138            * @param start the lower bound of the range of model instances
139            * @param end the upper bound of the range of model instances (not inclusive)
140            * @return the range of matching rows
141            */
142            public <T> java.util.List<T> dynamicQuery(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
144                    int end);
145    
146            /**
147            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
148            *
149            * <p>
150            * 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.
151            * </p>
152            *
153            * @param dynamicQuery the dynamic query
154            * @param start the lower bound of the range of model instances
155            * @param end the upper bound of the range of model instances (not inclusive)
156            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
157            * @return the ordered range of matching rows
158            */
159            public <T> java.util.List<T> dynamicQuery(
160                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
161                    int end,
162                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator);
163    
164            /**
165            * Returns the number of rows matching the dynamic query.
166            *
167            * @param dynamicQuery the dynamic query
168            * @return the number of rows matching the dynamic query
169            */
170            public long dynamicQueryCount(
171                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery);
172    
173            /**
174            * Returns the number of rows matching the dynamic query.
175            *
176            * @param dynamicQuery the dynamic query
177            * @param projection the projection to apply to the query
178            * @return the number of rows matching the dynamic query
179            */
180            public long dynamicQueryCount(
181                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
182                    com.liferay.portal.kernel.dao.orm.Projection projection);
183    
184            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
185            public com.liferay.portal.model.EmailAddress fetchEmailAddress(
186                    long emailAddressId);
187    
188            /**
189            * Returns the email address with the matching UUID and company.
190            *
191            * @param uuid the email address's UUID
192            * @param companyId the primary key of the company
193            * @return the matching email address, or <code>null</code> if a matching email address could not be found
194            */
195            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
196            public com.liferay.portal.model.EmailAddress fetchEmailAddressByUuidAndCompanyId(
197                    java.lang.String uuid, long companyId);
198    
199            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200            public com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery();
201    
202            /**
203            * Returns the Spring bean ID for this bean.
204            *
205            * @return the Spring bean ID for this bean
206            */
207            public java.lang.String getBeanIdentifier();
208    
209            /**
210            * Returns the email address with the primary key.
211            *
212            * @param emailAddressId the primary key of the email address
213            * @return the email address
214            * @throws PortalException if a email address with the primary key could not be found
215            */
216            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
217            public com.liferay.portal.model.EmailAddress getEmailAddress(
218                    long emailAddressId)
219                    throws com.liferay.portal.kernel.exception.PortalException;
220    
221            /**
222            * Returns the email address with the matching UUID and company.
223            *
224            * @param uuid the email address's UUID
225            * @param companyId the primary key of the company
226            * @return the matching email address
227            * @throws PortalException if a matching email address could not be found
228            */
229            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
230            public com.liferay.portal.model.EmailAddress getEmailAddressByUuidAndCompanyId(
231                    java.lang.String uuid, long companyId)
232                    throws com.liferay.portal.kernel.exception.PortalException;
233    
234            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235            public java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses();
236    
237            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238            public java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(
239                    long companyId, java.lang.String className, long classPK);
240    
241            /**
242            * Returns a range of all the email addresses.
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.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.
246            * </p>
247            *
248            * @param start the lower bound of the range of email addresses
249            * @param end the upper bound of the range of email addresses (not inclusive)
250            * @return the range of email addresses
251            */
252            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253            public java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(
254                    int start, int end);
255    
256            /**
257            * Returns the number of email addresses.
258            *
259            * @return the number of email addresses
260            */
261            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
262            public int getEmailAddressesCount();
263    
264            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
265            public com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
266                    com.liferay.portal.kernel.lar.PortletDataContext portletDataContext);
267    
268            @Override
269            @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270            public com.liferay.portal.model.PersistedModel getPersistedModel(
271                    java.io.Serializable primaryKeyObj)
272                    throws com.liferay.portal.kernel.exception.PortalException;
273    
274            /**
275            * Sets the Spring bean ID for this bean.
276            *
277            * @param beanIdentifier the Spring bean ID for this bean
278            */
279            public void setBeanIdentifier(java.lang.String beanIdentifier);
280    
281            /**
282            * Updates the email address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
283            *
284            * @param emailAddress the email address
285            * @return the email address that was updated
286            */
287            @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX)
288            public com.liferay.portal.model.EmailAddress updateEmailAddress(
289                    com.liferay.portal.model.EmailAddress emailAddress);
290    
291            public com.liferay.portal.model.EmailAddress updateEmailAddress(
292                    long emailAddressId, java.lang.String address, int typeId,
293                    boolean primary)
294                    throws com.liferay.portal.kernel.exception.PortalException;
295    }