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