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 request interpreter local service. This utility wraps {@link com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl} 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 SocialRequestInterpreterLocalService
030     * @see com.liferay.portlet.social.service.base.SocialRequestInterpreterLocalServiceBaseImpl
031     * @see com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl
032     * @generated
033     */
034    public class SocialRequestInterpreterLocalServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.social.service.impl.SocialRequestInterpreterLocalServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040    
041            /**
042            * Returns the Spring bean ID for this bean.
043            *
044            * @return the Spring bean ID for this bean
045            */
046            public static java.lang.String getBeanIdentifier() {
047                    return getService().getBeanIdentifier();
048            }
049    
050            /**
051            * Sets the Spring bean ID for this bean.
052            *
053            * @param beanIdentifier the Spring bean ID for this bean
054            */
055            public static void setBeanIdentifier(java.lang.String beanIdentifier) {
056                    getService().setBeanIdentifier(beanIdentifier);
057            }
058    
059            /**
060            * Adds the social request interpreter to the list of available
061            * interpreters.
062            *
063            * @param requestInterpreter the social request interpreter
064            */
065            public static void addRequestInterpreter(
066                    com.liferay.portlet.social.model.SocialRequestInterpreter requestInterpreter) {
067                    getService().addRequestInterpreter(requestInterpreter);
068            }
069    
070            /**
071            * Removes the social request interpreter from the list of available
072            * interpreters.
073            *
074            * @param requestInterpreter the social request interpreter
075            */
076            public static void deleteRequestInterpreter(
077                    com.liferay.portlet.social.model.SocialRequestInterpreter requestInterpreter) {
078                    getService().deleteRequestInterpreter(requestInterpreter);
079            }
080    
081            /**
082            * Creates a human readable request feed entry for the social request using
083            * an available compatible request interpreter.
084            *
085            * <p>
086            * This method finds the appropriate interpreter for the request by going
087            * through the available interpreters to find one that can handle the asset
088            * type of the request.
089            * </p>
090            *
091            * @param request the social request to be translated to human readable
092            form
093            * @param themeDisplay the theme display needed by interpreters to create
094            links and get localized text fragments
095            * @return the social request feed entry
096            */
097            public static com.liferay.portlet.social.model.SocialRequestFeedEntry interpret(
098                    com.liferay.portlet.social.model.SocialRequest request,
099                    com.liferay.portal.theme.ThemeDisplay themeDisplay) {
100                    return getService().interpret(request, themeDisplay);
101            }
102    
103            /**
104            * Processes the confirmation of the social request.
105            *
106            * <p>
107            * Confirmations are handled by finding the appropriate social request
108            * interpreter and calling its processConfirmation() method. To find the
109            * appropriate interpreter this method goes through the available
110            * interpreters to find one that can handle the asset type of the request.
111            * </p>
112            *
113            * @param request the social request being confirmed
114            * @param themeDisplay the theme display needed by interpreters to create
115            links and get localized text fragments
116            */
117            public static void processConfirmation(
118                    com.liferay.portlet.social.model.SocialRequest request,
119                    com.liferay.portal.theme.ThemeDisplay themeDisplay) {
120                    getService().processConfirmation(request, themeDisplay);
121            }
122    
123            /**
124            * Processes the rejection of the social request.
125            *
126            * <p>
127            * Rejections are handled by finding the appropriate social request
128            * interpreters and calling their processRejection() methods. To find the
129            * appropriate interpreters this method goes through the available
130            * interpreters and asks them if they can handle the asset type of the
131            * request.
132            * </p>
133            *
134            * @param request the social request being rejected
135            * @param themeDisplay the theme display needed by interpreters to create
136            links and get localized text fragments
137            */
138            public static void processRejection(
139                    com.liferay.portlet.social.model.SocialRequest request,
140                    com.liferay.portal.theme.ThemeDisplay themeDisplay) {
141                    getService().processRejection(request, themeDisplay);
142            }
143    
144            public static SocialRequestInterpreterLocalService getService() {
145                    if (_service == null) {
146                            _service = (SocialRequestInterpreterLocalService)PortalBeanLocatorUtil.locate(SocialRequestInterpreterLocalService.class.getName());
147    
148                            ReferenceRegistry.registerReference(SocialRequestInterpreterLocalServiceUtil.class,
149                                    "_service");
150                            MethodCache.remove(SocialRequestInterpreterLocalService.class);
151                    }
152    
153                    return _service;
154            }
155    
156            public void setService(SocialRequestInterpreterLocalService service) {
157                    MethodCache.remove(SocialRequestInterpreterLocalService.class);
158    
159                    _service = service;
160    
161                    ReferenceRegistry.registerReference(SocialRequestInterpreterLocalServiceUtil.class,
162                            "_service");
163                    MethodCache.remove(SocialRequestInterpreterLocalService.class);
164            }
165    
166            private static SocialRequestInterpreterLocalService _service;
167    }