コード例 #1
0
ファイル: AnchorManager.cs プロジェクト: blinds52/nhind
        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);
            }
        }
コード例 #2
0
ファイル: AnchorManager.cs プロジェクト: blinds52/nhind
        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());
            }
        }
コード例 #3
0
ファイル: AnchorManager.cs プロジェクト: blinds52/nhind
        public void Remove(string ownerName)
        {
            if (string.IsNullOrEmpty(ownerName))
            {
                throw new ConfigStoreException(ConfigStoreError.InvalidOwnerName);
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Remove(db, ownerName);
            }
        }
コード例 #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);
            }
        }
コード例 #5
0
ファイル: NamedBlobManager.cs プロジェクト: blinds52/nhind
 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);
 }
コード例 #6
0
ファイル: MXManager.cs プロジェクト: blinds52/nhind
 public void Add(long domainID
                 , string SMTPName
                 , int preference)
 {
     using (ConfigDatabase db = this.Store.CreateContext())
     {
         this.Add(db
                  , domainID
                  , SMTPName
                  , preference);
         db.SubmitChanges();
     }
 }
コード例 #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));
        }
コード例 #8
0
ファイル: AnchorManager.cs プロジェクト: blinds52/nhind
        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);
        }
コード例 #9
0
ファイル: DnsRecordManager.cs プロジェクト: ywangmaxmd/nhin-d
        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());
            }
        }
コード例 #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();
            }
        }
コード例 #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);
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #14
0
ファイル: NamedBlobManager.cs プロジェクト: blinds52/nhind
        public void Add(NamedBlob blob)
        {
            if (blob == null)
            {
                throw new ArgumentNullException("blob");
            }

            using (ConfigDatabase db = this.Store.CreateContext())
            {
                this.Add(db, blob);
                db.SubmitChanges();
            }
        }
コード例 #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());
        }
コード例 #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());
            }
        }
コード例 #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());
        }
コード例 #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();
            }
        }
コード例 #19
0
ファイル: NamedBlobManager.cs プロジェクト: blinds52/nhind
        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));
        }
コード例 #20
0
ファイル: MdnManager.cs プロジェクト: blinds52/nhind
        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));
        }
コード例 #21
0
ファイル: CertPolicyManager.cs プロジェクト: blinds52/nhind
        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));
        }
コード例 #22
0
ファイル: CertPolicyManager.cs プロジェクト: blinds52/nhind
        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());
            }
        }
コード例 #23
0
ファイル: BundleManager.cs プロジェクト: ywangmaxmd/nhin-d
        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);
        }
コード例 #24
0
ファイル: BundleManager.cs プロジェクト: ywangmaxmd/nhin-d
        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);
        }
コード例 #25
0
ファイル: BundleManager.cs プロジェクト: ywangmaxmd/nhin-d
        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));
        }
コード例 #26
0
ファイル: DnsRecordManager.cs プロジェクト: ywangmaxmd/nhin-d
        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);
        }
コード例 #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));
        }
コード例 #28
0
ファイル: MdnManager.cs プロジェクト: blinds52/nhind
        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);
        }
コード例 #29
0
ファイル: MdnManager.cs プロジェクト: blinds52/nhind
        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);
        }
コード例 #30
0
ファイル: DnsRecordManager.cs プロジェクト: ywangmaxmd/nhin-d
 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());
     }
 }