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.kernel.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            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
044                    return getService().getActionableDynamicQuery();
045            }
046    
047            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
048                    return getService().dynamicQuery();
049            }
050    
051            public static com.liferay.portal.kernel.dao.orm.ExportActionableDynamicQuery getExportActionableDynamicQuery(
052                    com.liferay.exportimport.kernel.lar.PortletDataContext portletDataContext) {
053                    return getService().getExportActionableDynamicQuery(portletDataContext);
054            }
055    
056            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
057                    return getService().getIndexableActionableDynamicQuery();
058            }
059    
060            /**
061            * Adds the email address to the database. Also notifies the appropriate model listeners.
062            *
063            * @param emailAddress the email address
064            * @return the email address that was added
065            */
066            public static com.liferay.portal.kernel.model.EmailAddress addEmailAddress(
067                    com.liferay.portal.kernel.model.EmailAddress emailAddress) {
068                    return getService().addEmailAddress(emailAddress);
069            }
070    
071            public static com.liferay.portal.kernel.model.EmailAddress addEmailAddress(
072                    long userId, java.lang.String className, long classPK,
073                    java.lang.String address, long typeId, boolean primary,
074                    ServiceContext serviceContext)
075                    throws com.liferay.portal.kernel.exception.PortalException {
076                    return getService()
077                                       .addEmailAddress(userId, className, classPK, address,
078                            typeId, primary, serviceContext);
079            }
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 static com.liferay.portal.kernel.model.EmailAddress createEmailAddress(
088                    long emailAddressId) {
089                    return getService().createEmailAddress(emailAddressId);
090            }
091    
092            /**
093            * Deletes the email address from the database. Also notifies the appropriate model listeners.
094            *
095            * @param emailAddress the email address
096            * @return the email address that was removed
097            */
098            public static com.liferay.portal.kernel.model.EmailAddress deleteEmailAddress(
099                    com.liferay.portal.kernel.model.EmailAddress emailAddress) {
100                    return getService().deleteEmailAddress(emailAddress);
101            }
102    
103            /**
104            * Deletes the email address with the primary key from the database. Also notifies the appropriate model listeners.
105            *
106            * @param emailAddressId the primary key of the email address
107            * @return the email address that was removed
108            * @throws PortalException if a email address with the primary key could not be found
109            */
110            public static com.liferay.portal.kernel.model.EmailAddress deleteEmailAddress(
111                    long emailAddressId)
112                    throws com.liferay.portal.kernel.exception.PortalException {
113                    return getService().deleteEmailAddress(emailAddressId);
114            }
115    
116            public static com.liferay.portal.kernel.model.EmailAddress fetchEmailAddress(
117                    long emailAddressId) {
118                    return getService().fetchEmailAddress(emailAddressId);
119            }
120    
121            /**
122            * Returns the email address with the matching UUID and company.
123            *
124            * @param uuid the email address's UUID
125            * @param companyId the primary key of the company
126            * @return the matching email address, or <code>null</code> if a matching email address could not be found
127            */
128            public static com.liferay.portal.kernel.model.EmailAddress fetchEmailAddressByUuidAndCompanyId(
129                    java.lang.String uuid, long companyId) {
130                    return getService().fetchEmailAddressByUuidAndCompanyId(uuid, companyId);
131            }
132    
133            /**
134            * Returns the email address with the primary key.
135            *
136            * @param emailAddressId the primary key of the email address
137            * @return the email address
138            * @throws PortalException if a email address with the primary key could not be found
139            */
140            public static com.liferay.portal.kernel.model.EmailAddress getEmailAddress(
141                    long emailAddressId)
142                    throws com.liferay.portal.kernel.exception.PortalException {
143                    return getService().getEmailAddress(emailAddressId);
144            }
145    
146            /**
147            * Returns the email address with the matching UUID and company.
148            *
149            * @param uuid the email address's UUID
150            * @param companyId the primary key of the company
151            * @return the matching email address
152            * @throws PortalException if a matching email address could not be found
153            */
154            public static com.liferay.portal.kernel.model.EmailAddress getEmailAddressByUuidAndCompanyId(
155                    java.lang.String uuid, long companyId)
156                    throws com.liferay.portal.kernel.exception.PortalException {
157                    return getService().getEmailAddressByUuidAndCompanyId(uuid, companyId);
158            }
159    
160            /**
161            * Updates the email address in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
162            *
163            * @param emailAddress the email address
164            * @return the email address that was updated
165            */
166            public static com.liferay.portal.kernel.model.EmailAddress updateEmailAddress(
167                    com.liferay.portal.kernel.model.EmailAddress emailAddress) {
168                    return getService().updateEmailAddress(emailAddress);
169            }
170    
171            public static com.liferay.portal.kernel.model.EmailAddress updateEmailAddress(
172                    long emailAddressId, java.lang.String address, long typeId,
173                    boolean primary)
174                    throws com.liferay.portal.kernel.exception.PortalException {
175                    return getService()
176                                       .updateEmailAddress(emailAddressId, address, typeId, primary);
177            }
178    
179            /**
180            * @throws PortalException
181            */
182            public static com.liferay.portal.kernel.model.PersistedModel deletePersistedModel(
183                    com.liferay.portal.kernel.model.PersistedModel persistedModel)
184                    throws com.liferay.portal.kernel.exception.PortalException {
185                    return getService().deletePersistedModel(persistedModel);
186            }
187    
188            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
189                    java.io.Serializable primaryKeyObj)
190                    throws com.liferay.portal.kernel.exception.PortalException {
191                    return getService().getPersistedModel(primaryKeyObj);
192            }
193    
194            /**
195            * Returns the number of email addresses.
196            *
197            * @return the number of email addresses
198            */
199            public static int getEmailAddressesCount() {
200                    return getService().getEmailAddressesCount();
201            }
202    
203            /**
204            * Returns the OSGi service identifier.
205            *
206            * @return the OSGi service identifier
207            */
208            public static java.lang.String getOSGiServiceIdentifier() {
209                    return getService().getOSGiServiceIdentifier();
210            }
211    
212            /**
213            * Performs a dynamic query on the database and returns the matching rows.
214            *
215            * @param dynamicQuery the dynamic query
216            * @return the matching rows
217            */
218            public static <T> java.util.List<T> dynamicQuery(
219                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
220                    return getService().dynamicQuery(dynamicQuery);
221            }
222    
223            /**
224            * Performs a dynamic query on the database and returns a range of the matching rows.
225            *
226            * <p>
227            * 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.
228            * </p>
229            *
230            * @param dynamicQuery the dynamic query
231            * @param start the lower bound of the range of model instances
232            * @param end the upper bound of the range of model instances (not inclusive)
233            * @return the range of matching rows
234            */
235            public static <T> java.util.List<T> dynamicQuery(
236                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
237                    int end) {
238                    return getService().dynamicQuery(dynamicQuery, start, end);
239            }
240    
241            /**
242            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
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 dynamicQuery the dynamic query
249            * @param start the lower bound of the range of model instances
250            * @param end the upper bound of the range of model instances (not inclusive)
251            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
252            * @return the ordered range of matching rows
253            */
254            public static <T> java.util.List<T> dynamicQuery(
255                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
256                    int end,
257                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
258                    return getService()
259                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
260            }
261    
262            public static java.util.List<com.liferay.portal.kernel.model.EmailAddress> getEmailAddresses() {
263                    return getService().getEmailAddresses();
264            }
265    
266            /**
267            * Returns a range of all the email addresses.
268            *
269            * <p>
270            * 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.
271            * </p>
272            *
273            * @param start the lower bound of the range of email addresses
274            * @param end the upper bound of the range of email addresses (not inclusive)
275            * @return the range of email addresses
276            */
277            public static java.util.List<com.liferay.portal.kernel.model.EmailAddress> getEmailAddresses(
278                    int start, int end) {
279                    return getService().getEmailAddresses(start, end);
280            }
281    
282            public static java.util.List<com.liferay.portal.kernel.model.EmailAddress> getEmailAddresses(
283                    long companyId, java.lang.String className, long classPK) {
284                    return getService().getEmailAddresses(companyId, className, classPK);
285            }
286    
287            /**
288            * Returns the number of rows matching the dynamic query.
289            *
290            * @param dynamicQuery the dynamic query
291            * @return the number of rows matching the dynamic query
292            */
293            public static long dynamicQueryCount(
294                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
295                    return getService().dynamicQueryCount(dynamicQuery);
296            }
297    
298            /**
299            * Returns the number of rows matching the dynamic query.
300            *
301            * @param dynamicQuery the dynamic query
302            * @param projection the projection to apply to the query
303            * @return the number of rows matching the dynamic query
304            */
305            public static long dynamicQueryCount(
306                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
307                    com.liferay.portal.kernel.dao.orm.Projection projection) {
308                    return getService().dynamicQueryCount(dynamicQuery, projection);
309            }
310    
311            public static void deleteEmailAddresses(long companyId,
312                    java.lang.String className, long classPK) {
313                    getService().deleteEmailAddresses(companyId, className, classPK);
314            }
315    
316            public static EmailAddressLocalService getService() {
317                    if (_service == null) {
318                            _service = (EmailAddressLocalService)PortalBeanLocatorUtil.locate(EmailAddressLocalService.class.getName());
319    
320                            ReferenceRegistry.registerReference(EmailAddressLocalServiceUtil.class,
321                                    "_service");
322                    }
323    
324                    return _service;
325            }
326    
327            private static EmailAddressLocalService _service;
328    }