Class DefaultHttpGetProcessor
java.lang.Object
org.apache.synapse.transport.nhttp.DefaultHttpGetProcessor
- All Implemented Interfaces:
HttpGetRequestProcessor
Default http Get processor implementation for Synapse.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.axis2.context.ConfigurationContextprotected ServerHandler -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidgenerateServiceDetailsPage(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName) Generates service details page.protected voidgenerateServicesList(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String servicePath) Generates the services list.protected voidgenerateWsdl(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName, Map<String, String> parameters, boolean isRestDispatching) Generate WSDL.protected voidgenerateWsdl2(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName, boolean isRestDispatching) Generate WSDL2.protected voidgenerateXsd(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext messageCtx, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName, Map<String, String> parameters, boolean isRestDispatching) Generates Schema.protected static StringWhatever this method returns as the IP is ignored by the actual http/s listener when its getServiceEPR is invoked.protected StringgetServiceName(org.apache.http.HttpRequest request) Returns the service name.protected StringgetServicesHTML(String prefix) Returns the HTML text for the list of services deployed.protected voidhandleBrowserException(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String msg, Exception e) Handles browser exception.protected voidhandleException(org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String msg, Exception e) Handles exception.voidinit(org.apache.axis2.context.ConfigurationContext cfgCtx, ServerHandler serverHandler) Initialize the HttpGetProcessorprotected static booleanprotected booleanisServiceListBlocked(String incomingURI) Is the incoming URI is requesting service list and http.block_service_list=true in nhttp.propertiesprotected booleanisWSDLProvidedForProxyService(org.apache.axis2.description.AxisService service) Checks whether a wsdl is provided for a proxy service.voidprocess(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, boolean isRestDispatching) Process the HTTP GET request.protected voidprocessGetAndDelete(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String method, boolean isRestDispatching) Calls the RESTUtil to process GET and DELETE Request
-
Field Details
-
cfgCtx
protected org.apache.axis2.context.ConfigurationContext cfgCtx -
serverHandler
-
-
Constructor Details
-
DefaultHttpGetProcessor
public DefaultHttpGetProcessor()
-
-
Method Details
-
init
public void init(org.apache.axis2.context.ConfigurationContext cfgCtx, ServerHandler serverHandler) throws org.apache.axis2.AxisFault Description copied from interface:HttpGetRequestProcessorInitialize the HttpGetProcessor- Specified by:
initin interfaceHttpGetRequestProcessor- Parameters:
cfgCtx- servers configuration contextserverHandler- dispatching handler- Throws:
org.apache.axis2.AxisFault- if an error occurs
-
process
public void process(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, boolean isRestDispatching) Process the HTTP GET request.- Specified by:
processin interfaceHttpGetRequestProcessor- Parameters:
request- The HttpRequestresponse- The HttpResponsemsgContext- The MessageContextconn- The NHttpServerConnectionos- The OutputStreamisRestDispatching- Rest dispatching
-
isServiceListBlocked
Is the incoming URI is requesting service list and http.block_service_list=true in nhttp.properties- Parameters:
incomingURI- incoming URI- Returns:
- whether to proceed with incomingURI
-
getServiceName
Returns the service name.- Parameters:
request- HttpRequest- Returns:
- service name as a String
-
generateServicesList
protected void generateServicesList(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String servicePath) Generates the services list.- Parameters:
response- HttpResponseconn- NHttpServerConnectionos- OutputStreamservicePath- service path of the service
-
generateServiceDetailsPage
protected void generateServiceDetailsPage(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName) Generates service details page.- Parameters:
response- HttpResponseconn- NHttpServerConnectionos- OutputStreamserviceName- service name
-
generateXsd
protected void generateXsd(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext messageCtx, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName, Map<String, String> parameters, boolean isRestDispatching) Generates Schema.- Parameters:
response- HttpResponseconn- NHttpServerConnectionos- OutputStreamserviceName- service nameparameters- url parameters
-
generateWsdl2
protected void generateWsdl2(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName, boolean isRestDispatching) Generate WSDL2.- Parameters:
request- HttpRequestresponse- HttpResponsemsgContext- MessageContextconn- NHttpServerConnectionos- OutputStreamserviceName- service nameisRestDispatching- weather nhttp should do rest dispatching
-
generateWsdl
protected void generateWsdl(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String serviceName, Map<String, String> parameters, boolean isRestDispatching) Generate WSDL.- Parameters:
request- HttpRequestresponse- HttpResponsemsgContext- MessageContextconn- NHttpServerConnectionos- OutputStreamserviceName- service nameparameters- parametersisRestDispatching- if restDispatching is on
-
processGetAndDelete
protected void processGetAndDelete(org.apache.http.HttpRequest request, org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String method, boolean isRestDispatching) Calls the RESTUtil to process GET and DELETE Request- Parameters:
request- HttpRequestresponse- HttpResponsemsgContext- MessageContextconn- NHttpServerConnectionos- OutputStreammethod- HTTP method, either GET or DELETEisRestDispatching- weather transport should do rest dispatching
-
handleException
protected void handleException(org.apache.http.HttpResponse response, org.apache.axis2.context.MessageContext msgContext, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String msg, Exception e) Handles exception.- Parameters:
response- HttpResponsemsgContext- MessageContextconn- NHttpServerConnectionos- OutputStreammsg- messagee- Exception
-
handleBrowserException
protected void handleBrowserException(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, OutputStream os, String msg, Exception e) Handles browser exception.- Parameters:
response- HttpResponseconn- NHttpServerConnectionos- OutputStreammsg- messagee- Exception
-
isWSDLProvidedForProxyService
protected boolean isWSDLProvidedForProxyService(org.apache.axis2.description.AxisService service) Checks whether a wsdl is provided for a proxy service.- Parameters:
service- AxisService- Returns:
- whether the wsdl is provided or not
-
getIpAddress
Whatever this method returns as the IP is ignored by the actual http/s listener when its getServiceEPR is invoked. This was originally copied from axis2- Returns:
- Returns String.
- Throws:
SocketException- if the socket can not be accessed
-
isIP
-
getServicesHTML
Returns the HTML text for the list of services deployed. This can be delegated to another Class as well where it will handle more options of GET messages.- Parameters:
prefix- to be used for the Service names- Returns:
- the HTML to be displayed as a String
-