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.announcements.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 announcements flag remote service. This utility wraps {@link com.liferay.portlet.announcements.service.impl.AnnouncementsFlagServiceImpl} and is the primary access point for service operations in application layer code running on a remote server.
023     *
024     * <p>
025     * This is a remote service. Methods of this service are expected to have security checks based on the propagated JAAS credentials because this service can be accessed remotely.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see AnnouncementsFlagService
030     * @see com.liferay.portlet.announcements.service.base.AnnouncementsFlagServiceBaseImpl
031     * @see com.liferay.portlet.announcements.service.impl.AnnouncementsFlagServiceImpl
032     * @generated
033     */
034    public class AnnouncementsFlagServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.announcements.service.impl.AnnouncementsFlagServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static void addFlag(long entryId, int value)
041                    throws com.liferay.portal.kernel.exception.PortalException,
042                            com.liferay.portal.kernel.exception.SystemException {
043                    getService().addFlag(entryId, value);
044            }
045    
046            public static void deleteFlag(long flagId)
047                    throws com.liferay.portal.kernel.exception.PortalException,
048                            com.liferay.portal.kernel.exception.SystemException {
049                    getService().deleteFlag(flagId);
050            }
051    
052            public static com.liferay.portlet.announcements.model.AnnouncementsFlag getFlag(
053                    long entryId, int value)
054                    throws com.liferay.portal.kernel.exception.PortalException,
055                            com.liferay.portal.kernel.exception.SystemException {
056                    return getService().getFlag(entryId, value);
057            }
058    
059            public static AnnouncementsFlagService getService() {
060                    if (_service == null) {
061                            _service = (AnnouncementsFlagService)PortalBeanLocatorUtil.locate(AnnouncementsFlagService.class.getName());
062    
063                            ReferenceRegistry.registerReference(AnnouncementsFlagServiceUtil.class,
064                                    "_service");
065                            MethodCache.remove(AnnouncementsFlagService.class);
066                    }
067    
068                    return _service;
069            }
070    
071            public void setService(AnnouncementsFlagService service) {
072                    MethodCache.remove(AnnouncementsFlagService.class);
073    
074                    _service = service;
075    
076                    ReferenceRegistry.registerReference(AnnouncementsFlagServiceUtil.class,
077                            "_service");
078                    MethodCache.remove(AnnouncementsFlagService.class);
079            }
080    
081            private static AnnouncementsFlagService _service;
082    }