Package com.amazonaws.auth

Examples of com.amazonaws.auth.Signer


                     + serviceEndpoint + "'.");

        }

        URI uri = toURI(serviceEndpoint);
        Signer signer = computeSignerByServiceRegion(serviceName,
                region.getName(), signerRegionOverride, false);
        synchronized(this)  {
            this.endpoint = uri;
            this.signer = signer;
        }
View Full Code Here


     * An internal method used to explicitly override the internal signer region
     * computed by the default implementation. This method is not expected to be
     * normally called except for AWS internal development purposes.
     */
    public final void setSignerRegionOverride(String signerRegionOverride) {
        Signer signer = computeSignerByURI(endpoint, signerRegionOverride, true);
        synchronized(this)  {
            this.signer = signer;
            this.signerRegionOverride = signerRegionOverride;
        }
    }
View Full Code Here

        populateSseCpkRequestParameters(request, generatePresignedUrlRequest.getSSECustomerKey());

        addResponseHeaderParameters(request, generatePresignedUrlRequest.getResponseHeaders());

        Signer signer = createSigner(request, bucketName, key);

        if (signer instanceof Presigner) {
            // If we have a signer which knows how to presign requests,
            // delegate directly to it.
            ((Presigner) signer).presignRequest(
View Full Code Here

     */
    protected Signer createSigner(final Request<?> request,
                                  final String bucketName,
                                  final String key) {

        Signer signer = getSigner();

        final AmazonWebServiceRequest originalRequest = request
                .getOriginalRequest();
        final boolean isStandardEnpoint = getEndpoint().getHost().equals(
                Constants.S3_HOSTNAME);
View Full Code Here

     * @throws IllegalArgumentException
     *             If any problems are detected with the specified endpoint.
     */
    public void setEndpoint(String endpoint) throws IllegalArgumentException {
        URI uri = toURI(endpoint);
        Signer signer = computeSignerByURI(uri, signerRegionOverride, false);
        synchronized(this)  {
            this.endpoint = uri;
            this.signer = signer;
        }
    }
View Full Code Here

     * @deprecated
     */
    @Deprecated
    public void setEndpoint(String endpoint, String serviceName, String regionId) {
        URI uri = toURI(endpoint);
        Signer signer = computeSignerByServiceRegion(serviceName, regionId,
                regionId, true);
        synchronized(this)  {
            this.signer = signer;
            this.endpoint = uri;
            this.signerRegionOverride = regionId;
View Full Code Here

    private Signer computeSignerByServiceRegion(
            String serviceName, String regionId,
            String signerRegionOverride,
            boolean isRegionIdAsSignerParam) {
        String signerType = clientConfiguration.getSignerOverride();
        Signer signer = signerType == null
             ? SignerFactory.getSigner(serviceName, regionId)
             : SignerFactory.getSignerByTypeAndService(signerType, serviceName)
             ;
         if (signer instanceof RegionAwareSigner) {
             // Overrides the default region computed
View Full Code Here

                     + serviceEndpoint + "'.");

        }

        URI uri = toURI(serviceEndpoint);
        Signer signer = computeSignerByServiceRegion(serviceName,
                region.getName(), signerRegionOverride, false);
        synchronized(this)  {
            this.endpoint = uri;
            this.signer = signer;
        }
View Full Code Here

     * An internal method used to explicitly override the internal signer region
     * computed by the default implementation. This method is not expected to be
     * normally called except for AWS internal development purposes.
     */
    public final void setSignerRegionOverride(String signerRegionOverride) {
        Signer signer = computeSignerByURI(endpoint, signerRegionOverride, true);
        synchronized(this)  {
            this.signer = signer;
            this.signerRegionOverride = signerRegionOverride;
        }
    }
View Full Code Here

        Map<String, String> originalParameters = new LinkedHashMap<String, String>();
        originalParameters.putAll(request.getParameters());
        Map<String, String> originalHeaders = new HashMap<String, String>();
        originalHeaders.putAll(request.getHeaders());
        final AWSCredentials credentials = executionContext.getCredentials();
        Signer signer = null;

        while (true) {
            ++requestCount;
            awsRequestMetrics.setCounter(Field.RequestCount, requestCount);
            if (requestCount > 1) { // retry
                request.setParameters(originalParameters);
                request.setHeaders(originalHeaders);
            }
            HttpRequestBase httpRequest = null;
            org.apache.http.HttpResponse apacheResponse = null;

            try {
                // Sign the request if a signer was provided
                if (signer == null)
                    signer = executionContext.getSignerByURI(request.getEndpoint());
                if (signer != null && credentials != null) {
                    awsRequestMetrics.startEvent(Field.RequestSigningTime);
                    try {
                        signer.sign(request, credentials);
                    } finally {
                        awsRequestMetrics.endEvent(Field.RequestSigningTime);
                    }
                }
View Full Code Here

TOP

Related Classes of com.amazonaws.auth.Signer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.