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