Example usage for com.amazonaws.auth AWS4Signer setRegionName

List of usage examples for com.amazonaws.auth AWS4Signer setRegionName

Introduction

In this page you can find the example usage for com.amazonaws.auth AWS4Signer setRegionName.

Prototype

@Override
public void setRegionName(String regionName) 

Source Link

Document

Sets the region name that this signer should use when calculating request signatures.

Usage

From source file:com.eucalyptus.ws.handlers.IoInternalHmacHandler.java

License:Open Source License

private void sign(final FullHttpRequest request) {
    final AWS4Signer signer = new AWS4Signer();
    signer.setRegionName("eucalyptus");
    signer.setServiceName("internal");
    signer.sign(wrapRequest(request), credentials());
}

From source file:com.streamsets.pipeline.lib.aws.AwsUtil.java

License:Apache License

public static AwsRequestSigningApacheInterceptor getAwsSigV4Interceptor(String awsServiceName,
        AwsRegion awsRegion, String otherEndpoint, CredentialValue awsAccessKeyId,
        CredentialValue awsSecretAccessKey) throws StageException {
    AWS4Signer signer = new AWS4Signer();
    signer.setServiceName(awsServiceName);

    if (awsRegion == AwsRegion.OTHER) {
        if (otherEndpoint == null || otherEndpoint.isEmpty()) {
            return null;
        }/*from   w  w  w.  j  a v  a2 s .c o m*/
        signer.setRegionName(otherEndpoint);
    } else {
        signer.setRegionName(awsRegion.getId());
    }

    return new AwsRequestSigningApacheInterceptor(awsServiceName, signer,
            AwsUtil.getCredentialsProvider(awsAccessKeyId, awsSecretAccessKey));
}

From source file:zipkin.autoconfigure.storage.elasticsearch.aws.ElasticsearchAwsRequestSigner.java

License:Apache License

@Override
public void process(HttpRequest hr, HttpContext hc) {
    AWSCredentials creds = credentialsProvider.getCredentials();
    AWS4Signer signer = new AWS4Signer();
    signer.setServiceName("es");
    signer.setRegionName(region);
    signer.sign(new SignableHttpRequest(hr, hc), creds);
}