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.portlet.social.service.persistence;
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     * @author Brian Wing Shun Chan
024     */
025    @ProviderType
026    public class SocialActivityFinderUtil {
027            public static int countByGroupId(long groupId) {
028                    return getFinder().countByGroupId(groupId);
029            }
030    
031            public static int countByGroupUsers(long groupId) {
032                    return getFinder().countByGroupUsers(groupId);
033            }
034    
035            public static int countByOrganizationId(long organizationId) {
036                    return getFinder().countByOrganizationId(organizationId);
037            }
038    
039            public static int countByOrganizationUsers(long organizationId) {
040                    return getFinder().countByOrganizationUsers(organizationId);
041            }
042    
043            public static int countByRelation(long userId) {
044                    return getFinder().countByRelation(userId);
045            }
046    
047            public static int countByRelationType(long userId, int type) {
048                    return getFinder().countByRelationType(userId, type);
049            }
050    
051            public static int countByUserGroups(long userId) {
052                    return getFinder().countByUserGroups(userId);
053            }
054    
055            public static int countByUserGroupsAndOrganizations(long userId) {
056                    return getFinder().countByUserGroupsAndOrganizations(userId);
057            }
058    
059            public static int countByUserOrganizations(long userId) {
060                    return getFinder().countByUserOrganizations(userId);
061            }
062    
063            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
064                    long groupId, int start, int end) {
065                    return getFinder().findByGroupId(groupId, start, end);
066            }
067    
068            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupUsers(
069                    long groupId, int start, int end) {
070                    return getFinder().findByGroupUsers(groupId, start, end);
071            }
072    
073            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByOrganizationId(
074                    long organizationId, int start, int end) {
075                    return getFinder().findByOrganizationId(organizationId, start, end);
076            }
077    
078            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByOrganizationUsers(
079                    long organizationId, int start, int end) {
080                    return getFinder().findByOrganizationUsers(organizationId, start, end);
081            }
082    
083            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByRelation(
084                    long userId, int start, int end) {
085                    return getFinder().findByRelation(userId, start, end);
086            }
087    
088            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByRelationType(
089                    long userId, int type, int start, int end) {
090                    return getFinder().findByRelationType(userId, type, start, end);
091            }
092    
093            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserGroups(
094                    long userId, int start, int end) {
095                    return getFinder().findByUserGroups(userId, start, end);
096            }
097    
098            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserGroupsAndOrganizations(
099                    long userId, int start, int end) {
100                    return getFinder().findByUserGroupsAndOrganizations(userId, start, end);
101            }
102    
103            public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserOrganizations(
104                    long userId, int start, int end) {
105                    return getFinder().findByUserOrganizations(userId, start, end);
106            }
107    
108            public static SocialActivityFinder getFinder() {
109                    if (_finder == null) {
110                            _finder = (SocialActivityFinder)PortalBeanLocatorUtil.locate(SocialActivityFinder.class.getName());
111    
112                            ReferenceRegistry.registerReference(SocialActivityFinderUtil.class,
113                                    "_finder");
114                    }
115    
116                    return _finder;
117            }
118    
119            public void setFinder(SocialActivityFinder finder) {
120                    _finder = finder;
121    
122                    ReferenceRegistry.registerReference(SocialActivityFinderUtil.class,
123                            "_finder");
124            }
125    
126            private static SocialActivityFinder _finder;
127    }