001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.poller;
016    
017    import com.liferay.portal.kernel.json.JSONObject;
018    import com.liferay.portal.kernel.poller.PollerHeader;
019    
020    /**
021     * @author Edward Han
022     */
023    public class PollerRequestHandlerUtil {
024    
025            public static PollerHeader getPollerHeader(String pollerRequestString) {
026                    return getPollerRequestHandler().getPollerHeader(pollerRequestString);
027            }
028    
029            public static PollerRequestHandler getPollerRequestHandler() {
030                    return _pollerRequestHandler;
031            }
032    
033            public static JSONObject processRequest(
034                            String path, String pollerRequestString)
035                    throws Exception {
036    
037                    return getPollerRequestHandler().processRequest(
038                            path, pollerRequestString);
039            }
040    
041            public void setPollerRequestHandler(
042                    PollerRequestHandler pollerRequestHandler) {
043    
044                    _pollerRequestHandler = pollerRequestHandler;
045            }
046    
047            private static PollerRequestHandler _pollerRequestHandler;
048    
049    }