Java 类com.amazonaws.services.sns.AmazonSNSClientBuilder 实例源码

项目:log4j-aws-appenders    文件:SNSAppenderIntegrationTest.java   
/**
 *  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();
}
项目:Sqawsh    文件:PageManager.java   
/**
 * 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;
}
项目:Sqawsh    文件:BackupManager.java   
/**
 * 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;
}
项目:Sqawsh    文件:BookingManager.java   
/**
 * 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;
}
项目:Sqawsh    文件:RuleManager.java   
/**
 * 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;
}
项目:ratpack-sqs    文件:DefaultAmazonSNSProvider.java   
@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();
}
项目:oxAuth    文件:PushSnsService.java   
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;
}
项目:cfnassist    文件:FacadeFactory.java   
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();
}
项目:wildfly-camel    文件:SNSUtils.java   
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;
}
项目:lambdatexter    文件:Texter.java   
public Texter() {
    AmazonSNSClientBuilder builder = AmazonSNSClientBuilder.standard().withCredentials(new DefaultAWSCredentialsProviderChain());
    builder.setRegion(System.getenv("Region"));
    amazonSNS = builder.build();
}
项目:log4j-aws-appenders    文件:SNSAppenderIntegrationTest.java   
/**
 *  The static client factory used by smoketestByArn()
 */
public static AmazonSNS createClient()
{
    return AmazonSNSClientBuilder.defaultClient();
}
项目:cfnassist    文件:EnvironmentSetupForTests.java   
public static AmazonSNS createSNSClient() {
       return AmazonSNSClientBuilder.defaultClient();
}