001    /**
002     * Copyright (c) 2000-2012 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.portlet.social.service;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.MethodCache;
019    import com.liferay.portal.kernel.util.ReferenceRegistry;
020    
021    /**
022     * The utility for the social activity achievement local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} and is the primary access point for service operations in application layer code running on the local server.
023     *
024     * <p>
025     * This is a local service. Methods of this service will not have security checks based on the propagated JAAS credentials because this service can only be accessed from within the same VM.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see SocialActivityAchievementLocalService
030     * @see com.liferay.portlet.social.service.base.SocialActivityAchievementLocalServiceBaseImpl
031     * @see com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl
032     * @generated
033     */
034    public class SocialActivityAchievementLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityAchievementLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the social activity achievement to the database. Also notifies the appropriate model listeners.
043            *
044            * @param socialActivityAchievement the social activity achievement
045            * @return the social activity achievement that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.social.model.SocialActivityAchievement addSocialActivityAchievement(
049                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService()
052                                       .addSocialActivityAchievement(socialActivityAchievement);
053            }
054    
055            /**
056            * Creates a new social activity achievement with the primary key. Does not add the social activity achievement to the database.
057            *
058            * @param activityAchievementId the primary key for the new social activity achievement
059            * @return the new social activity achievement
060            */
061            public static com.liferay.portlet.social.model.SocialActivityAchievement createSocialActivityAchievement(
062                    long activityAchievementId) {
063                    return getService()
064                                       .createSocialActivityAchievement(activityAchievementId);
065            }
066    
067            /**
068            * Deletes the social activity achievement with the primary key from the database. Also notifies the appropriate model listeners.
069            *
070            * @param activityAchievementId the primary key of the social activity achievement
071            * @throws PortalException if a social activity achievement with the primary key could not be found
072            * @throws SystemException if a system exception occurred
073            */
074            public static void deleteSocialActivityAchievement(
075                    long activityAchievementId)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException {
078                    getService().deleteSocialActivityAchievement(activityAchievementId);
079            }
080    
081            /**
082            * Deletes the social activity achievement from the database. Also notifies the appropriate model listeners.
083            *
084            * @param socialActivityAchievement the social activity achievement
085            * @throws SystemException if a system exception occurred
086            */
087            public static void deleteSocialActivityAchievement(
088                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement)
089                    throws com.liferay.portal.kernel.exception.SystemException {
090                    getService().deleteSocialActivityAchievement(socialActivityAchievement);
091            }
092    
093            /**
094            * Performs a dynamic query on the database and returns the matching rows.
095            *
096            * @param dynamicQuery the dynamic query
097            * @return the matching rows
098            * @throws SystemException if a system exception occurred
099            */
100            @SuppressWarnings("rawtypes")
101            public static java.util.List dynamicQuery(
102                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
103                    throws com.liferay.portal.kernel.exception.SystemException {
104                    return getService().dynamicQuery(dynamicQuery);
105            }
106    
107            /**
108            * Performs a dynamic query on the database and returns a range of the matching rows.
109            *
110            * <p>
111            * 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.
112            * </p>
113            *
114            * @param dynamicQuery the dynamic query
115            * @param start the lower bound of the range of model instances
116            * @param end the upper bound of the range of model instances (not inclusive)
117            * @return the range of matching rows
118            * @throws SystemException if a system exception occurred
119            */
120            @SuppressWarnings("rawtypes")
121            public static java.util.List dynamicQuery(
122                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
123                    int end) throws com.liferay.portal.kernel.exception.SystemException {
124                    return getService().dynamicQuery(dynamicQuery, start, end);
125            }
126    
127            /**
128            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
129            *
130            * <p>
131            * 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.
132            * </p>
133            *
134            * @param dynamicQuery the dynamic query
135            * @param start the lower bound of the range of model instances
136            * @param end the upper bound of the range of model instances (not inclusive)
137            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
138            * @return the ordered range of matching rows
139            * @throws SystemException if a system exception occurred
140            */
141            @SuppressWarnings("rawtypes")
142            public static java.util.List dynamicQuery(
143                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
144                    int end,
145                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
146                    throws com.liferay.portal.kernel.exception.SystemException {
147                    return getService()
148                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
149            }
150    
151            /**
152            * Returns the number of rows that match the dynamic query.
153            *
154            * @param dynamicQuery the dynamic query
155            * @return the number of rows that match the dynamic query
156            * @throws SystemException if a system exception occurred
157            */
158            public static long dynamicQueryCount(
159                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getService().dynamicQueryCount(dynamicQuery);
162            }
163    
164            public static com.liferay.portlet.social.model.SocialActivityAchievement fetchSocialActivityAchievement(
165                    long activityAchievementId)
166                    throws com.liferay.portal.kernel.exception.SystemException {
167                    return getService().fetchSocialActivityAchievement(activityAchievementId);
168            }
169    
170            /**
171            * Returns the social activity achievement with the primary key.
172            *
173            * @param activityAchievementId the primary key of the social activity achievement
174            * @return the social activity achievement
175            * @throws PortalException if a social activity achievement with the primary key could not be found
176            * @throws SystemException if a system exception occurred
177            */
178            public static com.liferay.portlet.social.model.SocialActivityAchievement getSocialActivityAchievement(
179                    long activityAchievementId)
180                    throws com.liferay.portal.kernel.exception.PortalException,
181                            com.liferay.portal.kernel.exception.SystemException {
182                    return getService().getSocialActivityAchievement(activityAchievementId);
183            }
184    
185            public static com.liferay.portal.model.PersistedModel getPersistedModel(
186                    java.io.Serializable primaryKeyObj)
187                    throws com.liferay.portal.kernel.exception.PortalException,
188                            com.liferay.portal.kernel.exception.SystemException {
189                    return getService().getPersistedModel(primaryKeyObj);
190            }
191    
192            /**
193            * Returns a range of all the social activity achievements.
194            *
195            * <p>
196            * 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.
197            * </p>
198            *
199            * @param start the lower bound of the range of social activity achievements
200            * @param end the upper bound of the range of social activity achievements (not inclusive)
201            * @return the range of social activity achievements
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getSocialActivityAchievements(
205                    int start, int end)
206                    throws com.liferay.portal.kernel.exception.SystemException {
207                    return getService().getSocialActivityAchievements(start, end);
208            }
209    
210            /**
211            * Returns the number of social activity achievements.
212            *
213            * @return the number of social activity achievements
214            * @throws SystemException if a system exception occurred
215            */
216            public static int getSocialActivityAchievementsCount()
217                    throws com.liferay.portal.kernel.exception.SystemException {
218                    return getService().getSocialActivityAchievementsCount();
219            }
220    
221            /**
222            * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
223            *
224            * @param socialActivityAchievement the social activity achievement
225            * @return the social activity achievement that was updated
226            * @throws SystemException if a system exception occurred
227            */
228            public static com.liferay.portlet.social.model.SocialActivityAchievement updateSocialActivityAchievement(
229                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getService()
232                                       .updateSocialActivityAchievement(socialActivityAchievement);
233            }
234    
235            /**
236            * Updates the social activity achievement in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
237            *
238            * @param socialActivityAchievement the social activity achievement
239            * @param merge whether to merge the social activity achievement with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
240            * @return the social activity achievement that was updated
241            * @throws SystemException if a system exception occurred
242            */
243            public static com.liferay.portlet.social.model.SocialActivityAchievement updateSocialActivityAchievement(
244                    com.liferay.portlet.social.model.SocialActivityAchievement socialActivityAchievement,
245                    boolean merge)
246                    throws com.liferay.portal.kernel.exception.SystemException {
247                    return getService()
248                                       .updateSocialActivityAchievement(socialActivityAchievement,
249                            merge);
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 void addActivityAchievement(long userId, long groupId,
271                    com.liferay.portlet.social.model.SocialAchievement achievement)
272                    throws com.liferay.portal.kernel.exception.PortalException,
273                            com.liferay.portal.kernel.exception.SystemException {
274                    getService().addActivityAchievement(userId, groupId, achievement);
275            }
276    
277            public static com.liferay.portlet.social.model.SocialActivityAchievement fetchUserAchievement(
278                    long userId, long groupId, java.lang.String name)
279                    throws com.liferay.portal.kernel.exception.SystemException {
280                    return getService().fetchUserAchievement(userId, groupId, name);
281            }
282    
283            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getGroupAchievements(
284                    long groupId)
285                    throws com.liferay.portal.kernel.exception.SystemException {
286                    return getService().getGroupAchievements(groupId);
287            }
288    
289            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getGroupAchievements(
290                    long groupId, java.lang.String name)
291                    throws com.liferay.portal.kernel.exception.SystemException {
292                    return getService().getGroupAchievements(groupId, name);
293            }
294    
295            public static int getGroupAchievementsCount(long groupId)
296                    throws com.liferay.portal.kernel.exception.SystemException {
297                    return getService().getGroupAchievementsCount(groupId);
298            }
299    
300            public static int getGroupAchievementsCount(long groupId,
301                    java.lang.String name)
302                    throws com.liferay.portal.kernel.exception.SystemException {
303                    return getService().getGroupAchievementsCount(groupId, name);
304            }
305    
306            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getGroupFirstAchievements(
307                    long groupId)
308                    throws com.liferay.portal.kernel.exception.SystemException {
309                    return getService().getGroupFirstAchievements(groupId);
310            }
311    
312            public static int getGroupFirstAchievementsCount(long groupId)
313                    throws com.liferay.portal.kernel.exception.SystemException {
314                    return getService().getGroupFirstAchievementsCount(groupId);
315            }
316    
317            public static int getUserAchievementCount(long userId, long groupId,
318                    java.lang.String name)
319                    throws com.liferay.portal.kernel.exception.SystemException {
320                    return getService().getUserAchievementCount(userId, groupId, name);
321            }
322    
323            public static java.util.List<com.liferay.portlet.social.model.SocialActivityAchievement> getUserAchievements(
324                    long userId, long groupId, java.lang.String name)
325                    throws com.liferay.portal.kernel.exception.SystemException {
326                    return getService().getUserAchievements(userId, groupId, name);
327            }
328    
329            public static SocialActivityAchievementLocalService getService() {
330                    if (_service == null) {
331                            _service = (SocialActivityAchievementLocalService)PortalBeanLocatorUtil.locate(SocialActivityAchievementLocalService.class.getName());
332    
333                            ReferenceRegistry.registerReference(SocialActivityAchievementLocalServiceUtil.class,
334                                    "_service");
335                            MethodCache.remove(SocialActivityAchievementLocalService.class);
336                    }
337    
338                    return _service;
339            }
340    
341            public void setService(SocialActivityAchievementLocalService service) {
342                    MethodCache.remove(SocialActivityAchievementLocalService.class);
343    
344                    _service = service;
345    
346                    ReferenceRegistry.registerReference(SocialActivityAchievementLocalServiceUtil.class,
347                            "_service");
348                    MethodCache.remove(SocialActivityAchievementLocalService.class);
349            }
350    
351            private static SocialActivityAchievementLocalService _service;
352    }