當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。