org.apache.chemistry.opencmis.server.shared
Class Dispatcher

java.lang.Object
  extended by org.apache.chemistry.opencmis.server.shared.Dispatcher
All Implemented Interfaces:
Serializable

public class Dispatcher
extends Object
implements Serializable

Dispatcher for the AtomPub and Browser binding servlet.

See Also:
Serialized Form

Field Summary
static String METHOD_DELETE
           
static String METHOD_GET
           
static String METHOD_POST
           
static String METHOD_PUT
           
 
Constructor Summary
Dispatcher()
           
 
Method Summary
 void addResource(String resource, String httpMethod, Class<?> clazz, String classmethod)
          Connects a resource and HTTP method with a class and a class method.
 boolean dispatch(String resource, String httpMethod, CallContext context, CmisService service, String repositoryId, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Find the appropriate method an call it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_GET

public static final String METHOD_GET
See Also:
Constant Field Values

METHOD_POST

public static final String METHOD_POST
See Also:
Constant Field Values

METHOD_PUT

public static final String METHOD_PUT
See Also:
Constant Field Values

METHOD_DELETE

public static final String METHOD_DELETE
See Also:
Constant Field Values
Constructor Detail

Dispatcher

public Dispatcher()
Method Detail

addResource

public void addResource(String resource,
                        String httpMethod,
                        Class<?> clazz,
                        String classmethod)
                 throws NoSuchMethodException
Connects a resource and HTTP method with a class and a class method.

Throws:
NoSuchMethodException

dispatch

public boolean dispatch(String resource,
                        String httpMethod,
                        CallContext context,
                        CmisService service,
                        String repositoryId,
                        javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response)
Find the appropriate method an call it.

Returns:
true if the method was found, false otherwise.


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.