public SnsTopicByName(string topicName, IAmazonSimpleNotificationService client, IMessageSerialisationRegister serialisationRegister) : base(serialisationRegister) { TopicName = topicName; Client = client; Exists(); }
PollWriterManager() { this._snsClient = new AmazonSimpleNotificationServiceClient(); this._dynamoDBClient = new AmazonDynamoDBClient(); this._dbContext = new DynamoDBContext(this._dynamoDBClient, new DynamoDBContextConfig { Conversion = DynamoDBEntryConversion.V2 }); this._swfClient = new AmazonSimpleWorkflowClient(); }
public void Save(string sourceArn, IAmazonSimpleNotificationService client) { ActionIdentifier[] actions = { SNSActionIdentifiers.Subscribe}; var snsPolicy = new Policy() .WithStatements(GetDefaultStatement(sourceArn)) .WithStatements(new Statement(Statement.StatementEffect.Allow) .WithPrincipals(_accountIds.Select(a => new Principal(a)).ToArray()) .WithResources(new Resource(sourceArn)) .WithActionIdentifiers(actions)); var attributeValue = snsPolicy.ToJson(); var setQueueAttributesRequest = new SetTopicAttributesRequest(sourceArn, "Policy", attributeValue); client.SetTopicAttributes(setQueueAttributesRequest); }
protected SnsClient(IAwsConfiguration awsConfiguration) { if (awsConfiguration == null) throw new ArgumentNullException("awsConfiguration"); awsConfiguration.Validate(); try { Client = AWSClientFactory.CreateAmazonSimpleNotificationServiceClient(awsConfiguration.AccessKey, awsConfiguration.SecretKey); } catch (Exception ex) { throw new MessagingException( "An error occurred while attempting to access Amazon SNS. See inner exception for more details.", ex); } }
public SNSMessagePublisher(RegionEndpoint region) { Client = GetSnsClient(region); }
internal ListPlatformApplicationsPaginator(IAmazonSimpleNotificationService client, ListPlatformApplicationsRequest request) { this._client = client; this._request = request; }
public TestableSubscriptionManager(IAmazonSQS sqsClient, IAmazonSimpleNotificationService snsClient, string queueName, QueueCache queueCache, MessageMetadataRegistry messageMetadataRegistry, TopicCache topicCache, bool disableSubscribeBatchingOnStart) : base(sqsClient, snsClient, queueName, queueCache, messageMetadataRegistry, topicCache, disableSubscribeBatchingOnStart) { }
public SubscriptionService(IAmazonSimpleNotificationService sns) { _sns = sns ?? throw new ArgumentNullException(nameof(sns)); }
public TopicCache(IAmazonSimpleNotificationService client) { _client = client; _cache = new GreenCache <TopicInfo>(ClientContextCacheDefaults.GetCacheSettings()); _nameIndex = _cache.AddIndex("entityName", x => x.EntityName); }
public SNSLogger(IAmazonSimpleNotificationService client, string name, string topic) { this.client = client; this.name = name; this.topic = topic; }
/// <summary> /// Creates a <see cref="Flow"/> to publish messages to a SNS topic using an <see cref="IAmazonSimpleNotificationService"/> /// </summary> public static Flow <string, PublishResponse, NotUsed> PlainFlow(string topicArn, IAmazonSimpleNotificationService snsService) { return(Flow.FromGraph(new SnsPublishFlowStage(topicArn, snsService))); }
public Shutdown(IAmazonEC2 client, IAmazonSimpleNotificationService snsClient) { _client = client; _snsClient = snsClient; }
public SnsPublishFlowStage(string topicArn, IAmazonSimpleNotificationService snsService) { TopicArn = topicArn; SnsService = snsService; Shape = new FlowShape <string, PublishResponse>(In, Out); }
public AmazonSqsClientContext(ConnectionContext connectionContext, IAmazonSQS amazonSqs, IAmazonSimpleNotificationService amazonSns, CancellationToken cancellationToken) : base(connectionContext) { _connectionContext = connectionContext; _amazonSqs = amazonSqs; _amazonSns = amazonSns; _cancellationToken = cancellationToken; _taskScheduler = new LimitedConcurrencyLevelTaskScheduler(1); _queueUrls = new Dictionary <string, string>(); _topicArns = new Dictionary <string, string>(); }
public Shutdown() { _client = new AmazonEC2Client(); _snsClient = new AmazonSimpleNotificationServiceClient(); }
internal SimpleNotificationServicePaginatorFactory(IAmazonSimpleNotificationService client) { this.client = client; }
public TopicSubscriberService(IAmazonSimpleNotificationService client) { _client = client; }
public MessageDispatcher(TransportConfiguration configuration, IAmazonS3 s3Client, IAmazonSQS sqsClient, IAmazonSimpleNotificationService snsClient, QueueCache queueCache, TopicCache topicCache) { this.topicCache = topicCache; this.snsClient = snsClient; this.configuration = configuration; this.s3Client = s3Client; this.sqsClient = sqsClient; this.queueCache = queueCache; serializerStrategy = configuration.UseV1CompatiblePayload ? SimpleJson.PocoJsonSerializerStrategy : ReducedPayloadSerializerStrategy.Instance; }
public CreatePhotographFunction(IAmazonDynamoDB dynamoDb, IAmazonSimpleNotificationService sns) { _dynamoDb = dynamoDb; _sns = sns; }
public AdvertController(IAdvertStorageService advertStorageService, IConfiguration configuration, IAmazonSimpleNotificationService notificationService) { _advertStorageService = advertStorageService; _configuration = configuration; _notificationService = notificationService; }
public IndexModel(IAmazonSimpleNotificationService simpleNotificationService, ILogger <IndexModel> logger) { _simpleNotificationService = simpleNotificationService; _logger = logger; }
public LocalTopicArnProvider(IAmazonSimpleNotificationService client, string topicName) { _client = client; _lazyGetArn = new Lazy<string>(() => GetArnInternal(topicName)); }
public SNSPublisher(IAmazonSimpleNotificationService amazonSNSClient, string topicArn) : this(amazonSNSClient, new TopicConfiguration(topicArn)) { }
public NotificationEngine(IAmazonSimpleNotificationService sns, ILogger logger) { _sns = sns ?? throw new ArgumentNullException(nameof(sns)); _logger = logger ?? throw new ArgumentNullException(nameof(logger)); }
/// <summary> /// Creates a <see cref="Sink"/> to publish messages to a SNS topic using an <see cref="IAmazonSimpleNotificationService"/> /// </summary> public static Sink <string, Task> PlainSink(string topicArn, IAmazonSimpleNotificationService snsService) { return(PlainFlow(topicArn, snsService).ToMaterialized(Sink.Ignore <PublishResponse>(), Keep.Right)); }
public TopicAddressPublisher(IAmazonSimpleNotificationService snsClient, ILoggerFactory loggerFactory, IMessageSubjectProvider subjectProvider, IMessageSerializationRegister serializationRegister, Func <Exception, Message, bool> handleException, TopicAddress topicAddress) : base(topicAddress.TopicArn, snsClient, serializationRegister, loggerFactory, subjectProvider, handleException) { }
internal ListSubscriptionsByTopicPaginator(IAmazonSimpleNotificationService client, ListSubscriptionsByTopicRequest request) { this._client = client; this._request = request; }
public AwsEnvironmentBuilder(IAwsClientFactory clientFactory) { sns = clientFactory.CreateSnsClient(); sqs = clientFactory.CreateSqsClient(); }
public SnsTopicCreator(IAmazonSimpleNotificationService snsClient, IAlarmLogger logger) { _snsClient = snsClient; _logger = logger; }
public void Subscribe(IAmazonSimpleNotificationService snsClient, string topicArn) { QueueUrlSnsTopicSubscribeArn = snsClient.SubscribeQueueAsync(topicArn, _client, _queueUrl).Result; }
public SNSPublisher(IAmazonSimpleNotificationService amazonSNSClient, TopicByName toicByName) : this(amazonSNSClient, new TopicConfiguration(amazonSNSClient, toicByName)) { }
public SNSLoggerProvider(ISNSClientFactory factory, IOptions<General> general) { client = factory.CreateSimpleNotificationClient(); this.general = general; }
private Amazon.SimpleNotificationService.Model.SetSubscriptionAttributesResponse CallAWSServiceOperation(IAmazonSimpleNotificationService client, Amazon.SimpleNotificationService.Model.SetSubscriptionAttributesRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Simple Notification Service (SNS)", "SetSubscriptionAttributes"); try { #if DESKTOP return(client.SetSubscriptionAttributes(request)); #elif CORECLR return(client.SetSubscriptionAttributesAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }
internal DownloadFileCommand(ArchiveTransferManager manager, string vaultName, string archiveId, string filePath, DownloadOptions options) { this.manager = manager; this.vaultName = vaultName; this.archiveId = archiveId; this.filePath = filePath; this.options = options; var glacierClient = this.manager.GlacierClient as AmazonGlacierClient; if (glacierClient == null) throw new InvalidOperationException("This can only be called using an AmazonGlacierClient"); this.snsClient = ServiceClientHelpers.CreateServiceFromAnother<AmazonSimpleNotificationServiceClient, AmazonSimpleNotificationServiceConfig>(glacierClient); this.sqsClient = ServiceClientHelpers.CreateServiceFromAnother<AmazonSQSClient, AmazonSQSConfig>(glacierClient); if (this.options == null) this.options = new DownloadOptions(); }
public SNSMessagePublisher(string accessKey, string secretKey, string sessionToken, RegionEndpoint region) { Client = GetSnsClient(accessKey, secretKey, sessionToken, region); }
public SNSPublisher(IAmazonSimpleNotificationService amazonSNSClient, TopicConfiguration topicConfiguration) { _amazonSNSClient = amazonSNSClient; _topicConfiguration = topicConfiguration; }
private PollProcessor() { this._snsClient = new AmazonSimpleNotificationServiceClient(); this._dynamoDBClient = new AmazonDynamoDBClient(); this._dbContext = new DynamoDBContext(this._dynamoDBClient, new DynamoDBContextConfig {Conversion = DynamoDBEntryConversion.V2 }); }
internal ListSMSSandboxPhoneNumbersPaginator(IAmazonSimpleNotificationService client, ListSMSSandboxPhoneNumbersRequest request) { this._client = client; this._request = request; }
/// <summary> /// Implements the Dispose pattern /// </summary> /// <param name="disposing">Whether this object is being disposed via a call to Dispose /// or garbage collected.</param> protected virtual void Dispose(bool disposing) { if (!this.disposed) { if (disposing) { if (snsClient != null) { snsClient.Dispose(); snsClient = null; } if (sqsClient != null) { sqsClient.Dispose(); sqsClient = null; } } this.disposed = true; } }
internal ListTopicsPaginator(IAmazonSimpleNotificationService client, ListTopicsRequest request) { this._client = client; this._request = request; }
public SnsTopicByArn(string topicArn, IAmazonSimpleNotificationService client, IMessageSerialisationRegister serialisationRegister) : base(serialisationRegister) { Arn = topicArn; Client = client; }
public Handler() { _snsClient = new AmazonSimpleNotificationServiceClient(); }
public TopicConfiguration(IAmazonSimpleNotificationService amazonSNSClient, TopicByName topicByName) { _amazonSNSClient = amazonSNSClient; _topicByName = topicByName; }
public FuncMessageSender(ISimpleNotificationServiceProvider provider) { this.snsService = provider.GetSimpleNotificationService(); }
internal DownloadFileCommand(ArchiveTransferManager manager, string vaultName, string archiveId, string filePath, DownloadOptions options) { this.manager = manager; this.vaultName = vaultName; this.archiveId = archiveId; this.filePath = filePath; this.options = options; var credentials = ((AmazonGlacierClient)this.manager.GlacierClient).GetCredentials(); var glacierClient = this.manager.GlacierClient as AmazonGlacierClient; if (glacierClient == null) throw new InvalidOperationException("This can only be called using an AmazonGlacierClient"); this.snsClient = new AmazonSimpleNotificationServiceClient(credentials, glacierClient.CloneConfig<AmazonSimpleNotificationServiceConfig>()); this.sqsClient = new AmazonSQSClient(credentials, glacierClient.CloneConfig<AmazonSQSConfig>()); if (this.options == null) this.options = new DownloadOptions(); }
public SnsTopicByName(string topicName, IAmazonSimpleNotificationService client, IMessageSerialisationRegister serialisationRegister) : base(serialisationRegister) { TopicName = topicName; Client = client; }