com.github.kristofa.test.http
Class PassthroughForwardHttpRequestBuilder

java.lang.Object
  extended by com.github.kristofa.test.http.PassthroughForwardHttpRequestBuilder
All Implemented Interfaces:
ForwardHttpRequestBuilder

public class PassthroughForwardHttpRequestBuilder
extends Object
implements ForwardHttpRequestBuilder

An implementation of ForwardHttpRequestBuilder that constructs FullHttpRequests that redirects the request to the external service by changing the domain and port of the request.

Author:
dominiek

Constructor Summary
PassthroughForwardHttpRequestBuilder(String targetDomain, int targetPort)
          Construct a new instance, incoming requests will be passed through to targetDomain:targetPort of the external service.
 
Method Summary
 FullHttpRequest getForwardRequest(FullHttpRequest request)
          Builds a forward request for given input request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassthroughForwardHttpRequestBuilder

public PassthroughForwardHttpRequestBuilder(String targetDomain,
                                            int targetPort)
Construct a new instance, incoming requests will be passed through to targetDomain:targetPort of the external service.

Parameters:
targetDomain - the domain of the external service.
targetPort - the port of the external service (between 1 and 65535).
Method Detail

getForwardRequest

public FullHttpRequest getForwardRequest(FullHttpRequest request)
Description copied from interface: ForwardHttpRequestBuilder
Builds a forward request for given input request.

Specified by:
getForwardRequest in interface ForwardHttpRequestBuilder
Parameters:
request - Http request.
Returns:
New forward request or null in case we don't know how to build forward request for given input request.


Copyright © 2014. All Rights Reserved.