Package net.solarnetwork.web.support
Class AuthorizationV2RequestInterceptor
java.lang.Object
net.solarnetwork.web.support.AuthorizationV2RequestInterceptor
- All Implemented Interfaces:
org.springframework.http.client.ClientHttpRequestInterceptor
public class AuthorizationV2RequestInterceptor
extends Object
implements org.springframework.http.client.ClientHttpRequestInterceptor
Interceptor to add an Authorization HTTP header using the SNWS2
scheme.
This class is initialized with an AuthorizationCredentialsProvider
instance that must provide the credentials used to authorize and sign each
request.
- Since:
- 1.16
- Version:
- 1.3
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionAuthorizationV2RequestInterceptor(AuthorizationCredentialsProvider credentialsProvider) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.client.ClientHttpResponseintercept(org.springframework.http.HttpRequest request, byte[] body, org.springframework.http.client.ClientHttpRequestExecution execution)
-
Constructor Details
-
AuthorizationV2RequestInterceptor
Constructor.- Parameters:
credentialsProvider- the API token credentials provider
-
-
Method Details
-
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
-