Esempio n. 1
0
        public void SetStatus(string owner, EntityStatus status)
        {
            if (string.IsNullOrEmpty(owner))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.SetStatus(db, owner, status);
            }
        }
Esempio n. 2
0
        public Anchor[] Get(long[] certificateIDs)
        {
            if (certificateIDs.IsNullOrEmpty())
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidIDs);
            }

            using (ConfigDatabase db = this.Store.CreateReadContext())
            {
                return(db.Anchors.Get(certificateIDs).ToArray());
            }
        }
Esempio n. 3
0
        public void Remove(string ownerName)
        {
            if (string.IsNullOrEmpty(ownerName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Remove(db, ownerName);
            }
        }
Esempio n. 4
0
        public void Remove(string name)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("name");
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Remove(db, name);
            }
        }
Esempio n. 5
0
 public void Add(ConfigDatabase db, NamedBlob blob)
 {
     if (db == null)
     {
         throw new ArgumentNullException("db");
     }
     if (blob == null)
     {
         throw new ArgumentNullException("blob");
     }
     db.Blobs.InsertOnSubmit(blob);
 }
Esempio n. 6
0
 public void Add(long domainID
                 , string SMTPName
                 , int preference)
 {
     using (ConfigDatabase db = this.Store.CreateContext())
     {
         this.Add(db
                  , domainID
                  , SMTPName
                  , preference);
         db.SubmitChanges();
     }
 }
Esempio n. 7
0
        public Domain Get(ConfigDatabase db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidDomainName);
            }

            return(db.Domains.Get(name));
        }
Esempio n. 8
0
        public void Add(ConfigDatabase db, Anchor anchor)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (anchor == null)
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidAnchor);
            }

            db.Anchors.InsertOnSubmit(anchor);
        }
Esempio n. 9
0
        public DnsRecord[] Get(string domainName)
        {
            if (string.IsNullOrEmpty(domainName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidDomainName);
            }

            using (ConfigDatabase db = this.Store.CreateReadContext())
            {
                return(this.Get(db
                                , domainName).ToArray());
            }
        }
Esempio n. 10
0
        public void Add(Property property)
        {
            if (property == null)
            {
                throw new ArgumentNullException("property");
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Add(db, property);
                db.SubmitChanges();
            }
        }
Esempio n. 11
0
        public void Remove(ConfigDatabase db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("name");
            }

            db.Properties.ExecDelete(name);
        }
Esempio n. 12
0
        public IEnumerable <Property> GetStartsWith(ConfigDatabase db, string namePrefix)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(namePrefix))
            {
                throw new ArgumentException("name");
            }

            return(db.Properties.GetNameStartsWith(namePrefix));
        }
Esempio n. 13
0
        public IEnumerable <Property> Get(ConfigDatabase db, string[] names)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (names.IsNullOrEmpty())
            {
                throw new ArgumentException("names");
            }

            return(db.Properties.Get(names));
        }
Esempio n. 14
0
        public void Add(NamedBlob blob)
        {
            if (blob == null)
            {
                throw new ArgumentNullException("blob");
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Add(db, blob);
                db.SubmitChanges();
            }
        }
Esempio n. 15
0
        public Property Get(ConfigDatabase db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("name");
            }

            return(db.Properties.Get(name).SingleOrDefault());
        }
Esempio n. 16
0
        public CertPolicyGroup[] GetByDomains(string[] owners)
        {
            if (owners.IsNullOrEmpty())
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            using (ConfigDatabase db = this.Store.CreateReadContext())
            {
                var cpgs = db.CertPolicyGroups.GetByOwners(owners);
                return(cpgs.ToArray());
            }
        }
Esempio n. 17
0
        public CertPolicyGroupDomainMap[] GetWithOwners(ConfigDatabase db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidCertPolicyGroupName);
            }

            return(db.CertPolicyGroups.GetWithOwners(name).ToArray());
        }
Esempio n. 18
0
        /// <summary>
        /// Add a new email address
        /// </summary>
        /// <remarks>
        ///  - Gets the domain of the address and ensures that it exists
        ///  - Then tries to create an entry in the Address table
        ///  - The address is created in the given state
        /// </remarks>
        /// <param name="mailAddress">Mail address object</param>
        /// <param name="status">entity status</param>
        /// <param name="addressType"></param>
        public void Add(MailAddress mailAddress, EntityStatus status, string addressType)
        {
            if (mailAddress == null)
            {
                throw new ArgumentNullException("mailAddress");
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Add(db, mailAddress, status, addressType);
                db.SubmitChanges();
            }
        }
Esempio n. 19
0
        public IEnumerable <NamedBlob> GetNameStartsWith(ConfigDatabase db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("name");
            }

            return(db.Blobs.GetNameStartsWith(name));
        }
Esempio n. 20
0
        public Mdn Get(ConfigDatabase db, string mdnIdentifier)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(mdnIdentifier))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidMdnIdentifier);
            }

            return(db.Mdns.Get(mdnIdentifier));
        }
Esempio n. 21
0
        public CertPolicy Get(ConfigDatabase db, string name)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(name))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidCertPolicyName);
            }

            return(db.CertPolicies.Get(name));
        }
Esempio n. 22
0
        public CertPolicy[] GetOutgoingByOwner(string owner, CertPolicyUse use)
        {
            if (string.IsNullOrEmpty(owner))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            using (ConfigDatabase db = this.Store.CreateReadContext())
            {
                var cpgs = db.CertPolicies.GetOutgoing(owner, use);
                return(cpgs.ToArray());
            }
        }
Esempio n. 23
0
        public void Add(ConfigDatabase db, Bundle bundle)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (bundle == null)
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidBundle);
            }

            db.Bundles.InsertOnSubmit(bundle);
        }
Esempio n. 24
0
        public void Remove(ConfigDatabase db, string ownerName)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(ownerName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            db.Bundles.ExecDelete(ownerName);
        }
Esempio n. 25
0
        public IEnumerable <Bundle> Get(ConfigDatabase db, string owner)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }
            if (string.IsNullOrEmpty(owner))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            return(db.Bundles.Get(owner));
        }
Esempio n. 26
0
        public void Add(ConfigDatabase db, DnsRecord record)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (record == null)
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidDnsRecord);
            }
            db.DnsRecords.InsertOnSubmit(record);
        }
Esempio n. 27
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));
        }
Esempio n. 28
0
        public void Update(ConfigDatabase db, Mdn mdn)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (mdn == null)
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidMdn);
            }

            db.Mdns.InsertOnSubmit(mdn);
        }
Esempio n. 29
0
        public void TimeOut(ConfigDatabase db, Mdn mdn)
        {
            if (db == null)
            {
                throw new ArgumentNullException("db");
            }

            if (mdn == null)
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidMdn);
            }
            mdn.Status = MdnStatus.TimedOut;
            db.Mdns.InsertOnSubmit(mdn);
        }
Esempio n. 30
0
 public DnsRecord[] Get(string domainName
                        , Common.DnsResolver.DnsStandard.RecordType typeID)
 {
     if (string.IsNullOrEmpty(domainName))
     {
         throw new ConfigStoreException(ConfigStoreError.InvalidDomainName);
     }
     using (ConfigDatabase db = this.Store.CreateReadContext())
     {
         return(this.Get(db
                         , domainName
                         , typeID).ToArray());
     }
 }