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.portlet.social.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.util.ReferenceRegistry;
019    
020    /**
021     * @author Brian Wing Shun Chan
022     */
023    public class SocialActivitySetFinderUtil {
024            public static int countByRelation(long userId)
025                    throws com.liferay.portal.kernel.exception.SystemException {
026                    return getFinder().countByRelation(userId);
027            }
028    
029            public static int countByRelationType(long userId, int type)
030                    throws com.liferay.portal.kernel.exception.SystemException {
031                    return getFinder().countByRelationType(userId, type);
032            }
033    
034            public static int countByUser(long userId)
035                    throws com.liferay.portal.kernel.exception.SystemException {
036                    return getFinder().countByUser(userId);
037            }
038    
039            public static int countByUserGroups(long userId)
040                    throws com.liferay.portal.kernel.exception.SystemException {
041                    return getFinder().countByUserGroups(userId);
042            }
043    
044            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findByRelation(
045                    long userId, int start, int end)
046                    throws com.liferay.portal.kernel.exception.SystemException {
047                    return getFinder().findByRelation(userId, start, end);
048            }
049    
050            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findByRelationType(
051                    long userId, int type, int start, int end)
052                    throws com.liferay.portal.kernel.exception.SystemException {
053                    return getFinder().findByRelationType(userId, type, start, end);
054            }
055    
056            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findByUser(
057                    long userId, int start, int end)
058                    throws com.liferay.portal.kernel.exception.SystemException {
059                    return getFinder().findByUser(userId, start, end);
060            }
061    
062            public static java.util.List<com.liferay.portlet.social.model.SocialActivitySet> findByUserGroups(
063                    long userId, int start, int end)
064                    throws com.liferay.portal.kernel.exception.SystemException {
065                    return getFinder().findByUserGroups(userId, start, end);
066            }
067    
068            public static SocialActivitySetFinder getFinder() {
069                    if (_finder == null) {
070                            _finder = (SocialActivitySetFinder)PortalBeanLocatorUtil.locate(SocialActivitySetFinder.class.getName());
071    
072                            ReferenceRegistry.registerReference(SocialActivitySetFinderUtil.class,
073                                    "_finder");
074                    }
075    
076                    return _finder;
077            }
078    
079            public void setFinder(SocialActivitySetFinder finder) {
080                    _finder = finder;
081    
082                    ReferenceRegistry.registerReference(SocialActivitySetFinderUtil.class,
083                            "_finder");
084            }
085    
086            private static SocialActivitySetFinder _finder;
087    }