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.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.util.ReferenceRegistry;
021    
022    /**
023     * Provides the local service utility for EmailAddress. This utility wraps
024     * {@link com.liferay.portal.service.impl.EmailAddressLocalServiceImpl} and is the
025     * primary access point for service operations in application layer code running
026     * on the local server. Methods of this service will not have security checks
027     * based on the propagated JAAS credentials because this service can only be
028     * accessed from within the same VM.
029     *
030     * @author Brian Wing Shun Chan
031     * @see EmailAddressLocalService
032     * @see com.liferay.portal.service.base.EmailAddressLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.EmailAddressLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class EmailAddressLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.EmailAddressLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the email address to the database. Also notifies the appropriate model listeners.
046            *
047            * @param emailAddress the email address
048            * @return the email address that was added
049            */
050            public static com.liferay.portal.model.EmailAddress addEmailAddress(
051                    com.liferay.portal.model.EmailAddress emailAddress) {
052                    return getService().addEmailAddress(emailAddress);
053            }
054    
055            /**
056            * @deprecated As of 6.2.0, replaced by {@link #addEmailAddress(long,
057            String, long, String, int, boolean, ServiceContext)}
058            */
059            @Deprecated
060            public static com.liferay.portal.model.EmailAddress addEmailAddress(
061                    long userId, java.lang.String className, long classPK,
062                    java.lang.String address, long typeId, boolean primary)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    return getService()
065                                       .addEmailAddress(userId, className, classPK, address,
066                            typeId, primary);
067            }
068    
069            public static com.liferay.portal.model.EmailAddress addEmailAddress(
070                    long userId, java.lang.String className, long classPK,
071                    java.lang.String address, long typeId, boolean primary,
072                    com.liferay.portal.service.ServiceContext serviceContext)
073                    throws com.liferay.portal.kernel.exception.PortalException {
074                    return getService()
075                                       .addEmailAddress(userId, className, classPK, address,
076                            typeId, primary, serviceContext);
077            }
078    
079            /**
080            * Creates a new email address with the primary key. Does not add the email address to the database.
081            *
082            * @param emailAddressId the primary key for the new email address
083            * @return the new email address
084            */
085            public static com.liferay.portal.model.EmailAddress createEmailAddress(
086                    long emailAddressId) {
087                    return getService().createEmailAddress(emailAddressId);
088            }
089    
090            /**
091            * Deletes the email address from the database. Also notifies the appropriate model listeners.
092            *
093            * @param emailAddress the email address
094            * @return the email address that was removed
095            */
096            public static com.liferay.portal.model.EmailAddress deleteEmailAddress(
097                    com.liferay.portal.model.EmailAddress emailAddress) {
098                    return getService().deleteEmailAddress(emailAddress);
099            }
100    
101            /**
102            * Deletes the email address with the primary key from the database. Also notifies the appropriate model listeners.
103            *
104            * @param emailAddressId the primary key of the email address
105            * @return the email address that was removed
106            * @throws PortalException if a email address with the primary key could not be found
107            */
108            public static com.liferay.portal.model.EmailAddress deleteEmailAddress(
109                    long emailAddressId)
110                    throws com.liferay.portal.kernel.exception.PortalException {
111                    return getService().deleteEmailAddress(emailAddressId);
112            }
113    
114            public static void deleteEmailAddresses(long companyId,
115                    java.lang.String className, long classPK) {
116                    getService().deleteEmailAddresses(companyId, className, classPK);
117            }
118    
119            /**
120            * @throws PortalException
121            */
122            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
123                    com.liferay.portal.model.PersistedModel persistedModel)
124                    throws com.liferay.portal.kernel.exception.PortalException {
125                    return getService().deletePersistedModel(persistedModel);
126            }
127    
128            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
129                    return getService().dynamicQuery();
130            }
131    
132            /**
133            * Performs a dynamic query on the database and returns the matching rows.
134            *
135            * @param dynamicQuery the dynamic query
136            * @return the matching rows
137            */
138            public static <T> java.util.List<T> dynamicQuery(
139                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
140                    return getService().dynamicQuery(dynamicQuery);
141            }
142    
143            /**
144            * Performs a dynamic query on the database and returns a range of the matching rows.
145            *
146            * <p>
147            * 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.
148            * </p>
149            *
150            * @param dynamicQuery the dynamic query
151            * @param start the lower bound of the range of model instances
152            * @param end the upper bound of the range of model instances (not inclusive)
153            * @return the range of matching rows
154            */
155            public static <T> java.util.List<T> dynamicQuery(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
157                    int end) {
158                    return getService().dynamicQuery(dynamicQuery, start, end);
159            }
160    
161            /**
162            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
163            *
164            * <p>
165            * 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.
166            * </p>
167            *
168            * @param dynamicQuery the dynamic query
169            * @param start the lower bound of the range of model instances
170            * @param end the upper bound of the range of model instances (not inclusive)
171            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
172            * @return the ordered range of matching rows
173            */
174            public static <T> java.util.List<T> dynamicQuery(
175                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
176                    int end,
177                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
178                    return getService()
179                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
180            }
181    
182            /**
183            * Returns the number of rows matching the dynamic query.
184            *
185            * @param dynamicQuery the dynamic query
186            * @return the number of rows matching the dynamic query
187            */
188            public static long dynamicQueryCount(
189                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
190                    return getService().dynamicQueryCount(dynamicQuery);
191            }
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 static long dynamicQueryCount(
201                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
202                    com.liferay.portal.kernel.dao.orm.Projection projection) {
203                    return getService().dynamicQueryCount(dynamicQuery, projection);
204            }
205    
206            public static com.liferay.portal.model.EmailAddress fetchEmailAddress(
207                    long emailAddressId) {
208                    return getService().fetchEmailAddress(emailAddressId);
209            }
210    
211            /**
212            * Returns the email address with the matching UUID and company.
213            *
214            * @param uuid the email address's UUID
215            * @param companyId the primary key of the company
216            * @return the matching email address, or <code>null</code> if a matching email address could not be found
217            */
218            public static com.liferay.portal.model.EmailAddress fetchEmailAddressByUuidAndCompanyId(
219                    java.lang.String uuid, long companyId) {
220                    return getService().fetchEmailAddressByUuidAndCompanyId(uuid, companyId);
221            }
222    
223            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
224                    return getService().getActionableDynamicQuery();
225            }
226    
227            /**
228            * Returns the email address with the primary key.
229            *
230            * @param emailAddressId the primary key of the email address
231            * @return the email address
232            * @throws PortalException if a email address with the primary key could not be found
233            */
234            public static com.liferay.portal.model.EmailAddress getEmailAddress(
235                    long emailAddressId)
236                    throws com.liferay.portal.kernel.exception.PortalException {
237                    return getService().getEmailAddress(emailAddressId);
238            }
239    
240            /**
241            * Returns the email address with the matching UUID and company.
242            *
243            * @param uuid the email address's UUID
244            * @param companyId the primary key of the company
245            * @return the matching email address
246            * @throws PortalException if a matching email address could not be found
247            */
248            public static com.liferay.portal.model.EmailAddress getEmailAddressByUuidAndCompanyId(
249                    java.lang.String uuid, long companyId)
250                    throws com.liferay.portal.kernel.exception.PortalException {
251                    return getService().getEmailAddressByUuidAndCompanyId(uuid, companyId);
252            }
253    
254            public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses() {
255                    return getService().getEmailAddresses();
256            }
257    
258            public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(
259                    long companyId, java.lang.String className, long classPK) {
260                    return getService().getEmailAddresses(companyId, className, classPK);
261            }
262    
263            /**
264            * Returns a range of all the email addresses.
265            *
266            * <p>
267            * 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.
268            * </p>
269            *
270            * @param start the lower bound of the range of email addresses
271            * @param end the upper bound of the range of email addresses (not inclusive)
272            * @return the range of email addresses
273            */
274            public static java.util.List<com.liferay.portal.model.EmailAddress> getEmailAddresses(
275                    int start, int end) {
276                    return getService().getEmailAddresses(start, end);
277            }
278    
279            /**
280            * Returns the number of email addresses.
281            *
282            * @return the number of email addresses
283            */
284            public static int getEmailAddressesCount() {
285                    return getService().getEmailAddressesCount();
286            }
287    
288            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
289                    com.liferay.portlet.exportimport.lar.PortletDataContext portletDataContext) {
290                    return getService().getExportActionableDynamicQuery(portletDataContext);
291            }
292    
293            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
294                    return getService().getIndexableActionableDynamicQuery();
295            }
296    
297            /**
298            * Returns the OSGi service identifier.
299            *
300            * @return the OSGi service identifier
301            */
302            public static java.lang.String getOSGiServiceIdentifier() {
303                    return getService().getOSGiServiceIdentifier();
304            }
305    
306            public static com.liferay.portal.model.PersistedModel getPersistedModel(
307                    java.io.Serializable primaryKeyObj)
308                    throws com.liferay.portal.kernel.exception.PortalException {
309                    return getService().getPersistedModel(primaryKeyObj);
310            }
311    
312            /**
313            * Updates the email address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
314            *
315            * @param emailAddress the email address
316            * @return the email address that was updated
317            */
318            public static com.liferay.portal.model.EmailAddress updateEmailAddress(
319                    com.liferay.portal.model.EmailAddress emailAddress) {
320                    return getService().updateEmailAddress(emailAddress);
321            }
322    
323            public static com.liferay.portal.model.EmailAddress updateEmailAddress(
324                    long emailAddressId, java.lang.String address, long typeId,
325                    boolean primary)
326                    throws com.liferay.portal.kernel.exception.PortalException {
327                    return getService()
328                                       .updateEmailAddress(emailAddressId, address, typeId, primary);
329            }
330    
331            public static EmailAddressLocalService getService() {
332                    if (_service == null) {
333                            _service = (EmailAddressLocalService)PortalBeanLocatorUtil.locate(EmailAddressLocalService.class.getName());
334    
335                            ReferenceRegistry.registerReference(EmailAddressLocalServiceUtil.class,
336                                    "_service");
337                    }
338    
339                    return _service;
340            }
341    
342            /**
343             * @deprecated As of 6.2.0
344             */
345            @Deprecated
346            public void setService(EmailAddressLocalService service) {
347            }
348    
349            private static EmailAddressLocalService _service;
350    }