protected void parseRoutingCodeHeader ( ) { String rtCode = this . request . getHeader ( RestMessageHeaders . X_VOLD_ROUTING_TYPE_CODE ) ; if ( rtCode != null ) { try { int routingTypeCode = Integer . parseInt ( rtCode ) ; this . parsedRoutingType = RequestRoutingType . getRequestRoutingType ( routingTypeCode ) ; } catch ( NumberFormatException nfe ) { logger . error ( "Exception when validating request. Incorrect routing type parameter. Cannot parse this to long: " + rtCode , nfe ) ; RestErrorHandler . writeErrorResponse ( this . messageEvent , HttpResponseStatus . BAD_REQUEST , "Incorrect routing type parameter. Cannot parse this to long: " + rtCode ) ; } catch ( VoldemortException ve ) { logger . error ( "Exception when validating request. Incorrect routing type code: " + rtCode , ve ) ; RestErrorHandler . writeErrorResponse ( this . messageEvent , HttpResponseStatus . BAD_REQUEST , "Incorrect routing type code: " + rtCode ) ; } } }
Retrieve the routing type value from the REST request . X_VOLD_ROUTING_TYPE_CODE is the routing type header .