Search in sources :

Example 1 with ClasspathInterceptorChainFactory

use of software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory in project aws-sdk-java-v2 by aws.

the class DefaultJsonBaseClientBuilder method finalizeServiceConfiguration.

@Override
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
    ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
    List<ExecutionInterceptor> interceptors = interceptorFactory.getInterceptors("software/amazon/awssdk/services/json/execution.interceptors");
    interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS));
    return config.toBuilder().option(SdkClientOption.EXECUTION_INTERCEPTORS, interceptors).build();
}
Also used : ClasspathInterceptorChainFactory(software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory) ExecutionInterceptor(software.amazon.awssdk.core.interceptor.ExecutionInterceptor)

Example 2 with ClasspathInterceptorChainFactory

use of software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory in project aws-sdk-java-v2 by aws.

the class DefaultS3Presigner method initializeInterceptors.

/**
 * Copied from {@code DefaultS3BaseClientBuilder} and {@link SdkDefaultClientBuilder}.
 */
private List<ExecutionInterceptor> initializeInterceptors() {
    ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
    List<ExecutionInterceptor> s3Interceptors = interceptorFactory.getInterceptors("software/amazon/awssdk/services/s3/execution.interceptors");
    return mergeLists(interceptorFactory.getGlobalInterceptors(), s3Interceptors);
}
Also used : ClasspathInterceptorChainFactory(software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory) ExecutionInterceptor(software.amazon.awssdk.core.interceptor.ExecutionInterceptor)

Example 3 with ClasspathInterceptorChainFactory

use of software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory in project aws-sdk-java-v2 by aws.

the class DefaultQueryBaseClientBuilder method finalizeServiceConfiguration.

@Override
protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientConfiguration config) {
    ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory();
    List<ExecutionInterceptor> interceptors = interceptorFactory.getInterceptors("software/amazon/awssdk/services/query/execution.interceptors");
    interceptors = CollectionUtils.mergeLists(interceptors, config.option(SdkClientOption.EXECUTION_INTERCEPTORS));
    List<ExecutionInterceptor> protocolInterceptors = Collections.singletonList(new QueryParametersToBodyInterceptor());
    interceptors = CollectionUtils.mergeLists(interceptors, protocolInterceptors);
    return config.toBuilder().option(SdkClientOption.EXECUTION_INTERCEPTORS, interceptors).build();
}
Also used : QueryParametersToBodyInterceptor(software.amazon.awssdk.protocols.query.interceptor.QueryParametersToBodyInterceptor) ClasspathInterceptorChainFactory(software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory) ExecutionInterceptor(software.amazon.awssdk.core.interceptor.ExecutionInterceptor)

Aggregations

ClasspathInterceptorChainFactory (software.amazon.awssdk.core.interceptor.ClasspathInterceptorChainFactory)3 ExecutionInterceptor (software.amazon.awssdk.core.interceptor.ExecutionInterceptor)3 QueryParametersToBodyInterceptor (software.amazon.awssdk.protocols.query.interceptor.QueryParametersToBodyInterceptor)1