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 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.kernel.model.Contact addContact(
051                    com.liferay.portal.kernel.model.Contact contact) {
052                    return getService().addContact(contact);
053            }
054    
055            public static com.liferay.portal.kernel.model.Contact addContact(
056                    long userId, 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 facebookSn,
061                    java.lang.String jabberSn, java.lang.String skypeSn,
062                    java.lang.String twitterSn, java.lang.String jobTitle)
063                    throws com.liferay.portal.kernel.exception.PortalException {
064                    return getService()
065                                       .addContact(userId, className, classPK, emailAddress,
066                            firstName, middleName, lastName, prefixId, suffixId, male,
067                            birthdayMonth, birthdayDay, birthdayYear, smsSn, facebookSn,
068                            jabberSn, skypeSn, twitterSn, jobTitle);
069            }
070    
071            /**
072            * Creates a new contact with the primary key. Does not add the contact to the database.
073            *
074            * @param contactId the primary key for the new contact
075            * @return the new contact
076            */
077            public static com.liferay.portal.kernel.model.Contact createContact(
078                    long contactId) {
079                    return getService().createContact(contactId);
080            }
081    
082            /**
083            * Deletes the contact from the database. Also notifies the appropriate model listeners.
084            *
085            * @param contact the contact
086            * @return the contact that was removed
087            */
088            public static com.liferay.portal.kernel.model.Contact deleteContact(
089                    com.liferay.portal.kernel.model.Contact contact) {
090                    return getService().deleteContact(contact);
091            }
092    
093            /**
094            * Deletes the contact with the primary key from the database. Also notifies the appropriate model listeners.
095            *
096            * @param contactId the primary key of the contact
097            * @return the contact that was removed
098            * @throws PortalException if a contact with the primary key could not be found
099            */
100            public static com.liferay.portal.kernel.model.Contact deleteContact(
101                    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.kernel.model.PersistedModel deletePersistedModel(
110                    com.liferay.portal.kernel.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.kernel.model.Contact fetchContact(
194                    long contactId) {
195                    return getService().fetchContact(contactId);
196            }
197    
198            public static com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery getActionableDynamicQuery() {
199                    return getService().getActionableDynamicQuery();
200            }
201    
202            /**
203            * Returns the contact with the primary key.
204            *
205            * @param contactId the primary key of the contact
206            * @return the contact
207            * @throws PortalException if a contact with the primary key could not be found
208            */
209            public static com.liferay.portal.kernel.model.Contact getContact(
210                    long contactId)
211                    throws com.liferay.portal.kernel.exception.PortalException {
212                    return getService().getContact(contactId);
213            }
214    
215            public static java.util.List<com.liferay.portal.kernel.model.Contact> getContacts(
216                    long classNameId, long classPK, int start, int end,
217                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.kernel.model.Contact> orderByComparator) {
218                    return getService()
219                                       .getContacts(classNameId, classPK, start, end,
220                            orderByComparator);
221            }
222    
223            /**
224            * Returns a range of all the contacts.
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.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.
228            * </p>
229            *
230            * @param start the lower bound of the range of contacts
231            * @param end the upper bound of the range of contacts (not inclusive)
232            * @return the range of contacts
233            */
234            public static java.util.List<com.liferay.portal.kernel.model.Contact> getContacts(
235                    int start, int end) {
236                    return getService().getContacts(start, end);
237            }
238    
239            /**
240            * Returns the number of contacts.
241            *
242            * @return the number of contacts
243            */
244            public static int getContactsCount() {
245                    return getService().getContactsCount();
246            }
247    
248            public static int getContactsCount(long classNameId, long classPK) {
249                    return getService().getContactsCount(classNameId, classPK);
250            }
251    
252            public static com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() {
253                    return getService().getIndexableActionableDynamicQuery();
254            }
255    
256            /**
257            * Returns the OSGi service identifier.
258            *
259            * @return the OSGi service identifier
260            */
261            public static java.lang.String getOSGiServiceIdentifier() {
262                    return getService().getOSGiServiceIdentifier();
263            }
264    
265            public static com.liferay.portal.kernel.model.PersistedModel getPersistedModel(
266                    java.io.Serializable primaryKeyObj)
267                    throws com.liferay.portal.kernel.exception.PortalException {
268                    return getService().getPersistedModel(primaryKeyObj);
269            }
270    
271            /**
272            * Updates the contact in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
273            *
274            * @param contact the contact
275            * @return the contact that was updated
276            */
277            public static com.liferay.portal.kernel.model.Contact updateContact(
278                    com.liferay.portal.kernel.model.Contact contact) {
279                    return getService().updateContact(contact);
280            }
281    
282            public static com.liferay.portal.kernel.model.Contact updateContact(
283                    long contactId, java.lang.String emailAddress,
284                    java.lang.String firstName, java.lang.String middleName,
285                    java.lang.String lastName, long prefixId, long suffixId, boolean male,
286                    int birthdayMonth, int birthdayDay, int birthdayYear,
287                    java.lang.String smsSn, java.lang.String facebookSn,
288                    java.lang.String jabberSn, java.lang.String skypeSn,
289                    java.lang.String twitterSn, java.lang.String jobTitle)
290                    throws com.liferay.portal.kernel.exception.PortalException {
291                    return getService()
292                                       .updateContact(contactId, emailAddress, firstName,
293                            middleName, lastName, prefixId, suffixId, male, birthdayMonth,
294                            birthdayDay, birthdayYear, smsSn, facebookSn, jabberSn, skypeSn,
295                            twitterSn, jobTitle);
296            }
297    
298            public static ContactLocalService getService() {
299                    if (_service == null) {
300                            _service = (ContactLocalService)PortalBeanLocatorUtil.locate(ContactLocalService.class.getName());
301    
302                            ReferenceRegistry.registerReference(ContactLocalServiceUtil.class,
303                                    "_service");
304                    }
305    
306                    return _service;
307            }
308    
309            private static ContactLocalService _service;
310    }