void CreateClients() { m_domainClient = m_settings.DomainManager.CreateDomainManagerClient(); m_addressClient = m_settings.AddressManager.CreateAddressManagerClient() as AddressManagerClient; m_certificateClient = m_settings.CertificateManager.CreateCertificateStoreClient(); m_dnsRecordClient = m_settings.DnsRecordManager.CreateDnsRecordManagerClient(); m_anchorClient = m_settings.AnchorManager.CreateAnchorStoreClient(); m_bundleClient = m_settings.BundleManager.CreateBundleStoreClient(); if (m_settings.PropertyManager != null) { m_propertyClient = m_settings.PropertyManager.CreatePropertyManagerClient() as PropertyManagerClient; } if (m_settings.BlobManager != null) { m_blobClient = m_settings.BlobManager.CreateBlobManagerClient(); } if (m_settings.MdnMonitorManager != null) { m_mdnMoniotrClient = m_settings.MdnMonitorManager.CreateMdnMonitorClient() as MdnMonitorClient; } if (m_settings.CertPolicyManager != null) { m_certPolicyClient = m_settings.CertPolicyManager.CreateCertPolicyStoreClient() as CertPolicyStoreClient; } }
private void SetupServices() { using (StringReader reader = new StringReader(BundleClientSettingsXml)) { XmlSerializer serializer = new XmlSerializer(typeof(ClientSettings)); m_clientSettings = (ClientSettings)serializer.Deserialize(reader); m_client = new BundleStoreClient(m_clientSettings.Binding, m_clientSettings.Endpoint); } using (StringReader reader2 = new StringReader(BundleResolverSettingsXml)) { XmlSerializer serializer = new XmlSerializer(typeof(BundleResolverSettings)); m_bundleResolverSettings = (BundleResolverSettings)serializer.Deserialize(reader2); m_bundleResolver = m_bundleResolverSettings.CreateResolver(); } }
private Bundle[] GetBundlesForSubject(string subjectName) { Bundle[] bundles = null; using (BundleStoreClient client = this.CreateClient()) { if (m_incoming) { bundles = client.GetIncomingBundles(subjectName, EntityStatus.Enabled); } else { bundles = client.GetOutgoingBundles(subjectName, EntityStatus.Enabled); } } return(bundles); }
public static Bundle GetExistingBundle(this BundleStoreClient client, string owner, string url) { if (string.IsNullOrEmpty(owner)) { throw new ArgumentException("owner"); } if (string.IsNullOrEmpty(url)) { throw new ArgumentException("url"); } Bundle[] bundles = client.GetBundlesForOwner(owner); if (bundles.IsNullOrEmpty()) { return(null); } return(bundles.FirstOrDefault((b) => (!string.IsNullOrEmpty(b.Url) && b.Url.Equals(url, StringComparison.OrdinalIgnoreCase)))); }
public static IEnumerable <Bundle> EnumerateBundles(this BundleStoreClient client, int chunkSize) { if (chunkSize < 1) { throw new ArgumentException("value was less than 1", "chunkSize"); } long lastID = -1; Bundle[] bundles; while (true) { bundles = client.EnumerateBundles(lastID, chunkSize); if (bundles == null || bundles.Length == 0) { yield break; } for (int i = 0; i < bundles.Length; ++i) { yield return(bundles[i]); } lastID = bundles[bundles.Length - 1].ID; } }