public static AmazonSNSClientBuilder builder() { return AmazonSNSClientBuilder.standard(); }
/** * @return Default client using the {@link com.amazonaws.auth.DefaultAWSCredentialsProviderChain} and * {@link com.amazonaws.regions.DefaultAwsRegionProviderChain} chain */ public static AmazonSNS defaultClient() { return standard().build(); }
protected Builder(Class<T> type) { super(type); snsBuilder_ = AmazonSNSClientBuilder.standard(); }
/** * Constructor. */ public Builder() { super(Builder.class); sqsBuilder_ = AmazonSQSClientBuilder.standard(); snsBuilder_ = AmazonSNSClientBuilder.standard(); }
/** * Initializes client wrapper with the default SNS client. * * <p> * This is a simplified version for AWS internal services, like AWS Lambda, which relies on environment * permissions. * </p> * * @param objectMapper JSON handler. * @param topicArn SNS topic ARN. */ public TopicClient(ObjectMapper objectMapper, String topicArn) { this(AmazonSNSClientBuilder.standard().build(), objectMapper, topicArn); }
@Override protected AmazonSNSClient createClient() { return (AmazonSNSClient) builder.configure(AmazonSNSClientBuilder.standard()).build(); }
private void initAWSClients() { ClientConfiguration clientConfig = clientConfiguration(); s3Client = (AmazonS3) clientFactory.apply(AmazonS3ClientBuilder.standard(), clientConfig); lambdaClient = (AWSLambda) clientFactory.apply(AWSLambdaClientBuilder.standard(), clientConfig); snsClient = (AmazonSNS) clientFactory.apply(AmazonSNSClientBuilder.standard(), clientConfig); eventsClient = (AmazonCloudWatchEvents) clientFactory.apply(AmazonCloudWatchEventsClientBuilder.standard(), clientConfig); dynamoDBStreamsClient = (AmazonDynamoDBStreams) clientFactory.apply(AmazonDynamoDBStreamsClientBuilder.standard(), clientConfig); kinesisClient = (AmazonKinesis) clientFactory.apply(AmazonKinesisClientBuilder.standard(), clientConfig); cloudWatchEventsClient = (AmazonCloudWatchEvents) clientFactory.apply(AmazonCloudWatchEventsClientBuilder.standard(), clientConfig); }
@Override public AmazonSNS createSnsPublisher() { return AmazonSNSClientBuilder.standard() .withCredentials(getCredentialsProvider()) .withRegion(region) .build(); } }
/** * Creates a client for accessing Amazon SNS. * * @param awsParamsDto the AWS related parameters DTO that includes optional proxy information * * @return the Amazon SNS client */ @Cacheable(DaoSpringModuleConfig.HERD_CACHE_NAME) public AmazonSNS getAmazonSNSClient(AwsParamsDto awsParamsDto) { // Construct and return a new client to invoke service methods on Amazon SNS using default credentials provider chain. return AmazonSNSClientBuilder.standard().withClientConfiguration(awsHelper.getClientConfiguration(awsParamsDto)) .withRegion(awsParamsDto.getAwsRegionName()).build(); }
/** * Creates a client for accessing Amazon SNS. * * @param awsParamsDto the AWS related parameters DTO that includes optional proxy information * * @return the Amazon SNS client */ @Cacheable(DaoSpringModuleConfig.HERD_CACHE_NAME) public AmazonSNS getAmazonSNSClient(AwsParamsDto awsParamsDto) { // Construct and return a new client to invoke service methods on Amazon SNS using default credentials provider chain. return AmazonSNSClientBuilder.standard().withClientConfiguration(awsHelper.getClientConfiguration(awsParamsDto)) .withRegion(awsParamsDto.getAwsRegionName()).build(); }
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; }
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; }
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; }
if(!skipRegions.contains(region.getName())){ List<Subscription> subscriptionList = new ArrayList<>(); snsClient = (AmazonSNSClient) AmazonSNSClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(region.getName()).build(); String nextToken = null; ListSubscriptionsResult listSubscriptionDefinitionsResult;
@Override protected Void run() throws Exception { final String topicArn = this.step.getTopicArn(); final String subject = this.step.getSubject(); final String message = this.step.getMessage(); final Map<String, String> messageAttributes = this.step.getMessageAttributes(); TaskListener listener = this.getContext().get(TaskListener.class); AmazonSNS snsClient = AWSClientFactory.create(AmazonSNSClientBuilder.standard(), this.getContext()); listener.getLogger().format("Publishing notification %s to %s %n", subject, topicArn); PublishRequest publishRequest = new PublishRequest() .withTopicArn(topicArn).withMessage(message).withSubject(subject); if (messageAttributes != null && !messageAttributes.isEmpty()) { for (Map.Entry<String, String> entry : messageAttributes.entrySet()) { MessageAttributeValue value = new MessageAttributeValue(); value.setStringValue(entry.getValue()); value.setDataType(STRING_DATATYPE); publishRequest.addMessageAttributesEntry(entry.getKey(), value); } } PublishResult result = snsClient.publish(publishRequest); listener.getLogger().format("Message published as %s %n", result.getMessageId()); return null; }
pubsubMessageHandler, AmazonSNSClientBuilder .standard() .withCredentials(awsCredentialsProvider) .withClientConfiguration(new ClientConfiguration())
.withRegion(Regions.fromName(region)) .build(); final AmazonSNS sns = AmazonSNSClientBuilder.standard() .withCredentials(credentialsProvider) .withRegion(Regions.fromName(region))