Class DefaultRoutingHelper
- java.lang.Object
- 
- com.ibm.wsspi.rest.handler.helper.DefaultRoutingHelper
 
- 
 public class DefaultRoutingHelper extends java.lang.ObjectThis helper service routes/bridges an incoming request to and from a RESTHandler that resides in another Collective member.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceDefaultRoutingHelper.LegacyJMXEncapsulates legacy constants for JMX connector clients v1, v2 and v3.static classDefaultRoutingHelper.RoutingContextThis inner class encapsulates the routing context.
 - 
Constructor SummaryConstructors Constructor Description DefaultRoutingHelper()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancontainsLegacyRoutingContext(RESTRequest request)Quick check for legacy routing context (used from JMX connector)static booleancontainsRoutingContext(RESTRequest request)Quick check for multiple routing context, without actually fetching all piecesstatic DefaultRoutingHelper.RoutingContextgetLegacyRoutingContext(RESTRequest request)This helper method looks for the routing keys in the HTTP headersstatic java.lang.StringgetQueryParameterValue(RESTRequest request, java.lang.String name)static java.lang.String[]getQueryParameterValues(RESTRequest request, java.lang.String name)static java.util.List<DefaultRoutingHelper.RoutingContext>getRoutingContext(RESTRequest request)This helper method looks for the routing keys in the HTTP headers first, and then falls-back into looking at the query string.voidrouteRequest(RESTRequest request, RESTResponse response)The target RESTHandler did not want to provide custom routing, so route the request to it.voidrouteRequest(RESTRequest request, RESTResponse response, boolean legacyURI)The target RESTHandler did not want to provide custom routing, so route the request to it.static java.lang.StringURLDecoder(java.lang.String name)
 
- 
- 
- 
Method Detail- 
routeRequestpublic void routeRequest(RESTRequest request, RESTResponse response) throws java.io.IOException The target RESTHandler did not want to provide custom routing, so route the request to it.- Throws:
- java.io.IOException
 
 - 
routeRequestpublic void routeRequest(RESTRequest request, RESTResponse response, boolean legacyURI) throws java.io.IOException The target RESTHandler did not want to provide custom routing, so route the request to it.- Parameters:
- request-
- response-
- legacyURI- whether or not the request is using the legacy /router URI
- Throws:
- java.io.IOException
 
 - 
containsLegacyRoutingContextpublic static boolean containsLegacyRoutingContext(RESTRequest request) Quick check for legacy routing context (used from JMX connector)
 - 
containsRoutingContextpublic static boolean containsRoutingContext(RESTRequest request) Quick check for multiple routing context, without actually fetching all pieces
 - 
getQueryParameterValuepublic static java.lang.String getQueryParameterValue(RESTRequest request, java.lang.String name) 
 - 
getQueryParameterValuespublic static java.lang.String[] getQueryParameterValues(RESTRequest request, java.lang.String name) 
 - 
getLegacyRoutingContextpublic static DefaultRoutingHelper.RoutingContext getLegacyRoutingContext(RESTRequest request) This helper method looks for the routing keys in the HTTP headers- Parameters:
- httpServletRequest- of the current request
- Returns:
- a 3-sized String array containing hostName, userDir and serverName respectively, or null if no routing context was found.
 
 - 
URLDecoderpublic static java.lang.String URLDecoder(java.lang.String name) 
 - 
getRoutingContextpublic static java.util.List<DefaultRoutingHelper.RoutingContext> getRoutingContext(RESTRequest request) This helper method looks for the routing keys in the HTTP headers first, and then falls-back into looking at the query string.- Parameters:
- httpServletRequest- of the current request
- Returns:
- a list of routing contexts, or null if none found.
 
 
- 
 
-