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


Java DefaultAWSCredentialsProviderChain.getInstance方法代码示例

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


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

示例1: createSQSAsync

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
@Override
public AmazonSQS createSQSAsync(final SQSQueue queue) {
    AWSCredentialsProvider credentials = queue.hasCredentials() ? queue.lookupAwsCredentials() : DefaultAWSCredentialsProviderChain.getInstance();
    AmazonSQSAsyncClientBuilder sqsAsyncBuilder = createStandardAsyncClientBuilder(queue, credentials);
    final QueueBufferConfig queueBufferConfig = this.getQueueBufferConfig(queue);
    final AmazonSQSBufferedAsyncClient sqsBufferedAsync = new AmazonSQSBufferedAsyncClient(sqsAsyncBuilder.build(), queueBufferConfig);
    return sqsBufferedAsync;
}
 
开发者ID:riboseinc,项目名称:aws-codecommit-trigger-plugin,代码行数:9,代码来源:SQSFactoryImpl.java

示例2: LinkGeneratorLambdaHandler

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
@SuppressWarnings({"unused", "WeakerAccess"})
public LinkGeneratorLambdaHandler() throws IOException, TemplateException {
    this(
            getEnv("AUTH_REGION"),
            getEnv("JWT_ENCRYPT_KEY_ARN"),
            getEnv("PAGE_STORAGE_BUCKET"),
            getEnv("AUTH_ENDPOINT_URL"),
            DefaultAWSCredentialsProviderChain.getInstance(),
            "intro.html.ftl");
}
 
开发者ID:julianghionoiu,项目名称:tdl-auth,代码行数:11,代码来源:LinkGeneratorLambdaHandler.java

示例3: amazonSNS

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
/**
 * If SNS notifications are desired and no existing client has been created elsewhere
 * in the application create a default client here.
 * @param config       The system configuration abstraction to use
 * @param registry     registry for spectator
 * @return The configured SNS client
 */
//TODO: See what spring-cloud-aws would provide automatically...
@Bean
@ConditionalOnMissingBean(AmazonSNSAsync.class)
public AmazonSNSAsync amazonSNS(final Config config, final Registry registry) {
    final ExecutorService executor = Executors.newFixedThreadPool(config.getSNSClientThreadCount(),
        new ThreadFactoryBuilder().setNameFormat("metacat-sns-pool-%d").build());
    RegistryUtil.registerThreadPool(registry, "metacat-sns-pool", (ThreadPoolExecutor) executor);
    return new AmazonSNSAsyncClient(DefaultAWSCredentialsProviderChain.getInstance(), executor);
}
 
开发者ID:Netflix,项目名称:metacat,代码行数:17,代码来源:SNSNotificationsConfig.java

示例4: getAwsCredentialsProvider

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
private static AWSCredentialsProvider getAwsCredentialsProvider() {

			DefaultAWSCredentialsProviderChain backingCredentialsProvider = DefaultAWSCredentialsProviderChain
					.getInstance();

			// Eagerly fetch credentials preventing lag during the first, actual login.
			AWSCredentials firstAccess = backingCredentialsProvider.getCredentials();

			AtomicReference<AWSCredentials> once = new AtomicReference<>(firstAccess);

			return new AWSCredentialsProvider() {

				@Override
				public AWSCredentials getCredentials() {

					if (once.compareAndSet(firstAccess, null)) {
						return firstAccess;
					}

					return backingCredentialsProvider.getCredentials();
				}

				@Override
				public void refresh() {
					backingCredentialsProvider.refresh();
				}
			};
		}
 
开发者ID:spring-cloud,项目名称:spring-cloud-vault,代码行数:29,代码来源:ClientAuthenticationFactory.java

示例5: getAwsCredentialsProvider

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
public static AWSCredentialsProvider getAwsCredentialsProvider(String accessKeyId, String secretKey) {
  if (accessKeyId != null && secretKey != null) {
    return new AWSStaticCredentialsProvider(new BasicAWSCredentials(accessKeyId, secretKey));
  } else {
    return DefaultAWSCredentialsProviderChain.getInstance();
  }
}
 
开发者ID:spinnaker,项目名称:halyard,代码行数:8,代码来源:AwsAccountValidator.java

示例6: credentialsProvider

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
private AWSCredentialsProvider credentialsProvider() {
    return DefaultAWSCredentialsProviderChain.getInstance();
}
 
开发者ID:eonian-technologies,项目名称:secrets-locker,代码行数:4,代码来源:S3SecretsLocker.java

示例7: resolveCredentials

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
/**
 * If the builder isn't explicitly configured with credentials we use the {@link
 * DefaultAWSCredentialsProviderChain}.
 */
private AWSCredentialsProvider resolveCredentials() {
    return (credentials == null) ? DefaultAWSCredentialsProviderChain.getInstance() : credentials;
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:8,代码来源:AwsClientBuilder.java

示例8: AWSKMSAsyncClient

import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; //导入方法依赖的package包/类
/**
 * Constructs a new asynchronous client to invoke service methods on KMS. A credentials provider chain will be used
 * that searches for credentials in this order:
 * <ul>
 * <li>Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY</li>
 * <li>Java System Properties - aws.accessKeyId and aws.secretKey</li>
 * <li>Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI</li>
 * <li>Instance profile credentials delivered through the Amazon EC2 metadata service</li>
 * </ul>
 * <p>
 * Asynchronous methods are delegated to a fixed-size thread pool containing 50 threads (to match the default
 * maximum number of concurrent connections to the service).
 *
 * @see com.amazonaws.auth.DefaultAWSCredentialsProviderChain
 * @see java.util.concurrent.Executors#newFixedThreadPool(int)
 * @deprecated use {@link AWSKMSAsyncClientBuilder#defaultClient()}
 */
@Deprecated
public AWSKMSAsyncClient() {
    this(DefaultAWSCredentialsProviderChain.getInstance());
}
 
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:22,代码来源:AWSKMSAsyncClient.java


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