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 Contact. This utility wraps
024     * {@link com.liferay.portal.service.impl.ContactLocalServiceImpl} 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 ContactLocalService
032     * @see com.liferay.portal.service.base.ContactLocalServiceBaseImpl
033     * @see com.liferay.portal.service.impl.ContactLocalServiceImpl
034     * @generated
035     */
036    @ProviderType
037    public class ContactLocalServiceUtil {
038            /*
039             * NOTE FOR DEVELOPERS:
040             *
041             * Never modify this class directly. Add custom service methods to {@link com.liferay.portal.service.impl.ContactLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
042             */
043    
044            /**
045            * Adds the contact to the database. Also notifies the appropriate model listeners.
046            *
047            * @param contact the contact
048            * @return the contact that was added
049            */
050            public static com.liferay.portal.model.Contact addContact(
051                    com.liferay.portal.model.Contact contact) {
052                    return getService().addContact(contact);
053            }
054    
055            public static com.liferay.portal.model.Contact addContact(long userId,
056                    java.lang.String className, long classPK,
057                    java.lang.String emailAddress, java.lang.String firstName,
058                    java.lang.String middleName, java.lang.String lastName, long prefixId,
059                    long suffixId, boolean male, int birthdayMonth, int birthdayDay,
060                    int birthdayYear, java.lang.String smsSn, java.lang.String aimSn,
061                    java.lang.String facebookSn, java.lang.String icqSn,
062                    java.lang.String jabberSn, java.lang.String mySpaceSn,
063                    java.lang.String skypeSn, java.lang.String twitterSn,
064                    java.lang.String ymSn, java.lang.String jobTitle)
065                    throws com.liferay.portal.kernel.exception.PortalException {
066                    return getService()
067                                       .addContact(userId, className, classPK, emailAddress,
068                            firstName, middleName, lastName, prefixId, suffixId, male,
069                            birthdayMonth, birthdayDay, birthdayYear, smsSn, aimSn, facebookSn,
070                            icqSn, jabberSn, mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle);
071            }
072    
073            /**
074            * Creates a new contact with the primary key. Does not add the contact to the database.
075            *
076            * @param contactId the primary key for the new contact
077            * @return the new contact
078            */
079            public static com.liferay.portal.model.Contact createContact(long contactId) {
080                    return getService().createContact(contactId);
081            }
082    
083            /**
084            * Deletes the contact from the database. Also notifies the appropriate model listeners.
085            *
086            * @param contact the contact
087            * @return the contact that was removed
088            */
089            public static com.liferay.portal.model.Contact deleteContact(
090                    com.liferay.portal.model.Contact contact) {
091                    return getService().deleteContact(contact);
092            }
093    
094            /**
095            * Deletes the contact with the primary key from the database. Also notifies the appropriate model listeners.
096            *
097            * @param contactId the primary key of the contact
098            * @return the contact that was removed
099            * @throws PortalException if a contact with the primary key could not be found
100            */
101            public static com.liferay.portal.model.Contact deleteContact(long contactId)
102                    throws com.liferay.portal.kernel.exception.PortalException {
103                    return getService().deleteContact(contactId);
104            }
105    
106            /**
107            * @throws PortalException
108            */
109            public static com.liferay.portal.model.PersistedModel deletePersistedModel(
110                    com.liferay.portal.model.PersistedModel persistedModel)
111                    throws com.liferay.portal.kernel.exception.PortalException {
112                    return getService().deletePersistedModel(persistedModel);
113            }
114    
115            public static com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery() {
116                    return getService().dynamicQuery();
117            }
118    
119            /**
120            * Performs a dynamic query on the database and returns the matching rows.
121            *
122            * @param dynamicQuery the dynamic query
123            * @return the matching rows
124            */
125            public static <T> java.util.List<T> dynamicQuery(
126                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
127                    return getService().dynamicQuery(dynamicQuery);
128            }
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.ContactModelImpl}. 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 static <T> java.util.List<T> dynamicQuery(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
144                    int end) {
145                    return getService().dynamicQuery(dynamicQuery, start, end);
146            }
147    
148            /**
149            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
150            *
151            * <p>
152            * 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.ContactModelImpl}. 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.
153            * </p>
154            *
155            * @param dynamicQuery the dynamic query
156            * @param start the lower bound of the range of model instances
157            * @param end the upper bound of the range of model instances (not inclusive)
158            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
159            * @return the ordered range of matching rows
160            */
161            public static <T> java.util.List<T> dynamicQuery(
162                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
163                    int end,
164                    com.liferay.portal.kernel.util.OrderByComparator<T> orderByComparator) {
165                    return getService()
166                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
167            }
168    
169            /**
170            * Returns the number of rows matching the dynamic query.
171            *
172            * @param dynamicQuery the dynamic query
173            * @return the number of rows matching the dynamic query
174            */
175            public static long dynamicQueryCount(
176                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) {
177                    return getService().dynamicQueryCount(dynamicQuery);
178            }
179    
180            /**
181            * Returns the number of rows matching the dynamic query.
182            *
183            * @param dynamicQuery the dynamic query
184            * @param projection the projection to apply to the query
185            * @return the number of rows matching the dynamic query
186            */
187            public static long dynamicQueryCount(
188                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
189                    com.liferay.portal.kernel.dao.orm.Projection projection) {
190                    return getService().dynamicQueryCount(dynamicQuery, projection);
191            }
192    
193            public static com.liferay.portal.model.Contact fetchContact(long contactId) {
194                    return getService().fetchContact(contactId);
195            }
196    
197            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
198                    return getService().getActionableDynamicQuery();
199            }
200    
201            /**
202            * Returns the Spring bean ID for this bean.
203            *
204            * @return the Spring bean ID for this bean
205            */
206            public static java.lang.String getBeanIdentifier() {
207                    return getService().getBeanIdentifier();
208            }
209    
210            /**
211            * Returns the contact with the primary key.
212            *
213            * @param contactId the primary key of the contact
214            * @return the contact
215            * @throws PortalException if a contact with the primary key could not be found
216            */
217            public static com.liferay.portal.model.Contact getContact(long contactId)
218                    throws com.liferay.portal.kernel.exception.PortalException {
219                    return getService().getContact(contactId);
220            }
221    
222            public static java.util.List<com.liferay.portal.model.Contact> getContacts(
223                    long classNameId, long classPK, int start, int end,
224                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Contact> orderByComparator) {
225                    return getService()
226                                       .getContacts(classNameId, classPK, start, end,
227                            orderByComparator);
228            }
229    
230            /**
231            * Returns a range of all the contacts.
232            *
233            * <p>
234            * 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.ContactModelImpl}. 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.
235            * </p>
236            *
237            * @param start the lower bound of the range of contacts
238            * @param end the upper bound of the range of contacts (not inclusive)
239            * @return the range of contacts
240            */
241            public static java.util.List<com.liferay.portal.model.Contact> getContacts(
242                    int start, int end) {
243                    return getService().getContacts(start, end);
244            }
245    
246            /**
247            * Returns the number of contacts.
248            *
249            * @return the number of contacts
250            */
251            public static int getContactsCount() {
252                    return getService().getContactsCount();
253            }
254    
255            public static int getContactsCount(long classNameId, long classPK) {
256                    return getService().getContactsCount(classNameId, classPK);
257            }
258    
259            public static com.liferay.portal.model.PersistedModel getPersistedModel(
260                    java.io.Serializable primaryKeyObj)
261                    throws com.liferay.portal.kernel.exception.PortalException {
262                    return getService().getPersistedModel(primaryKeyObj);
263            }
264    
265            /**
266            * Sets the Spring bean ID for this bean.
267            *
268            * @param beanIdentifier the Spring bean ID for this bean
269            */
270            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
271                    getService().setBeanIdentifier(beanIdentifier);
272            }
273    
274            /**
275            * Updates the contact in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
276            *
277            * @param contact the contact
278            * @return the contact that was updated
279            */
280            public static com.liferay.portal.model.Contact updateContact(
281                    com.liferay.portal.model.Contact contact) {
282                    return getService().updateContact(contact);
283            }
284    
285            public static com.liferay.portal.model.Contact updateContact(
286                    long contactId, java.lang.String emailAddress,
287                    java.lang.String firstName, java.lang.String middleName,
288                    java.lang.String lastName, long prefixId, long suffixId, boolean male,
289                    int birthdayMonth, int birthdayDay, int birthdayYear,
290                    java.lang.String smsSn, java.lang.String aimSn,
291                    java.lang.String facebookSn, java.lang.String icqSn,
292                    java.lang.String jabberSn, java.lang.String mySpaceSn,
293                    java.lang.String skypeSn, java.lang.String twitterSn,
294                    java.lang.String ymSn, java.lang.String jobTitle)
295                    throws com.liferay.portal.kernel.exception.PortalException {
296                    return getService()
297                                       .updateContact(contactId, emailAddress, firstName,
298                            middleName, lastName, prefixId, suffixId, male, birthdayMonth,
299                            birthdayDay, birthdayYear, smsSn, aimSn, facebookSn, icqSn,
300                            jabberSn, mySpaceSn, skypeSn, twitterSn, ymSn, jobTitle);
301            }
302    
303            public static ContactLocalService getService() {
304                    if (_service == null) {
305                            _service = (ContactLocalService)PortalBeanLocatorUtil.locate(ContactLocalService.class.getName());
306    
307                            ReferenceRegistry.registerReference(ContactLocalServiceUtil.class,
308                                    "_service");
309                    }
310    
311                    return _service;
312            }
313    
314            /**
315             * @deprecated As of 6.2.0
316             */
317            @Deprecated
318            public void setService(ContactLocalService service) {
319            }
320    
321            private static ContactLocalService _service;
322    }