public final class UriModifyingOperationPreprocessor extends Object implements OperationPreprocessor
OperationPreprocessor
that modifies URIs in the request and in the response
by changing one or more of their host, scheme, and port. URIs in the following
locations are modified:
Constructor and Description |
---|
UriModifyingOperationPreprocessor() |
Modifier and Type | Method and Description |
---|---|
UriModifyingOperationPreprocessor |
host(String host)
Modifies the URI to use the given
host . |
UriModifyingOperationPreprocessor |
port(int port)
Modifies the URI to use the given
port . |
OperationRequest |
preprocess(OperationRequest request)
Processes the given
request . |
OperationResponse |
preprocess(OperationResponse response)
Processes the given
response . |
UriModifyingOperationPreprocessor |
removePort()
Removes the port from the URI.
|
UriModifyingOperationPreprocessor |
scheme(String scheme)
Modifies the URI to use the given
scheme . |
public UriModifyingOperationPreprocessor scheme(String scheme)
scheme
. null
, the default, will
leave the scheme unchanged.scheme
- the schemethis
public UriModifyingOperationPreprocessor host(String host)
host
. null
, the default, will
leave the host unchanged.host
- the hostthis
public UriModifyingOperationPreprocessor port(int port)
port
.port
- the portthis
public UriModifyingOperationPreprocessor removePort()
this
public OperationRequest preprocess(OperationRequest request)
OperationPreprocessor
request
.preprocess
in interface OperationPreprocessor
request
- the request to processpublic OperationResponse preprocess(OperationResponse response)
OperationPreprocessor
response
.preprocess
in interface OperationPreprocessor
response
- the response to process