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.polls.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 polls question remote service. This utility wraps {@link com.liferay.portlet.polls.service.impl.PollsQuestionServiceImpl} 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 PollsQuestionService
030     * @see com.liferay.portlet.polls.service.base.PollsQuestionServiceBaseImpl
031     * @see com.liferay.portlet.polls.service.impl.PollsQuestionServiceImpl
032     * @generated
033     */
034    public class PollsQuestionServiceUtil {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * Never modify this class directly. Add custom service methods to {@link com.liferay.portlet.polls.service.impl.PollsQuestionServiceImpl} and rerun ServiceBuilder to regenerate this class.
039             */
040            public static com.liferay.portlet.polls.model.PollsQuestion addQuestion(
041                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
042                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
043                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
044                    int expirationDateHour, int expirationDateMinute, boolean neverExpire,
045                    java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
046                    com.liferay.portal.service.ServiceContext serviceContext)
047                    throws com.liferay.portal.kernel.exception.PortalException,
048                            com.liferay.portal.kernel.exception.SystemException {
049                    return getService()
050                                       .addQuestion(titleMap, descriptionMap, expirationDateMonth,
051                            expirationDateDay, expirationDateYear, expirationDateHour,
052                            expirationDateMinute, neverExpire, choices, serviceContext);
053            }
054    
055            public static void deleteQuestion(long questionId)
056                    throws com.liferay.portal.kernel.exception.PortalException,
057                            com.liferay.portal.kernel.exception.SystemException {
058                    getService().deleteQuestion(questionId);
059            }
060    
061            public static com.liferay.portlet.polls.model.PollsQuestion getQuestion(
062                    long questionId)
063                    throws com.liferay.portal.kernel.exception.PortalException,
064                            com.liferay.portal.kernel.exception.SystemException {
065                    return getService().getQuestion(questionId);
066            }
067    
068            public static com.liferay.portlet.polls.model.PollsQuestion updateQuestion(
069                    long questionId,
070                    java.util.Map<java.util.Locale, java.lang.String> titleMap,
071                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
072                    int expirationDateMonth, int expirationDateDay, int expirationDateYear,
073                    int expirationDateHour, int expirationDateMinute, boolean neverExpire,
074                    java.util.List<com.liferay.portlet.polls.model.PollsChoice> choices,
075                    com.liferay.portal.service.ServiceContext serviceContext)
076                    throws com.liferay.portal.kernel.exception.PortalException,
077                            com.liferay.portal.kernel.exception.SystemException {
078                    return getService()
079                                       .updateQuestion(questionId, titleMap, descriptionMap,
080                            expirationDateMonth, expirationDateDay, expirationDateYear,
081                            expirationDateHour, expirationDateMinute, neverExpire, choices,
082                            serviceContext);
083            }
084    
085            public static PollsQuestionService getService() {
086                    if (_service == null) {
087                            _service = (PollsQuestionService)PortalBeanLocatorUtil.locate(PollsQuestionService.class.getName());
088    
089                            ReferenceRegistry.registerReference(PollsQuestionServiceUtil.class,
090                                    "_service");
091                            MethodCache.remove(PollsQuestionService.class);
092                    }
093    
094                    return _service;
095            }
096    
097            public void setService(PollsQuestionService service) {
098                    MethodCache.remove(PollsQuestionService.class);
099    
100                    _service = service;
101    
102                    ReferenceRegistry.registerReference(PollsQuestionServiceUtil.class,
103                            "_service");
104                    MethodCache.remove(PollsQuestionService.class);
105            }
106    
107            private static PollsQuestionService _service;
108    }