当前位置: 首页>>代码示例>>Java>>正文


Java AwsHostNameUtils.parseRegionName方法代码示例

本文整理汇总了Java中com.amazonaws.util.AwsHostNameUtils.parseRegionName方法的典型用法代码示例。如果您正苦于以下问题:Java AwsHostNameUtils.parseRegionName方法的具体用法?Java AwsHostNameUtils.parseRegionName怎么用?Java AwsHostNameUtils.parseRegionName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.amazonaws.util.AwsHostNameUtils的用法示例。


在下文中一共展示了AwsHostNameUtils.parseRegionName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: AWS4SignerRequestParams

import com.amazonaws.util.AwsHostNameUtils; //导入方法依赖的package包/类
/**
 * Generates an instance of AWS4signerRequestParams that holds the
 * parameters used for computing a AWS 4 signature for a request
 */
public AWS4SignerRequestParams(SignableRequest<?> request,
        Date signingDateOverride, String regionNameOverride,
        String serviceName, String signingAlgorithm) {
    if (request == null) {
        throw new IllegalArgumentException("Request cannot be null");
    }
    if (signingAlgorithm == null) {
        throw new IllegalArgumentException(
                "Signing Algorithm cannot be null");
    }
    this.request = request;
    this.signingDateTimeMilli = signingDateOverride != null ? signingDateOverride
            .getTime() : getSigningDate(request);
    this.formattedSigningDate = AWS4SignerUtils
            .formatDateStamp(signingDateTimeMilli);
    this.serviceName = serviceName;
    this.regionName = regionNameOverride != null ? regionNameOverride
            : AwsHostNameUtils.parseRegionName(request.getEndpoint()
                    .getHost(), this.serviceName);
    this.scope = generateScope(request, formattedSigningDate, this.serviceName,
            regionName);
    this.formattedSigningDateTime = AWS4SignerUtils
            .formatTimestamp(signingDateTimeMilli);
    this.signingAlgorithm = signingAlgorithm;
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:30,代码来源:AWS4SignerRequestParams.java

示例2: setEndpoint

import com.amazonaws.util.AwsHostNameUtils; //导入方法依赖的package包/类
/**
 * @deprecated use {@link AmazonS3ClientBuilder#setEndpointConfiguration(AwsClientBuilder.EndpointConfiguration)}
 */
@Override
@Deprecated
public synchronized void setEndpoint(String endpoint) {
	
    if (ServiceUtils.isS3AccelerateEndpoint(endpoint)) {
        throw new IllegalStateException("To enable accelerate mode, please use AmazonS3ClientBuilder.withAccelerateModeEnabled(true)");
    } else {
        super.setEndpoint(endpoint);
        /*
         * Extract the region string from the endpoint if it's not known to be a
         * global S3 endpoint.
         */
        if (!ServiceUtils.isS3USStandardEndpoint(endpoint)) {
            clientRegion = AwsHostNameUtils.parseRegionName(this.endpoint.getHost(), S3_SERVICE_NAME);
        }
    }
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:21,代码来源:AmazonS3Client.java

示例3: computeSignerByURI

import com.amazonaws.util.AwsHostNameUtils; //导入方法依赖的package包/类
/**
 * Returns the signer for the given uri and the current client
 * configuration.
 * <p>
 * Note, however, the signer returned for S3 is incomplete at this stage as
 * the information on the S3 bucket and key is not yet known.
 *
 * @param signerRegionOverride
 *            the overriding signer region; or null if there is none.
 * @param isRegionIdAsSignerParam
 *            true if the "regionId" is used to configure the signer if
 *            applicable; false if this method is called for the purpose of
 *            purely setting the communication end point of this AWS client,
 *            and therefore the "regionId" parameter will not be used
 *            directly for configuring the signer.
 */
private Signer computeSignerByURI(URI uri, String signerRegionOverride,
        boolean isRegionIdAsSignerParam) {
    if (uri == null) {
        throw new IllegalArgumentException(
                "Endpoint is not set. Use setEndpoint to set an endpoint before performing any request.");
    }
    String service = getServiceNameIntern();
    String region = AwsHostNameUtils.parseRegionName(uri.getHost(), service);

    return computeSignerByServiceRegion(
            service, region, signerRegionOverride, isRegionIdAsSignerParam);
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:29,代码来源:AmazonWebServiceClient.java


注:本文中的com.amazonaws.util.AwsHostNameUtils.parseRegionName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。