001    /**
002     * Copyright (c) 2000-present 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    import java.util.Map;
021    import java.util.Set;
022    
023    import javax.servlet.ServletContext;
024    import javax.servlet.http.HttpServletRequest;
025    
026    /**
027     * @author Igor Spasic
028     */
029    public interface JSONWebServiceActionsManager {
030    
031            public Set<String> getContextNames();
032    
033            public JSONWebServiceAction getJSONWebServiceAction(
034                            HttpServletRequest request)
035                    throws NoSuchJSONWebServiceException;
036    
037            public JSONWebServiceAction getJSONWebServiceAction(
038                            HttpServletRequest request, String path, String method,
039                            Map<String, Object> parameters)
040                    throws NoSuchJSONWebServiceException;
041    
042            public JSONWebServiceActionMapping getJSONWebServiceActionMapping(
043                    String signature);
044    
045            public List<JSONWebServiceActionMapping> getJSONWebServiceActionMappings(
046                    String contextName);
047    
048            public int getJSONWebServiceActionsCount(String contextName);
049    
050            public JSONWebServiceNaming getJSONWebServiceNaming();
051    
052            public void registerJSONWebServiceAction(
053                    String contextName, String contextPath, Class<?> actionClass,
054                    Method actionMethod, String path, String method);
055    
056            public void registerJSONWebServiceAction(
057                    String contextName, String contextPath, Object actionObject,
058                    Class<?> actionClass, Method actionMethod, String path, String method);
059    
060            public int registerService(String contextPath, Object service);
061    
062            public int registerService(
063                    String contextName, String contextPath, Object service);
064    
065            public int registerService(
066                    String contextName, String contextPath, Object service,
067                    JSONWebServiceRegistrator jsonWebServiceRegistrator);
068    
069            public int registerServletContext(ServletContext servletContext);
070    
071            public int unregisterJSONWebServiceActions(Object actionObject);
072    
073            public int unregisterJSONWebServiceActions(String contextPath);
074    
075            public int unregisterServletContext(ServletContext servletContext);
076    
077    }