Пример #1
0
 public Address[] GetAddressesOrDomain(string[] emailAddresses, EntityStatus?status)
 {
     try
     {
         return(Store.Addresses.Get(emailAddresses, true, status));
     }
     catch (Exception ex)
     {
         throw CreateFault("GetAddressesOrDomain", ex);
     }
 }
 /// <summary>
 /// Initializes a new instance of the EventhubInner class.
 /// </summary>
 /// <param name="partitionIds">Current number of shards on the Event
 /// Hub.</param>
 /// <param name="createdAt">Exact time the Event Hub was
 /// created.</param>
 /// <param name="updatedAt">The exact time the message was
 /// updated.</param>
 /// <param name="messageRetentionInDays">Number of days to retain the
 /// events for this Event Hub, value should be 1 to 7 days</param>
 /// <param name="partitionCount">Number of partitions created for the
 /// Event Hub, allowed values are from 1 to 32 partitions.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of the Event Hub. Possible values include: 'Active', 'Disabled',
 /// 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating',
 /// 'Deleting', 'Renaming', 'Unknown'</param>
 /// <param name="captureDescription">Properties of capture
 /// description</param>
 public EventhubInner(string id = default(string), string name = default(string), string type = default(string), IList <string> partitionIds = default(IList <string>), System.DateTime?createdAt = default(System.DateTime?), System.DateTime?updatedAt = default(System.DateTime?), long?messageRetentionInDays = default(long?), long?partitionCount = default(long?), EntityStatus?status = default(EntityStatus?), CaptureDescription captureDescription = default(CaptureDescription))
     : base(id, name, type)
 {
     PartitionIds           = partitionIds;
     CreatedAt              = createdAt;
     UpdatedAt              = updatedAt;
     MessageRetentionInDays = messageRetentionInDays;
     PartitionCount         = partitionCount;
     Status             = status;
     CaptureDescription = captureDescription;
     CustomInit();
 }
        private static IEnumerable <(string Key, string Error)> Check(EntityStatus?expected, EntityStatus actual)
        {
            if (!expected.HasValue)
            {
                yield break;
            }

            if (!expected.Value.Equals(actual))
            {
                yield return("MaxSizeInMB", $"Expected Value: '{expected}', Actual Value: '{actual}'");
            }
        }
 /// <summary>
 /// Initializes a new instance of the
 /// EventHubCreateOrUpdateParametersInner class.
 /// </summary>
 /// <param name="location">Location of the resource.</param>
 /// <param name="type">ARM type of the Namespace.</param>
 /// <param name="name">Name of the Event Hub.</param>
 /// <param name="createdAt">Exact time the Event Hub was
 /// created.</param>
 /// <param name="messageRetentionInDays">Number of days to retain the
 /// events for this Event Hub.</param>
 /// <param name="partitionCount">Number of partitions created for the
 /// Event Hub.</param>
 /// <param name="partitionIds">Current number of shards on the Event
 /// Hub.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of the Event Hub. Possible values include: 'Active', 'Disabled',
 /// 'Restoring', 'SendDisabled', 'ReceiveDisabled', 'Creating',
 /// 'Deleting', 'Renaming', 'Unknown'</param>
 /// <param name="updatedAt">The exact time the message was
 /// updated.</param>
 public EventHubCreateOrUpdateParametersInner(string location, string type = default(string), string name = default(string), System.DateTime?createdAt = default(System.DateTime?), long?messageRetentionInDays = default(long?), long?partitionCount = default(long?), IList <string> partitionIds = default(IList <string>), EntityStatus?status = default(EntityStatus?), System.DateTime?updatedAt = default(System.DateTime?))
 {
     Location  = location;
     Type      = type;
     Name      = name;
     CreatedAt = createdAt;
     MessageRetentionInDays = messageRetentionInDays;
     PartitionCount         = partitionCount;
     PartitionIds           = partitionIds;
     Status    = status;
     UpdatedAt = updatedAt;
     CustomInit();
 }
Пример #5
0
        public async Task <IActionResult> Index(EntityStatus?status = null)
        {
            var games = await _gameService.GetAllAsync(status);

            return(new JsonResult(games.Select(g => new BaseGame
            {
                ID = g.Id,
                Name = g.Name,
                HasSite = g.HasSite,
                GameKey = g.GameKey,
                Status = g.Status,
            })));
        }
Пример #6
0
        public HttpResponseMessage GetAgentDomains(string agentName, EntityStatus?status)
        {
            try
            {
                var domains = _configStore.Domains.Get(agentName, status);

                return(Request.CreateResponse(HttpStatusCode.OK, domains));
            }
            catch (Exception ex)
            {
                _logger.Info("GetAgentDomains failed with exception.", ex);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }
Пример #7
0
        public async Task <IEnumerable <City> > GetByParentIdAsync(int?parentId, EntityStatus?status = null)
        {
            if (status != null)
            {
                return(await _dbSet
                       .Where(_ => _.Status == status.Value)
                       .Where(_ => _.ParentId == parentId)
                       .ToListAsync());
            }

            return(await _dbSet
                   .Where(_ => _.ParentId == parentId)
                   .ToListAsync());
        }
Пример #8
0
        public IEnumerable <Address> Get(ConfigDatabase db, long[] addressIDs, EntityStatus?status)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (status == null)
            {
                return(db.Addresses.Get(addressIDs));
            }

            return(db.Addresses.Get(addressIDs, status.Value));
        }
Пример #9
0
        public IEnumerable <Address> Get(ConfigDatabase db, string[] emailAddresses, EntityStatus?status)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            this.VerifyEmailAddresses(emailAddresses);
            if (status == null)
            {
                return(db.Addresses.Get(emailAddresses));
            }

            return(db.Addresses.Get(emailAddresses, status.Value));
        }
Пример #10
0
        public void GetTest2()
        {
            CertificateManager target = CreateManager();
            string             owner  = string.Format("{0}", BuildDomainName(GetRndDomainID()));
            EntityStatus?      status = EntityStatus.New;

            Certificate[] actual = target.Get(owner, status).ToArray();
            Assert.Equal(MAXCERTPEROWNER, actual.Count());
            foreach (Certificate cert in actual)
            {
                Assert.Equal(EntityStatus.New, cert.Status);
                Assert.Equal(owner, cert.Owner);
            }
            target.SetStatus(actual.First().ID, EntityStatus.Enabled);
            actual = target.Get(owner, status).ToArray();
            Assert.Equal(MAXCERTPEROWNER - 1, actual.Count());
        }
Пример #11
0
        public IEnumerable <Domain> Get(ConfigDatabase db, string agentName, EntityStatus?status)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(agentName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidAgentName);
            }

            if (status == null)
            {
                return(db.Domains.GetDomainGroup(agentName));
            }

            return(db.Domains.GetDomainGroup(agentName, status.Value));
        }
 /// <summary>
 /// Initializes a new instance of the SubscriptionInner class.
 /// </summary>
 /// <param name="accessedAt">Last time there was a receive request to
 /// this subscription.</param>
 /// <param name="autoDeleteOnIdle">TimeSpan idle interval after which
 /// the topic is automatically deleted. The minimum duration is 5
 /// minutes. The service accepts a C# Standard TimeSpan Format for loc
 /// duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx.
 /// Format is 'DD.HH:MM:SS' and default value of this property is
 /// 10675199 days</param>
 /// <param name="createdAt">Exact time the Subscription was
 /// created.</param>
 /// <param name="defaultMessageTimeToLive">Default message time to live
 /// value. This is the duration after which the message expires,
 /// starting from when the message is sent to Service Bus. This is the
 /// default value used when TimeToLive is not set on a message itself.
 /// The service accepts a C# Standard TimeSpan Format for loc duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx .
 /// Format is 'DD.HH:MM:SS' and default value of this property is
 /// 10675199 days</param>
 /// <param name="deadLetteringOnFilterEvaluationExceptions">Value that
 /// indicates whether a subscription has dead letter support on filter
 /// evaluation exceptions.</param>
 /// <param name="deadLetteringOnMessageExpiration">Value that indicates
 /// whether a subscription has dead letter support when a message
 /// expires.</param>
 /// <param name="enableBatchedOperations">Value that indicates whether
 /// server-side batched operations are enabled.</param>
 /// <param name="lockDuration">The lock duration time span for the
 /// subscription. The service accepts a C# Standard TimeSpan Format for
 /// loc duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx</param>
 /// <param name="maxDeliveryCount">Number of maximum
 /// deliveries.</param>
 /// <param name="messageCount">Number of messages.</param>
 /// <param name="requiresSession">Value indicating if a subscription
 /// supports the concept of sessions.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of a messaging entity. Possible values include: 'Active',
 /// 'Creating', 'Deleting', 'Disabled', 'ReceiveDisabled', 'Renaming',
 /// 'Restoring', 'SendDisabled', 'Unknown'</param>
 /// <param name="updatedAt">The exact time the subscription was
 /// updated.</param>
 public SubscriptionInner(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), System.DateTime?accessedAt = default(System.DateTime?), string autoDeleteOnIdle = default(string), MessageCountDetails countDetails = default(MessageCountDetails), System.DateTime?createdAt = default(System.DateTime?), string defaultMessageTimeToLive = default(string), bool?deadLetteringOnFilterEvaluationExceptions = default(bool?), bool?deadLetteringOnMessageExpiration = default(bool?), bool?enableBatchedOperations = default(bool?), string lockDuration = default(string), int?maxDeliveryCount = default(int?), long?messageCount = default(long?), bool?requiresSession = default(bool?), EntityStatus?status = default(EntityStatus?), System.DateTime?updatedAt = default(System.DateTime?))
     : base(location, id, name, type, tags)
 {
     AccessedAt               = accessedAt;
     AutoDeleteOnIdle         = autoDeleteOnIdle;
     CountDetails             = countDetails;
     CreatedAt                = createdAt;
     DefaultMessageTimeToLive = defaultMessageTimeToLive;
     DeadLetteringOnFilterEvaluationExceptions = deadLetteringOnFilterEvaluationExceptions;
     DeadLetteringOnMessageExpiration          = deadLetteringOnMessageExpiration;
     EnableBatchedOperations = enableBatchedOperations;
     LockDuration            = lockDuration;
     MaxDeliveryCount        = maxDeliveryCount;
     MessageCount            = messageCount;
     RequiresSession         = requiresSession;
     Status    = status;
     UpdatedAt = updatedAt;
     CustomInit();
 }
Пример #13
0
        public IEnumerable <Certificate> Get(ConfigDatabase db, string owner, EntityStatus?status)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (string.IsNullOrEmpty(owner))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            if (status == null)
            {
                return(db.Certificates.Get(owner));
            }

            return(db.Certificates.Get(owner, status.Value));
        }
 internal ServiceBusTopicData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, long?sizeInBytes, DateTimeOffset?createdAt, DateTimeOffset?updatedAt, DateTimeOffset?accessedAt, int?subscriptionCount, MessageCountDetails countDetails, TimeSpan?defaultMessageTimeToLive, int?maxSizeInMegabytes, long?maxMessageSizeInKilobytes, bool?requiresDuplicateDetection, TimeSpan?duplicateDetectionHistoryTimeWindow, bool?enableBatchedOperations, EntityStatus?status, bool?supportOrdering, TimeSpan?autoDeleteOnIdle, bool?enablePartitioning, bool?enableExpress) : base(id, name, type, systemData)
 {
     SizeInBytes                         = sizeInBytes;
     CreatedAt                           = createdAt;
     UpdatedAt                           = updatedAt;
     AccessedAt                          = accessedAt;
     SubscriptionCount                   = subscriptionCount;
     CountDetails                        = countDetails;
     DefaultMessageTimeToLive            = defaultMessageTimeToLive;
     MaxSizeInMegabytes                  = maxSizeInMegabytes;
     MaxMessageSizeInKilobytes           = maxMessageSizeInKilobytes;
     RequiresDuplicateDetection          = requiresDuplicateDetection;
     DuplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow;
     EnableBatchedOperations             = enableBatchedOperations;
     Status             = status;
     SupportOrdering    = supportOrdering;
     AutoDeleteOnIdle   = autoDeleteOnIdle;
     EnablePartitioning = enablePartitioning;
     EnableExpress      = enableExpress;
 }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the SBTopic class.
 /// </summary>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="sizeInBytes">Size of the topic, in bytes.</param>
 /// <param name="createdAt">Exact time the message was created.</param>
 /// <param name="updatedAt">The exact time the message was
 /// updated.</param>
 /// <param name="accessedAt">Last time the message was sent, or a
 /// request was received, for this topic.</param>
 /// <param name="subscriptionCount">Number of subscriptions.</param>
 /// <param name="countDetails">Message count deatils</param>
 /// <param name="defaultMessageTimeToLive">ISO 8601 Default message
 /// timespan to live value. This is the duration after which the
 /// message expires, starting from when the message is sent to Service
 /// Bus. This is the default value used when TimeToLive is not set on a
 /// message itself.</param>
 /// <param name="maxSizeInMegabytes">Maximum size of the topic in
 /// megabytes, which is the size of the memory allocated for the topic.
 /// Default is 1024.</param>
 /// <param name="requiresDuplicateDetection">Value indicating if this
 /// topic requires duplicate detection.</param>
 /// <param name="duplicateDetectionHistoryTimeWindow">ISO8601 timespan
 /// structure that defines the duration of the duplicate detection
 /// history. The default value is 10 minutes.</param>
 /// <param name="enableBatchedOperations">Value that indicates whether
 /// server-side batched operations are enabled.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of a messaging entity. Possible values include: 'Active',
 /// 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled',
 /// 'Creating', 'Deleting', 'Renaming', 'Unknown'</param>
 /// <param name="supportOrdering">Value that indicates whether the
 /// topic supports ordering.</param>
 /// <param name="autoDeleteOnIdle">ISO 8601 timespan idle interval
 /// after which the topic is automatically deleted. The minimum
 /// duration is 5 minutes.</param>
 /// <param name="enablePartitioning">Value that indicates whether the
 /// topic to be partitioned across multiple message brokers is
 /// enabled.</param>
 /// <param name="enableExpress">Value that indicates whether Express
 /// Entities are enabled. An express topic holds a message in memory
 /// temporarily before writing it to persistent storage.</param>
 public SBTopic(string id = default(string), string name = default(string), string type = default(string), long?sizeInBytes = default(long?), System.DateTime?createdAt = default(System.DateTime?), System.DateTime?updatedAt = default(System.DateTime?), System.DateTime?accessedAt = default(System.DateTime?), int?subscriptionCount = default(int?), MessageCountDetails countDetails = default(MessageCountDetails), System.TimeSpan?defaultMessageTimeToLive = default(System.TimeSpan?), int?maxSizeInMegabytes = default(int?), bool?requiresDuplicateDetection = default(bool?), System.TimeSpan?duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), bool?enableBatchedOperations = default(bool?), EntityStatus?status = default(EntityStatus?), bool?supportOrdering = default(bool?), System.TimeSpan?autoDeleteOnIdle = default(System.TimeSpan?), bool?enablePartitioning = default(bool?), bool?enableExpress = default(bool?))
     : base(id, name, type)
 {
     SizeInBytes                         = sizeInBytes;
     CreatedAt                           = createdAt;
     UpdatedAt                           = updatedAt;
     AccessedAt                          = accessedAt;
     SubscriptionCount                   = subscriptionCount;
     CountDetails                        = countDetails;
     DefaultMessageTimeToLive            = defaultMessageTimeToLive;
     MaxSizeInMegabytes                  = maxSizeInMegabytes;
     RequiresDuplicateDetection          = requiresDuplicateDetection;
     DuplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow;
     EnableBatchedOperations             = enableBatchedOperations;
     Status             = status;
     SupportOrdering    = supportOrdering;
     AutoDeleteOnIdle   = autoDeleteOnIdle;
     EnablePartitioning = enablePartitioning;
     EnableExpress      = enableExpress;
     CustomInit();
 }
 /// <summary>
 /// Initializes a new instance of the SBSubscription class.
 /// </summary>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="messageCount">Number of messages.</param>
 /// <param name="createdAt">Exact time the message was created.</param>
 /// <param name="accessedAt">Last time there was a receive request to
 /// this subscription.</param>
 /// <param name="updatedAt">The exact time the message was
 /// updated.</param>
 /// <param name="countDetails">Message count details</param>
 /// <param name="lockDuration">ISO 8061 lock duration timespan for the
 /// subscription. The default value is 1 minute.</param>
 /// <param name="requiresSession">Value indicating if a subscription
 /// supports the concept of sessions.</param>
 /// <param name="defaultMessageTimeToLive">ISO 8061 Default message
 /// timespan to live value. This is the duration after which the
 /// message expires, starting from when the message is sent to Service
 /// Bus. This is the default value used when TimeToLive is not set on a
 /// message itself.</param>
 /// <param name="deadLetteringOnFilterEvaluationExceptions">Value that
 /// indicates whether a subscription has dead letter support on filter
 /// evaluation exceptions.</param>
 /// <param name="deadLetteringOnMessageExpiration">Value that indicates
 /// whether a subscription has dead letter support when a message
 /// expires.</param>
 /// <param name="duplicateDetectionHistoryTimeWindow">ISO 8601 timeSpan
 /// structure that defines the duration of the duplicate detection
 /// history. The default value is 10 minutes.</param>
 /// <param name="maxDeliveryCount">Number of maximum
 /// deliveries.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of a messaging entity. Possible values include: 'Active',
 /// 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled',
 /// 'Creating', 'Deleting', 'Renaming', 'Unknown'</param>
 /// <param name="enableBatchedOperations">Value that indicates whether
 /// server-side batched operations are enabled.</param>
 /// <param name="autoDeleteOnIdle">ISO 8061 timeSpan idle interval
 /// after which the topic is automatically deleted. The minimum
 /// duration is 5 minutes.</param>
 /// <param name="forwardTo">Queue/Topic name to forward the
 /// messages</param>
 /// <param name="forwardDeadLetteredMessagesTo">Queue/Topic name to
 /// forward the Dead Letter message</param>
 public SBSubscription(string id = default(string), string name = default(string), string type = default(string), long?messageCount = default(long?), System.DateTime?createdAt = default(System.DateTime?), System.DateTime?accessedAt = default(System.DateTime?), System.DateTime?updatedAt = default(System.DateTime?), MessageCountDetails countDetails = default(MessageCountDetails), System.TimeSpan?lockDuration = default(System.TimeSpan?), bool?requiresSession = default(bool?), System.TimeSpan?defaultMessageTimeToLive = default(System.TimeSpan?), bool?deadLetteringOnFilterEvaluationExceptions = default(bool?), bool?deadLetteringOnMessageExpiration = default(bool?), System.TimeSpan?duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), int?maxDeliveryCount = default(int?), EntityStatus?status = default(EntityStatus?), bool?enableBatchedOperations = default(bool?), System.TimeSpan?autoDeleteOnIdle = default(System.TimeSpan?), string forwardTo = default(string), string forwardDeadLetteredMessagesTo = default(string))
     : base(id, name, type)
 {
     MessageCount             = messageCount;
     CreatedAt                = createdAt;
     AccessedAt               = accessedAt;
     UpdatedAt                = updatedAt;
     CountDetails             = countDetails;
     LockDuration             = lockDuration;
     RequiresSession          = requiresSession;
     DefaultMessageTimeToLive = defaultMessageTimeToLive;
     DeadLetteringOnFilterEvaluationExceptions = deadLetteringOnFilterEvaluationExceptions;
     DeadLetteringOnMessageExpiration          = deadLetteringOnMessageExpiration;
     DuplicateDetectionHistoryTimeWindow       = duplicateDetectionHistoryTimeWindow;
     MaxDeliveryCount              = maxDeliveryCount;
     Status                        = status;
     EnableBatchedOperations       = enableBatchedOperations;
     AutoDeleteOnIdle              = autoDeleteOnIdle;
     ForwardTo                     = forwardTo;
     ForwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo;
     CustomInit();
 }
Пример #17
0
 internal ServiceBusSubscriptionData(ResourceIdentifier id, string name, ResourceType type, SystemData systemData, long?messageCount, DateTimeOffset?createdAt, DateTimeOffset?accessedAt, DateTimeOffset?updatedAt, MessageCountDetails countDetails, TimeSpan?lockDuration, bool?requiresSession, TimeSpan?defaultMessageTimeToLive, bool?deadLetteringOnFilterEvaluationExceptions, bool?deadLetteringOnMessageExpiration, TimeSpan?duplicateDetectionHistoryTimeWindow, int?maxDeliveryCount, EntityStatus?status, bool?enableBatchedOperations, TimeSpan?autoDeleteOnIdle, string forwardTo, string forwardDeadLetteredMessagesTo, bool?isClientAffine, ServiceBusClientAffineProperties clientAffineProperties) : base(id, name, type, systemData)
 {
     MessageCount             = messageCount;
     CreatedAt                = createdAt;
     AccessedAt               = accessedAt;
     UpdatedAt                = updatedAt;
     CountDetails             = countDetails;
     LockDuration             = lockDuration;
     RequiresSession          = requiresSession;
     DefaultMessageTimeToLive = defaultMessageTimeToLive;
     DeadLetteringOnFilterEvaluationExceptions = deadLetteringOnFilterEvaluationExceptions;
     DeadLetteringOnMessageExpiration          = deadLetteringOnMessageExpiration;
     DuplicateDetectionHistoryTimeWindow       = duplicateDetectionHistoryTimeWindow;
     MaxDeliveryCount              = maxDeliveryCount;
     Status                        = status;
     EnableBatchedOperations       = enableBatchedOperations;
     AutoDeleteOnIdle              = autoDeleteOnIdle;
     ForwardTo                     = forwardTo;
     ForwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo;
     IsClientAffine                = isClientAffine;
     ClientAffineProperties        = clientAffineProperties;
 }
Пример #18
0
        public Bundle[] GetIncoming(string ownerName, EntityStatus?status)
        {
            if (string.IsNullOrEmpty(ownerName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                IEnumerable <Bundle> matches;
                if (status == null)
                {
                    matches = db.Bundles.GetIncoming(ownerName);
                }
                else
                {
                    matches = db.Bundles.GetIncoming(ownerName, status.Value);
                }

                return(matches.ToArray());
            }
        }
Пример #19
0
 public Address[] Get(string[] emailAddresses, bool domainSearchEnabled, EntityStatus?status)
 {
     using (ConfigDatabase db = this.Store.CreateReadContext())
     {
         Address[] addresses = this.Get(db, emailAddresses, status).ToArray();
         if (domainSearchEnabled)
         {
             List <Address> addressList = new List <Address>();
             foreach (var emailAddress in emailAddresses)
             {
                 string  enclosureEmailAddress = emailAddress;
                 Address existingAddress       = addresses.SingleOrDefault(a => a.EmailAddress.Equals(enclosureEmailAddress, StringComparison.OrdinalIgnoreCase));
                 if (existingAddress != null)
                 {
                     addressList.Add(existingAddress);
                     continue;
                 }
                 AutoMapDomains(enclosureEmailAddress, addressList, status);
             }
             return(addressList.ToArray());
         }
         return(addresses);
     }
 }
Пример #20
0
 internal EventHubData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string location, IReadOnlyList <string> partitionIds, DateTimeOffset?createdAt, DateTimeOffset?updatedAt, long?messageRetentionInDays, long?partitionCount, EntityStatus?status, CaptureDescription captureDescription) : base(id, name, resourceType, systemData, location)
 {
     PartitionIds           = partitionIds;
     CreatedAt              = createdAt;
     UpdatedAt              = updatedAt;
     MessageRetentionInDays = messageRetentionInDays;
     PartitionCount         = partitionCount;
     Status             = status;
     CaptureDescription = captureDescription;
 }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the SBQueue class.
 /// </summary>
 /// <param name="id">Resource Id</param>
 /// <param name="name">Resource name</param>
 /// <param name="type">Resource type</param>
 /// <param name="countDetails">Message Count Details.</param>
 /// <param name="createdAt">The exact time the message was
 /// created.</param>
 /// <param name="updatedAt">The exact time the message was
 /// updated.</param>
 /// <param name="accessedAt">Last time a message was sent, or the last
 /// time there was a receive request to this queue.</param>
 /// <param name="sizeInBytes">The size of the queue, in bytes.</param>
 /// <param name="messageCount">The number of messages in the
 /// queue.</param>
 /// <param name="lockDuration">ISO 8601 timespan duration of a
 /// peek-lock; that is, the amount of time that the message is locked
 /// for other receivers. The maximum value for LockDuration is 5
 /// minutes; the default value is 1 minute.</param>
 /// <param name="maxSizeInMegabytes">The maximum size of the queue in
 /// megabytes, which is the size of memory allocated for the queue.
 /// Default is 1024.</param>
 /// <param name="maxMessageSizeInKilobytes">Maximum size (in KB) of the
 /// message payload that can be accepted by the queue. This property is
 /// only used in Premium today and default is 1024.</param>
 /// <param name="requiresDuplicateDetection">A value indicating if this
 /// queue requires duplicate detection.</param>
 /// <param name="requiresSession">A value that indicates whether the
 /// queue supports the concept of sessions.</param>
 /// <param name="defaultMessageTimeToLive">ISO 8601 default message
 /// timespan to live value. This is the duration after which the
 /// message expires, starting from when the message is sent to Service
 /// Bus. This is the default value used when TimeToLive is not set on a
 /// message itself.</param>
 /// <param name="deadLetteringOnMessageExpiration">A value that
 /// indicates whether this queue has dead letter support when a message
 /// expires.</param>
 /// <param name="duplicateDetectionHistoryTimeWindow">ISO 8601 timeSpan
 /// structure that defines the duration of the duplicate detection
 /// history. The default value is 10 minutes.</param>
 /// <param name="maxDeliveryCount">The maximum delivery count. A
 /// message is automatically deadlettered after this number of
 /// deliveries. default value is 10.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of a messaging entity. Possible values include: 'Active',
 /// 'Disabled', 'Restoring', 'SendDisabled', 'ReceiveDisabled',
 /// 'Creating', 'Deleting', 'Renaming', 'Unknown'</param>
 /// <param name="enableBatchedOperations">Value that indicates whether
 /// server-side batched operations are enabled.</param>
 /// <param name="autoDeleteOnIdle">ISO 8061 timeSpan idle interval
 /// after which the queue is automatically deleted. The minimum
 /// duration is 5 minutes.</param>
 /// <param name="enablePartitioning">A value that indicates whether the
 /// queue is to be partitioned across multiple message brokers.</param>
 /// <param name="enableExpress">A value that indicates whether Express
 /// Entities are enabled. An express queue holds a message in memory
 /// temporarily before writing it to persistent storage.</param>
 /// <param name="forwardTo">Queue/Topic name to forward the
 /// messages</param>
 /// <param name="forwardDeadLetteredMessagesTo">Queue/Topic name to
 /// forward the Dead Letter message</param>
 /// <param name="systemData">The system meta data relating to this
 /// resource.</param>
 public SBQueue(string id = default(string), string name = default(string), string type = default(string), MessageCountDetails countDetails = default(MessageCountDetails), System.DateTime?createdAt = default(System.DateTime?), System.DateTime?updatedAt = default(System.DateTime?), System.DateTime?accessedAt = default(System.DateTime?), long?sizeInBytes = default(long?), long?messageCount = default(long?), System.TimeSpan?lockDuration = default(System.TimeSpan?), int?maxSizeInMegabytes = default(int?), long?maxMessageSizeInKilobytes = default(long?), bool?requiresDuplicateDetection = default(bool?), bool?requiresSession = default(bool?), System.TimeSpan?defaultMessageTimeToLive = default(System.TimeSpan?), bool?deadLetteringOnMessageExpiration = default(bool?), System.TimeSpan?duplicateDetectionHistoryTimeWindow = default(System.TimeSpan?), int?maxDeliveryCount = default(int?), EntityStatus?status = default(EntityStatus?), bool?enableBatchedOperations = default(bool?), System.TimeSpan?autoDeleteOnIdle = default(System.TimeSpan?), bool?enablePartitioning = default(bool?), bool?enableExpress = default(bool?), string forwardTo = default(string), string forwardDeadLetteredMessagesTo = default(string), SystemData systemData = default(SystemData))
     : base(id, name, type)
 {
     CountDetails                        = countDetails;
     CreatedAt                           = createdAt;
     UpdatedAt                           = updatedAt;
     AccessedAt                          = accessedAt;
     SizeInBytes                         = sizeInBytes;
     MessageCount                        = messageCount;
     LockDuration                        = lockDuration;
     MaxSizeInMegabytes                  = maxSizeInMegabytes;
     MaxMessageSizeInKilobytes           = maxMessageSizeInKilobytes;
     RequiresDuplicateDetection          = requiresDuplicateDetection;
     RequiresSession                     = requiresSession;
     DefaultMessageTimeToLive            = defaultMessageTimeToLive;
     DeadLetteringOnMessageExpiration    = deadLetteringOnMessageExpiration;
     DuplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow;
     MaxDeliveryCount                    = maxDeliveryCount;
     Status = status;
     EnableBatchedOperations = enableBatchedOperations;
     AutoDeleteOnIdle        = autoDeleteOnIdle;
     EnablePartitioning      = enablePartitioning;
     EnableExpress           = enableExpress;
     ForwardTo = forwardTo;
     ForwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo;
     SystemData = systemData;
     CustomInit();
 }
Пример #22
0
        private void AutoMapDomains(string enclosureEmailAddress, List <Address> addressList, EntityStatus?status)
        {
            MailAddress mailAddress = new MailAddress(enclosureEmailAddress);
            Domain      domain      = Store.Domains.Get(mailAddress.Host);

            if (domain == null ||
                (status.HasValue && domain.Status != status)
                )
            {
                return;
            }
            var address = new Address(domain.ID, mailAddress);

            address.Type   = "SMTP";
            address.Status = domain.Status;
            addressList.Add(address);
        }
Пример #23
0
 public Address[] Get(string[] emailAddresses, EntityStatus?status)
 {
     return(Get(emailAddresses, false, status));
 }
 internal static string ToSerializedValue(this EntityStatus?value)
 {
     return(value == null ? null : ((EntityStatus)value).ToSerializedValue());
 }
 internal Eventhub(string id, string name, string type, IList <string> partitionIds, DateTimeOffset?createdAt, DateTimeOffset?updatedAt, long?messageRetentionInDays, long?partitionCount, EntityStatus?status, CaptureDescription captureDescription) : base(id, name, type)
 {
     PartitionIds           = partitionIds;
     CreatedAt              = createdAt;
     UpdatedAt              = updatedAt;
     MessageRetentionInDays = messageRetentionInDays;
     PartitionCount         = partitionCount;
     Status             = status;
     CaptureDescription = captureDescription;
 }
Пример #26
0
 internal void PushCerts(IEnumerable <X509Certificate2> certs, bool checkForDupes, EntityStatus?status)
 {
     foreach (X509Certificate2 cert in certs)
     {
         string owner = cert.ExtractEmailNameOrDnsName();
         try
         {
             if (!checkForDupes || !Client.Contains(cert))
             {
                 Certificate certEntry = new Certificate(owner, cert);
                 if (status != null)
                 {
                     certEntry.Status = status.Value;
                 }
                 Client.AddCertificate(certEntry);
                 WriteLine("Added {0}", cert.Subject);
             }
             else
             {
                 WriteLine("Exists {0}", cert.Subject);
             }
         }
         catch (FaultException <ConfigStoreFault> ex)
         {
             if (ex.Detail.Error == ConfigStoreError.UniqueConstraint)
             {
                 WriteLine("Exists {0}", cert.Subject);
             }
         }
     }
 }
 /// <summary>
 /// Initializes a new instance of the QueueInner class.
 /// </summary>
 /// <param name="lockDuration">The duration of a peek-lock; that is,
 /// the amount of time that the message is locked for other receivers.
 /// The maximum value for LockDuration is 5 minutes; the default value
 /// is 1 minute. The service accepts a C# Standard TimeSpan Format for
 /// loc duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx</param>
 /// <param name="accessedAt">Last time a message was sent, or the last
 /// time there was a receive request to this queue.</param>
 /// <param name="autoDeleteOnIdle">the TimeSpan idle interval after
 /// which the queue is automatically deleted. The minimum duration is 5
 /// minutes. The service accepts a C# Standard TimeSpan Format for loc
 /// duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx.
 /// Format is 'DD.HH:MM:SS' and default value of this property is
 /// 10675199 days.</param>
 /// <param name="createdAt">The exact time the Queue was
 /// created.</param>
 /// <param name="defaultMessageTimeToLive">The default message time to
 /// live value. This is the duration after which the message expires,
 /// starting from when the message is sent to Service Bus. This is the
 /// default value used when TimeToLive is not set on a message itself.
 /// Format is 'DD.HH:MM:SS' and default value of this property is
 /// 10675199 days. The service accepts a C# Standard TimeSpan Format
 /// for loc duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx
 /// </param>
 /// <param name="duplicateDetectionHistoryTimeWindow">TimeSpan
 /// structure that defines the duration of the duplicate detection
 /// history. The default value is 10 minutes. The service accepts a C#
 /// Standard TimeSpan Format for loc duration
 /// https://msdn.microsoft.com/en-us/library/ee372286(v=vs.110).aspx .
 /// Format is 'DD.HH:MM:SS' and default value of this property is
 /// 10675199 days</param>
 /// <param name="enableBatchedOperations">A value that indicates
 /// whether server-side batched operations are enabled.</param>
 /// <param name="deadLetteringOnMessageExpiration">A value that
 /// indicates whether this queue has dead letter support when a message
 /// expires.</param>
 /// <param name="enableExpress">A value that indicates whether Express
 /// Entities are enabled. An express queue holds a message in memory
 /// temporarily before writing it to persistent storage.</param>
 /// <param name="enablePartitioning">A value that indicates whether the
 /// queue is to be partitioned across multiple message brokers.</param>
 /// <param name="maxDeliveryCount">The maximum delivery count. A
 /// message is automatically deadlettered after this number of
 /// deliveries.</param>
 /// <param name="maxSizeInMegabytes">The maximum size of the queue in
 /// megabytes, which is the size of memory allocated for the
 /// queue.</param>
 /// <param name="messageCount">The number of messages in the
 /// queue.</param>
 /// <param name="requiresDuplicateDetection">A value indicating if this
 /// queue requires duplicate detection.</param>
 /// <param name="requiresSession">A value that indicates whether the
 /// queue supports the concept of sessions.</param>
 /// <param name="sizeInBytes">The size of the queue, in bytes.</param>
 /// <param name="status">Enumerates the possible values for the status
 /// of a messaging entity. Possible values include: 'Active',
 /// 'Creating', 'Deleting', 'Disabled', 'ReceiveDisabled', 'Renaming',
 /// 'Restoring', 'SendDisabled', 'Unknown'</param>
 /// <param name="supportOrdering">A value that indicates whether the
 /// queue supports ordering.</param>
 /// <param name="updatedAt">The exact time the Queue was
 /// updated.</param>
 public QueueInner(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary <string, string> tags = default(IDictionary <string, string>), string lockDuration = default(string), System.DateTime?accessedAt = default(System.DateTime?), string autoDeleteOnIdle = default(string), System.DateTime?createdAt = default(System.DateTime?), string defaultMessageTimeToLive = default(string), string duplicateDetectionHistoryTimeWindow = default(string), bool?enableBatchedOperations = default(bool?), bool?deadLetteringOnMessageExpiration = default(bool?), bool?enableExpress = default(bool?), bool?enablePartitioning = default(bool?), int?maxDeliveryCount = default(int?), long?maxSizeInMegabytes = default(long?), long?messageCount = default(long?), MessageCountDetails countDetails = default(MessageCountDetails), bool?requiresDuplicateDetection = default(bool?), bool?requiresSession = default(bool?), long?sizeInBytes = default(long?), EntityStatus?status = default(EntityStatus?), bool?supportOrdering = default(bool?), System.DateTime?updatedAt = default(System.DateTime?))
     : base(location, id, name, type, tags)
 {
     LockDuration                        = lockDuration;
     AccessedAt                          = accessedAt;
     AutoDeleteOnIdle                    = autoDeleteOnIdle;
     CreatedAt                           = createdAt;
     DefaultMessageTimeToLive            = defaultMessageTimeToLive;
     DuplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow;
     EnableBatchedOperations             = enableBatchedOperations;
     DeadLetteringOnMessageExpiration    = deadLetteringOnMessageExpiration;
     EnableExpress                       = enableExpress;
     EnablePartitioning                  = enablePartitioning;
     MaxDeliveryCount                    = maxDeliveryCount;
     MaxSizeInMegabytes                  = maxSizeInMegabytes;
     MessageCount                        = messageCount;
     CountDetails                        = countDetails;
     RequiresDuplicateDetection          = requiresDuplicateDetection;
     RequiresSession                     = requiresSession;
     SizeInBytes                         = sizeInBytes;
     Status          = status;
     SupportOrdering = supportOrdering;
     UpdatedAt       = updatedAt;
     CustomInit();
 }
Пример #28
0
 internal ServiceBusQueueData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, MessageCountDetails countDetails, DateTimeOffset?createdAt, DateTimeOffset?updatedAt, DateTimeOffset?accessedAt, long?sizeInBytes, long?messageCount, TimeSpan?lockDuration, int?maxSizeInMegabytes, long?maxMessageSizeInKilobytes, bool?requiresDuplicateDetection, bool?requiresSession, TimeSpan?defaultMessageTimeToLive, bool?deadLetteringOnMessageExpiration, TimeSpan?duplicateDetectionHistoryTimeWindow, int?maxDeliveryCount, EntityStatus?status, bool?enableBatchedOperations, TimeSpan?autoDeleteOnIdle, bool?enablePartitioning, bool?enableExpress, string forwardTo, string forwardDeadLetteredMessagesTo) : base(id, name, resourceType, systemData)
 {
     CountDetails                        = countDetails;
     CreatedAt                           = createdAt;
     UpdatedAt                           = updatedAt;
     AccessedAt                          = accessedAt;
     SizeInBytes                         = sizeInBytes;
     MessageCount                        = messageCount;
     LockDuration                        = lockDuration;
     MaxSizeInMegabytes                  = maxSizeInMegabytes;
     MaxMessageSizeInKilobytes           = maxMessageSizeInKilobytes;
     RequiresDuplicateDetection          = requiresDuplicateDetection;
     RequiresSession                     = requiresSession;
     DefaultMessageTimeToLive            = defaultMessageTimeToLive;
     DeadLetteringOnMessageExpiration    = deadLetteringOnMessageExpiration;
     DuplicateDetectionHistoryTimeWindow = duplicateDetectionHistoryTimeWindow;
     MaxDeliveryCount                    = maxDeliveryCount;
     Status = status;
     EnableBatchedOperations = enableBatchedOperations;
     AutoDeleteOnIdle        = autoDeleteOnIdle;
     EnablePartitioning      = enablePartitioning;
     EnableExpress           = enableExpress;
     ForwardTo = forwardTo;
     ForwardDeadLetteredMessagesTo = forwardDeadLetteredMessagesTo;
 }
Пример #29
0
        public static IQueryable <Deposit> GetDeposits(this HSBorsDb db, long?unit_cost_id = null, long?account_id = null, EntityStatus?status = null, long?id = null, long?fund_id = null)
        {
            var query = db.Deposits.AsQueryable();

            if (unit_cost_id.HasValue)
            {
                query = query.Where(item => item.unit_cost_id == unit_cost_id);
            }
            if (account_id.HasValue)
            {
                query = query.Where(item => item.account_id == account_id);
            }
            if (status.HasValue)
            {
                query = query.Where(item => item.status == status);
            }
            if (id.HasValue)
            {
                query = query.Where(item => item.id == id);
            }
            if (fund_id.HasValue)
            {
                query = query.Where(item => item.account.fund_id == fund_id);
            }
            return(query.OrderByDescending(x => x.date));
        }
Пример #30
0
        public static IQueryable <Account> GetAccounts(this HSBorsDb db, long?id = null, long?fund_id = null, EntityStatus?status = null)
        {
            var query = db.Accounts.AsQueryable();

            if (id.HasValue)
            {
                query = query.Where(item => item.id == id);
            }
            if (status.HasValue)
            {
                query = query.Where(item => item.status == status);
            }
            if (fund_id.HasValue)
            {
                query = query.Where(item => item.fund_id == fund_id);
            }

            return(query);
        }