本文整理汇总了Java中com.amazonaws.services.sns.AmazonSNSClientBuilder类的典型用法代码示例。如果您正苦于以下问题:Java AmazonSNSClientBuilder类的具体用法?Java AmazonSNSClientBuilder怎么用?Java AmazonSNSClientBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonSNSClientBuilder类属于com.amazonaws.services.sns包,在下文中一共展示了AmazonSNSClientBuilder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUp
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
/**
* Loads the test-specific Log4J configuration and resets the environment.
*/
public void setUp(String propertiesName)
throws Exception
{
URL config = ClassLoader.getSystemResource(propertiesName);
assertNotNull("missing configuration: " + propertiesName, config);
LogManager.resetConfiguration();
PropertyConfigurator.configure(config);
localLogger = Logger.getLogger(getClass());
runId = String.valueOf(System.currentTimeMillis());
resourceName = "SNSAppenderIntegrationTest-" + runId;
System.setProperty("SNSAppenderIntegrationTest.resourceName", resourceName);
localSNSclient = AmazonSNSClientBuilder.defaultClient();
localSQSclient = AmazonSQSClientBuilder.defaultClient();
}
示例2: getSNSClient
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
/**
* Returns an SNS client.
*
* <p>This method is provided so unit tests can mock out SNS.
*/
protected AmazonSNS getSNSClient() {
// Use a getter here so unit tests can substitute a mock client
AmazonSNS client = AmazonSNSClientBuilder.standard().withRegion(region.getName()).build();
return client;
}
示例3: get
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
@Override
public AmazonSNS get(SnsModule.EndpointConfig config) {
AmazonSNSClientBuilder builder = AmazonSNSClientBuilder.standard();
builder.withCredentials(credentialsProvider);
if (config.endpoint().isPresent()) {
builder.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(config.getEndpoint(), config.getRegionName())
);
} else {
builder.withRegion(config.getRegionName());
}
return builder.build();
}
示例4: createSnsClient
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
public AmazonSNS createSnsClient(String accessKey, String secretKey, String region) {
String decryptedAccessKey = encryptionService.decrypt(accessKey, true);
String decryptedSecretKey = encryptionService.decrypt(secretKey, true);
BasicAWSCredentials credentials = new BasicAWSCredentials(decryptedAccessKey, decryptedSecretKey);
AmazonSNS snsClient = AmazonSNSClientBuilder.standard().withRegion(Regions.fromName(region)).withCredentials(new AWSStaticCredentialsProvider(credentials)).build();
return snsClient;
}
示例5: createAmazonAPIClients
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
private void createAmazonAPIClients() {
cfnClient = AmazonCloudFormationClientBuilder.defaultClient();
ec2Client = AmazonEC2ClientBuilder.defaultClient();
snsClient = AmazonSNSClientBuilder.defaultClient();
sqsClient = AmazonSQSClientBuilder.defaultClient();
elbClient = AmazonElasticLoadBalancingClientBuilder.defaultClient();
s3Client = AmazonS3ClientBuilder.defaultClient();
rdsClient = AmazonRDSClientBuilder.defaultClient();
iamClient = AmazonIdentityManagementClientBuilder.defaultClient();
}
示例6: createNotificationClient
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
public static AmazonSNSClient createNotificationClient() {
BasicCredentialsProvider credentials = BasicCredentialsProvider.standard();
AmazonSNSClient client = !credentials.isValid() ? null : (AmazonSNSClient)
AmazonSNSClientBuilder.standard()
.withCredentials(credentials)
.withRegion("eu-west-1")
.build();
return client;
}
示例7: Texter
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
public Texter() {
AmazonSNSClientBuilder builder = AmazonSNSClientBuilder.standard().withCredentials(new DefaultAWSCredentialsProviderChain());
builder.setRegion(System.getenv("Region"));
amazonSNS = builder.build();
}
示例8: createClient
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
/**
* The static client factory used by smoketestByArn()
*/
public static AmazonSNS createClient()
{
return AmazonSNSClientBuilder.defaultClient();
}
示例9: createSNSClient
import com.amazonaws.services.sns.AmazonSNSClientBuilder; //导入依赖的package包/类
public static AmazonSNS createSNSClient() {
return AmazonSNSClientBuilder.defaultClient();
}