Ejemplo n.º 1
0
        public ReportAgent(ConnectorCredential credential, IReportManager reportManager)
        {
            this.credential    = credential;
            this.reportManager = reportManager;

            this.thisLock = new object();
        }
Ejemplo n.º 2
0
 public ReportAgent(ConnectorCredential credential, EmailAccount emailAccount, ServiceConfiguration configuration)
 {
     this.credential    = credential;
     this.emailAccount  = emailAccount;
     this.configuration = configuration;
     this.serviceUri    = new Uri(credential.ConnectorUri);
     this.actorId       = new ActorId(string.Format(AgentIdFormat, credential.ConnectorName, credential.ConnectorId, emailAccount.EngagementAccount, Random.Next(1, this.configuration.ActorReportMaxCount)));
     this.connector     = ActorProxy.Create <IEmailConnector>(this.actorId, this.serviceUri);
 }
Ejemplo n.º 3
0
        public ConnectorCredential ToDataContract(ConnectorMetadata metadata)
        {
            var credential = new ConnectorCredential();

            credential.ConnectorName       = this.ConnectorName;
            credential.ConnectorId         = this.ConnectorId;
            credential.BatchSize           = metadata.BatchSize;
            credential.ConnectorUri        = metadata.ConnectorUri;
            credential.ConnectorProperties = new PropertyCollection <string>(this.ConnectorProperties);

            return(credential);
        }
Ejemplo n.º 4
0
        private ReportAgent GetAgent(ConnectorCredential credential)
        {
            var key = this.GetAgentKey(credential);

            if (!this.agents.ContainsKey(key))
            {
                this.agents.TryAdd(key, new ReportAgent(credential, this));
            }

            if (this.agents.TryGetValue(key, out ReportAgent agent))
            {
                return(agent);
            }

            SmsProviderEventSource.Current.Error(SmsProviderEventSource.EmptyTrackingId, this, nameof(this.GetAgent), OperationStates.Failed, $"Report manager cannot get agent for connectorName={credential.ConnectorName} connectorKey={credential.ConnectorId}");
            return(null);
        }
Ejemplo n.º 5
0
 private EmailEngineAgent GetEmailEngineAgent(ConnectorCredential credential, string engagementAccount)
 {
     // Get agent
     return(new EmailEngineAgent(credential, engagementAccount, this.configuration));
 }
Ejemplo n.º 6
0
        public Task <InboundResponse> ParseInboundRequestAsync(HttpRequestMessage request, ConnectorCredential credential, CancellationToken cancellationToken)
        {
            var requestContract = new InboundHttpRequestMessage(request);

            return(this.connector.ParseInboundRequestAsync(requestContract, credential, cancellationToken));
        }
Ejemplo n.º 7
0
 public Task DeleteEmailAccountAsync(ConnectorCredential credential, EmailAccount emailAccount, CancellationToken cancellationToken)
 {
     return(this.connector.DeleteEmailAccountAsync(credential, emailAccount, cancellationToken));
 }
Ejemplo n.º 8
0
 public CredentialAgent(ConnectorCredential credential, string engagementAccount)
 {
     this.serviceUri = new Uri(credential.ConnectorUri);
     this.actorId    = new ActorId(string.Format(AgentIdFormat, credential.ConnectorName, credential.ConnectorId, engagementAccount));
     this.connector  = ActorProxy.Create <IEmailConnector>(this.actorId, this.serviceUri);
 }
Ejemplo n.º 9
0
 // SenderAddress
 public Task <SenderAddress> CreateorUpdateSenderAddressAsync(ConnectorCredential credential, EmailAccount emailAccount, SenderAddress senderAddress, CancellationToken cancellationToken)
 {
     return(this.connector.CreateorUpdateSenderAddressAsync(credential, emailAccount, senderAddress, cancellationToken));
 }
Ejemplo n.º 10
0
 public PushConnector(ConnectorCredential connectorInfo)
 {
     this.connectorInfo = connectorInfo;
 }
Ejemplo n.º 11
0
 // Mailing
 public Task DeleteMailingAsync(ConnectorCredential credential, EmailAccount emailAccount, List <MessageIdentifer> messageIdentifers, CancellationToken cancellationToken)
 {
     return(this.connector.DeleteMailingAsync(credential, emailAccount, messageIdentifers, cancellationToken));
 }
Ejemplo n.º 12
0
 public Task DeleteGroupAsync(ConnectorCredential credential, EmailAccount emailAccount, List <Group> groupList, CancellationToken cancellationToken)
 {
     return(this.connector.DeleteGroupAsync(credential, emailAccount, groupList, cancellationToken));
 }
Ejemplo n.º 13
0
 public Task <GroupMembers> GetGroupMembersAsync(ConnectorCredential credential, EmailAccount emailAccount, Group group, GroupMemberRequest request, CancellationToken cancellationToken)
 {
     return(this.connector.GetGroupMembersAsync(credential, emailAccount, group, request, cancellationToken));
 }
Ejemplo n.º 14
0
 // Group
 public Task <GroupCreateOrUpdateResult> CreateorUpdateGroupAsync(ConnectorCredential credential, EmailAccount emailAccount, Group group, CancellationToken cancellationToken)
 {
     return(this.connector.CreateorUpdateGroupAsync(credential, emailAccount, group, cancellationToken));
 }
Ejemplo n.º 15
0
 public Task DeleteSenderAddressAsync(ConnectorCredential credential, EmailAccount emailAccount, List <SenderAddress> senderAddressList, CancellationToken cancellationToken)
 {
     return(this.connector.DeleteSenderAddressAsync(credential, emailAccount, senderAddressList, cancellationToken));
 }
Ejemplo n.º 16
0
 public static PushConnector Create(ConnectorCredential connectorInfo)
 {
     return(new PushConnector(connectorInfo));
 }
Ejemplo n.º 17
0
 public EmailEngineAgent(ConnectorCredential credential, string engagementAccount, ServiceConfiguration configuration)
 {
     this.serviceUri = new Uri(credential.ConnectorUri);
     this.actorId    = new ActorId(string.Format(AgentIdFormat, credential.ConnectorName, credential.ConnectorId, engagementAccount, Random.Next(1, configuration.ActorAccountMaxCount)));
     this.connector  = ActorProxy.Create <IEmailConnector>(this.actorId, this.serviceUri);
 }