com.linkedin.d2.contrib
Interface RoutingAwareClient

All Known Implementing Classes:
RouteLookupClient

public interface RoutingAwareClient

RoutingAwareClient will currently only support RestRequests with an additional key.


Method Summary
 void restRequest(com.linkedin.r2.message.rest.RestRequest request, com.linkedin.common.callback.Callback<com.linkedin.r2.message.rest.RestResponse> callback, java.lang.String routeKey)
          This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request.
 void restRequest(com.linkedin.r2.message.rest.RestRequest request, com.linkedin.r2.message.RequestContext requestContext, com.linkedin.common.callback.Callback<com.linkedin.r2.message.rest.RestResponse> callback, java.lang.String routeKey)
          This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request.
 java.util.concurrent.Future<com.linkedin.r2.message.rest.RestResponse> restRequest(com.linkedin.r2.message.rest.RestRequest request, com.linkedin.r2.message.RequestContext requestContext, java.lang.String routeKey)
          This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request.
 java.util.concurrent.Future<com.linkedin.r2.message.rest.RestResponse> restRequest(com.linkedin.r2.message.rest.RestRequest request, java.lang.String routeKey)
          This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request.
 

Method Detail

restRequest

void restRequest(com.linkedin.r2.message.rest.RestRequest request,
                 com.linkedin.common.callback.Callback<com.linkedin.r2.message.rest.RestResponse> callback,
                 java.lang.String routeKey)
This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request. An example routeKey might be a memberID. It is up to the implementation to convert the routeKey into the correct d2 service name.

Parameters:
request - original rest request
callback - used to return the new service name.
routeKey - key used to determine a new service name.

restRequest

void restRequest(com.linkedin.r2.message.rest.RestRequest request,
                 com.linkedin.r2.message.RequestContext requestContext,
                 com.linkedin.common.callback.Callback<com.linkedin.r2.message.rest.RestResponse> callback,
                 java.lang.String routeKey)
This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request. An example routeKey might be a memberID. It is up to the implementation to convert the routeKey into the correct d2 service name.

Parameters:
request - original rest request
requestContext - request context
callback - used to return the new service name.
routeKey - key used to determine a new service name.

restRequest

java.util.concurrent.Future<com.linkedin.r2.message.rest.RestResponse> restRequest(com.linkedin.r2.message.rest.RestRequest request,
                                                                                   java.lang.String routeKey)
This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request. An example routeKey might be a memberID. It is up to the implementation to convert the routeKey into the correct d2 service name. The returned Future can be used to retrieve the RestResponse.

Parameters:
request - original rest request
routeKey - key used to determine a new service name.
Returns:
a future to wait for the response

restRequest

java.util.concurrent.Future<com.linkedin.r2.message.rest.RestResponse> restRequest(com.linkedin.r2.message.rest.RestRequest request,
                                                                                   com.linkedin.r2.message.RequestContext requestContext,
                                                                                   java.lang.String routeKey)
This function can be used to send a restRequest with an additional routeKey to determine the appropriate d2 service to use for routing the request. An example routeKey might be a memberID. It is up to the implementation to convert the routeKey into the correct d2 service name. The returned Future can be used to retrieve the RestResponse.

Parameters:
request - original rest request
requestContext - request context
routeKey - key used to determine a new service name.
Returns:
a future to wait for the response