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.portal.kernel.jsonwebservice;
016    
017    import java.lang.reflect.Method;
018    
019    import java.util.List;
020    
021    import javax.servlet.http.HttpServletRequest;
022    
023    /**
024     * @author Igor Spasic
025     */
026    public class JSONWebServiceActionsManagerUtil {
027    
028            public static JSONWebServiceAction getJSONWebServiceAction(
029                    HttpServletRequest request) {
030    
031                    return getJSONWebServiceActionsManager().getJSONWebServiceAction(
032                            request);
033            }
034    
035            public static JSONWebServiceActionMapping getJSONWebServiceActionMapping(
036                    String signature) {
037    
038                    return getJSONWebServiceActionsManager().
039                            getJSONWebServiceActionMapping(signature);
040            }
041    
042            public static List<JSONWebServiceActionMapping>
043                    getJSONWebServiceActionMappings(String servletContextPath) {
044    
045                    return _jsonWebServiceActionsManager.getJSONWebServiceActionMappings(
046                            servletContextPath);
047            }
048    
049            public static JSONWebServiceActionsManager
050                    getJSONWebServiceActionsManager() {
051    
052                    return _jsonWebServiceActionsManager;
053            }
054    
055            public static void registerJSONWebServiceAction(
056                    String servletContextPath, Class<?> actionClass, Method actionMethod,
057                    String path, String method) {
058    
059                    getJSONWebServiceActionsManager().registerJSONWebServiceAction(
060                            servletContextPath, actionClass, actionMethod, path, method);
061            }
062    
063            public static int unregisterJSONWebServiceActions(
064                    String servletContextPath) {
065    
066                    return getJSONWebServiceActionsManager().
067                            unregisterJSONWebServiceActions(servletContextPath);
068            }
069    
070            public void setJSONWebServiceActionsManager(
071                    JSONWebServiceActionsManager jsonWebServiceActionsManager) {
072    
073                    _jsonWebServiceActionsManager = jsonWebServiceActionsManager;
074            }
075    
076            private static JSONWebServiceActionsManager _jsonWebServiceActionsManager;
077    
078    }