Class HelixMetadataInterceptor
java.lang.Object
com.helixframework.resttemplate.metadata.HelixMetadataInterceptor
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class HelixMetadataInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
RestTemplate interceptor that sets the `X-Metadata` header on downstream requests with values found in the helix context.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder(com.helixframework.env.HelixEnvironment env) Creates a builder forHelixMetadataInterceptor.org.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)
-
Method Details
-
builder
Creates a builder forHelixMetadataInterceptor.- Parameters:
env- helix environment- Returns:
- a
HelixMetadataInterceptor.Builder
-
intercept
public org.springframework.http.client.ClientHttpResponse intercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution) throws IOException - Specified by:
interceptin interfaceorg.springframework.http.client.ClientHttpRequestInterceptor- Throws:
IOException
-