001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 counter local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl} 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 SocialActivityCounterLocalService
030     * @see com.liferay.portlet.social.service.base.SocialActivityCounterLocalServiceBaseImpl
031     * @see com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl
032     * @generated
033     */
034    public class SocialActivityCounterLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialActivityCounterLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Adds the social activity counter to the database. Also notifies the appropriate model listeners.
043            *
044            * @param socialActivityCounter the social activity counter
045            * @return the social activity counter that was added
046            * @throws SystemException if a system exception occurred
047            */
048            public static com.liferay.portlet.social.model.SocialActivityCounter addSocialActivityCounter(
049                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter)
050                    throws com.liferay.portal.kernel.exception.SystemException {
051                    return getService().addSocialActivityCounter(socialActivityCounter);
052            }
053    
054            /**
055            * Creates a new social activity counter with the primary key. Does not add the social activity counter to the database.
056            *
057            * @param activityCounterId the primary key for the new social activity counter
058            * @return the new social activity counter
059            */
060            public static com.liferay.portlet.social.model.SocialActivityCounter createSocialActivityCounter(
061                    long activityCounterId) {
062                    return getService().createSocialActivityCounter(activityCounterId);
063            }
064    
065            /**
066            * Deletes the social activity counter with the primary key from the database. Also notifies the appropriate model listeners.
067            *
068            * @param activityCounterId the primary key of the social activity counter
069            * @throws PortalException if a social activity counter with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public static void deleteSocialActivityCounter(long activityCounterId)
073                    throws com.liferay.portal.kernel.exception.PortalException,
074                            com.liferay.portal.kernel.exception.SystemException {
075                    getService().deleteSocialActivityCounter(activityCounterId);
076            }
077    
078            /**
079            * Deletes the social activity counter from the database. Also notifies the appropriate model listeners.
080            *
081            * @param socialActivityCounter the social activity counter
082            * @throws SystemException if a system exception occurred
083            */
084            public static void deleteSocialActivityCounter(
085                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter)
086                    throws com.liferay.portal.kernel.exception.SystemException {
087                    getService().deleteSocialActivityCounter(socialActivityCounter);
088            }
089    
090            /**
091            * Performs a dynamic query on the database and returns the matching rows.
092            *
093            * @param dynamicQuery the dynamic query
094            * @return the matching rows
095            * @throws SystemException if a system exception occurred
096            */
097            @SuppressWarnings("rawtypes")
098            public static java.util.List dynamicQuery(
099                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
100                    throws com.liferay.portal.kernel.exception.SystemException {
101                    return getService().dynamicQuery(dynamicQuery);
102            }
103    
104            /**
105            * Performs a dynamic query on the database and returns a range of the matching rows.
106            *
107            * <p>
108            * 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.
109            * </p>
110            *
111            * @param dynamicQuery the dynamic query
112            * @param start the lower bound of the range of model instances
113            * @param end the upper bound of the range of model instances (not inclusive)
114            * @return the range of matching rows
115            * @throws SystemException if a system exception occurred
116            */
117            @SuppressWarnings("rawtypes")
118            public static java.util.List dynamicQuery(
119                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
120                    int end) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getService().dynamicQuery(dynamicQuery, start, end);
122            }
123    
124            /**
125            * Performs a dynamic query on the database and returns an ordered range of the matching rows.
126            *
127            * <p>
128            * 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.
129            * </p>
130            *
131            * @param dynamicQuery the dynamic query
132            * @param start the lower bound of the range of model instances
133            * @param end the upper bound of the range of model instances (not inclusive)
134            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
135            * @return the ordered range of matching rows
136            * @throws SystemException if a system exception occurred
137            */
138            @SuppressWarnings("rawtypes")
139            public static java.util.List dynamicQuery(
140                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
141                    int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException {
144                    return getService()
145                                       .dynamicQuery(dynamicQuery, start, end, orderByComparator);
146            }
147    
148            /**
149            * Returns the number of rows that match the dynamic query.
150            *
151            * @param dynamicQuery the dynamic query
152            * @return the number of rows that match the dynamic query
153            * @throws SystemException if a system exception occurred
154            */
155            public static long dynamicQueryCount(
156                    com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getService().dynamicQueryCount(dynamicQuery);
159            }
160    
161            public static com.liferay.portlet.social.model.SocialActivityCounter fetchSocialActivityCounter(
162                    long activityCounterId)
163                    throws com.liferay.portal.kernel.exception.SystemException {
164                    return getService().fetchSocialActivityCounter(activityCounterId);
165            }
166    
167            /**
168            * Returns the social activity counter with the primary key.
169            *
170            * @param activityCounterId the primary key of the social activity counter
171            * @return the social activity counter
172            * @throws PortalException if a social activity counter with the primary key could not be found
173            * @throws SystemException if a system exception occurred
174            */
175            public static com.liferay.portlet.social.model.SocialActivityCounter getSocialActivityCounter(
176                    long activityCounterId)
177                    throws com.liferay.portal.kernel.exception.PortalException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getService().getSocialActivityCounter(activityCounterId);
180            }
181    
182            public static com.liferay.portal.model.PersistedModel getPersistedModel(
183                    java.io.Serializable primaryKeyObj)
184                    throws com.liferay.portal.kernel.exception.PortalException,
185                            com.liferay.portal.kernel.exception.SystemException {
186                    return getService().getPersistedModel(primaryKeyObj);
187            }
188    
189            /**
190            * Returns a range of all the social activity counters.
191            *
192            * <p>
193            * 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.
194            * </p>
195            *
196            * @param start the lower bound of the range of social activity counters
197            * @param end the upper bound of the range of social activity counters (not inclusive)
198            * @return the range of social activity counters
199            * @throws SystemException if a system exception occurred
200            */
201            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getSocialActivityCounters(
202                    int start, int end)
203                    throws com.liferay.portal.kernel.exception.SystemException {
204                    return getService().getSocialActivityCounters(start, end);
205            }
206    
207            /**
208            * Returns the number of social activity counters.
209            *
210            * @return the number of social activity counters
211            * @throws SystemException if a system exception occurred
212            */
213            public static int getSocialActivityCountersCount()
214                    throws com.liferay.portal.kernel.exception.SystemException {
215                    return getService().getSocialActivityCountersCount();
216            }
217    
218            /**
219            * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
220            *
221            * @param socialActivityCounter the social activity counter
222            * @return the social activity counter that was updated
223            * @throws SystemException if a system exception occurred
224            */
225            public static com.liferay.portlet.social.model.SocialActivityCounter updateSocialActivityCounter(
226                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getService().updateSocialActivityCounter(socialActivityCounter);
229            }
230    
231            /**
232            * Updates the social activity counter in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
233            *
234            * @param socialActivityCounter the social activity counter
235            * @param merge whether to merge the social activity counter 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.
236            * @return the social activity counter that was updated
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portlet.social.model.SocialActivityCounter updateSocialActivityCounter(
240                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter,
241                    boolean merge)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getService()
244                                       .updateSocialActivityCounter(socialActivityCounter, merge);
245            }
246    
247            /**
248            * Returns the Spring bean ID for this bean.
249            *
250            * @return the Spring bean ID for this bean
251            */
252            public static java.lang.String getBeanIdentifier() {
253                    return getService().getBeanIdentifier();
254            }
255    
256            /**
257            * Sets the Spring bean ID for this bean.
258            *
259            * @param beanIdentifier the Spring bean ID for this bean
260            */
261            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
262                    getService().setBeanIdentifier(beanIdentifier);
263            }
264    
265            public static com.liferay.portlet.social.model.SocialActivityCounter addActivityCounter(
266                    long groupId, long classNameId, long classPK, java.lang.String name,
267                    int ownerType, int currentValue, int totalValue)
268                    throws com.liferay.portal.kernel.exception.PortalException,
269                            com.liferay.portal.kernel.exception.SystemException {
270                    return getService()
271                                       .addActivityCounter(groupId, classNameId, classPK, name,
272                            ownerType, currentValue, totalValue);
273            }
274    
275            public static void addActivityCounters(
276                    com.liferay.portlet.social.model.SocialActivity activity)
277                    throws com.liferay.portal.kernel.exception.PortalException,
278                            com.liferay.portal.kernel.exception.SystemException {
279                    getService().addActivityCounters(activity);
280            }
281    
282            public static void deleteActivityCounters(
283                    com.liferay.portlet.asset.model.AssetEntry assetEntry)
284                    throws com.liferay.portal.kernel.exception.PortalException,
285                            com.liferay.portal.kernel.exception.SystemException {
286                    getService().deleteActivityCounters(assetEntry);
287            }
288    
289            public static void deleteActivityCounters(long classNameId, long classPK)
290                    throws com.liferay.portal.kernel.exception.SystemException {
291                    getService().deleteActivityCounters(classNameId, classPK);
292            }
293    
294            public static com.liferay.portlet.social.model.SocialActivityCounter fetchLatestActivityCounter(
295                    long groupId, long classNameId, long classPK, java.lang.String name,
296                    int ownerType)
297                    throws com.liferay.portal.kernel.exception.SystemException {
298                    return getService()
299                                       .fetchLatestActivityCounter(groupId, classNameId, classPK,
300                            name, ownerType);
301            }
302    
303            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getActivityCounterDistribution(
304                    long groupId, java.lang.String name, int offset,
305                    boolean includeCurrentPeriod)
306                    throws com.liferay.portal.kernel.exception.SystemException {
307                    return getService()
308                                       .getActivityCounterDistribution(groupId, name, offset,
309                            includeCurrentPeriod);
310            }
311    
312            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getActivityCounterDistribution(
313                    long groupId, java.lang.String name, int startPeriod, int endPeriod)
314                    throws com.liferay.portal.kernel.exception.SystemException {
315                    return getService()
316                                       .getActivityCounterDistribution(groupId, name, startPeriod,
317                            endPeriod);
318            }
319    
320            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getActivityCounters(
321                    long groupId, java.lang.String name, int offset,
322                    boolean includeCurrentPeriod)
323                    throws com.liferay.portal.kernel.exception.SystemException {
324                    return getService()
325                                       .getActivityCounters(groupId, name, offset,
326                            includeCurrentPeriod);
327            }
328    
329            public static java.util.List<com.liferay.portlet.social.model.SocialActivityCounter> getActivityCounters(
330                    long groupId, java.lang.String name, int startPeriod, int endPeriod)
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return getService()
333                                       .getActivityCounters(groupId, name, startPeriod, endPeriod);
334            }
335    
336            public static com.liferay.portlet.social.model.SocialActivityCounter getLatestActivityCounter(
337                    long groupId, long classNameId, long classPK, java.lang.String name,
338                    int ownerType)
339                    throws com.liferay.portal.kernel.exception.SystemException,
340                            com.liferay.portlet.social.NoSuchActivityCounterException {
341                    return getService()
342                                       .getLatestActivityCounter(groupId, classNameId, classPK,
343                            name, ownerType);
344            }
345    
346            public static int getUserActivityCounters(long groupId,
347                    java.lang.String[] rankingNames)
348                    throws com.liferay.portal.kernel.exception.SystemException {
349                    return getService().getUserActivityCounters(groupId, rankingNames);
350            }
351    
352            public static java.util.List<com.liferay.portal.kernel.util.Tuple> getUserActivityCounters(
353                    long groupId, java.lang.String[] rankingNames,
354                    java.lang.String[] selectedNames, int start, int end)
355                    throws com.liferay.portal.kernel.exception.SystemException {
356                    return getService()
357                                       .getUserActivityCounters(groupId, rankingNames,
358                            selectedNames, start, end);
359            }
360    
361            public static void incrementUserAchievementCounter(long userId, long groupId)
362                    throws com.liferay.portal.kernel.exception.PortalException,
363                            com.liferay.portal.kernel.exception.SystemException {
364                    getService().incrementUserAchievementCounter(userId, groupId);
365            }
366    
367            public static SocialActivityCounterLocalService getService() {
368                    if (_service == null) {
369                            _service = (SocialActivityCounterLocalService)PortalBeanLocatorUtil.locate(SocialActivityCounterLocalService.class.getName());
370    
371                            ReferenceRegistry.registerReference(SocialActivityCounterLocalServiceUtil.class,
372                                    "_service");
373                            MethodCache.remove(SocialActivityCounterLocalService.class);
374                    }
375    
376                    return _service;
377            }
378    
379            public void setService(SocialActivityCounterLocalService service) {
380                    MethodCache.remove(SocialActivityCounterLocalService.class);
381    
382                    _service = service;
383    
384                    ReferenceRegistry.registerReference(SocialActivityCounterLocalServiceUtil.class,
385                            "_service");
386                    MethodCache.remove(SocialActivityCounterLocalService.class);
387            }
388    
389            private static SocialActivityCounterLocalService _service;
390    }