com.continuuity.http
Class HttpResourceModel
java.lang.Object
com.continuuity.http.HttpResourceModel
public final class HttpResourceModel
- extends Object
HttpResourceModel contains information needed to handle Http call for a given path. Used as a destination in
PatternPathRouterWithGroups to route URI paths to right Http end points.
|
Constructor Summary |
HttpResourceModel(Set<org.jboss.netty.handler.codec.http.HttpMethod> httpMethods,
String path,
Method method,
HttpHandler handler)
Construct a resource model with HttpMethod, method that handles httprequest, Object that contains the method. |
HttpResourceModel
public HttpResourceModel(Set<org.jboss.netty.handler.codec.http.HttpMethod> httpMethods,
String path,
Method method,
HttpHandler handler)
- Construct a resource model with HttpMethod, method that handles httprequest, Object that contains the method.
- Parameters:
httpMethods - Set of http methods that is handled by the resource.path - path associated with this model.method - handler that handles the http request.handler - instance HttpHandler.
getHttpMethod
public Set<org.jboss.netty.handler.codec.http.HttpMethod> getHttpMethod()
- Returns:
- httpMethods.
getPath
public String getPath()
- Returns:
- path associated with this model.
getMethod
public Method getMethod()
- Returns:
- handler method that handles an http end-point.
getHttpHandler
public HttpHandler getHttpHandler()
- Returns:
- instance of
HttpHandler.
handle
public com.continuuity.http.HttpMethodInfo handle(org.jboss.netty.handler.codec.http.HttpRequest request,
HttpResponder responder,
Map<String,String> groupValues)
throws Exception
- Handle http Request.
- Parameters:
request - HttpRequest to be handled.responder - HttpResponder to write the response.groupValues - Values needed for the invocation.
- Throws:
Exception
toString
public String toString()
- Overrides:
toString in class Object
Copyright 2013 Continuuity, Inc. Licensed under the Apache License, Version 2.0