Ejemplo 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);
            }
        }
Ejemplo 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());
            }
        }
Ejemplo 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);
            }
        }
Ejemplo 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);
            }
        }
Ejemplo 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);
 }
Ejemplo 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();
     }
 }
Ejemplo 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));
        }
Ejemplo 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);
        }
Ejemplo 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());
            }
        }
Ejemplo 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();
            }
        }
Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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();
            }
        }
Ejemplo 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());
        }
Ejemplo 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());
            }
        }
Ejemplo 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());
        }
Ejemplo 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();
            }
        }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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));
        }
Ejemplo 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());
            }
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo 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);
        }
Ejemplo 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));
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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());
     }
 }