protected static void ThrowIfInvalidNamespace(Namespace[] ns)
 {
     foreach (Namespace ns2 in ns)
     {
         LocatorServiceClientAdapter.ThrowIfInvalidNamespace(ns2);
     }
 }
Esempio n. 2
0
        internal static FindDomainsRequest ConstructFindDomainsRequest(IEnumerable <SmtpDomain> domains, DomainProperty[] domainProperties, TenantProperty[] tenantProperties, GlsAPIReadFlag readFlag)
        {
            LocatorServiceClientAdapter.ThrowIfNull(domains, "domains");
            LocatorServiceClientAdapter.ThrowIfNull(domainProperties, "domainProperties");
            LocatorServiceClientAdapter.ThrowIfNull(tenantProperties, "tenantProperties");
            FindDomainsRequest findDomainsRequest = new FindDomainsRequest();

            findDomainsRequest.ReadFlag    = (int)readFlag;
            findDomainsRequest.DomainsName = (from domain in domains
                                              select domain.Domain).ToArray <string>();
            findDomainsRequest.DomainPropertyNames = LocatorServiceClientReader.GetPropertyNames(domainProperties);
            findDomainsRequest.TenantPropertyNames = LocatorServiceClientReader.GetPropertyNames(tenantProperties);
            return(findDomainsRequest);
        }
Esempio n. 3
0
 internal static FindTenantRequest ConstructFindTenantRequest(Guid tenantId, TenantProperty[] tenantProperties, GlsAPIReadFlag readFlag)
 {
     LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
     LocatorServiceClientAdapter.ThrowIfNull(tenantProperties, "tenantProperties");
     return(new FindTenantRequest
     {
         ReadFlag = (int)readFlag,
         Tenant = new TenantQuery
         {
             TenantId = tenantId,
             PropertyNames = LocatorServiceClientReader.GetPropertyNames(tenantProperties)
         }
     });
 }
 // Token: 0x06000C58 RID: 3160 RVA: 0x00037F3C File Offset: 0x0003613C
 internal static DeleteTenantRequest ConstructDeleteTenantRequest(Guid tenantId, Namespace ns)
 {
     LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
     LocatorServiceClientAdapter.ThrowIfInvalidNamespace(ns);
     return(new DeleteTenantRequest
     {
         Tenant = new TenantQuery
         {
             TenantId = tenantId,
             PropertyNames = new string[]
             {
                 NamespaceUtil.NamespaceWildcard(ns)
             }
         }
     });
 }
Esempio n. 5
0
        internal static FindDomainRequest ConstructDomainExistsRequest(SmtpDomain domain, Namespace[] ns, GlsAPIReadFlag readFlag)
        {
            LocatorServiceClientAdapter.ThrowIfNull(domain, "domain");
            LocatorServiceClientAdapter.ThrowIfInvalidNamespace(ns);
            FindDomainRequest findDomainRequest = new FindDomainRequest();

            findDomainRequest.ReadFlag = (int)readFlag;
            string[] propertyNames = (from item in ns
                                      select NamespaceUtil.NamespaceWildcard(item)).ToArray <string>();
            findDomainRequest.Domain = new DomainQuery
            {
                DomainName    = domain.Domain,
                PropertyNames = propertyNames
            };
            return(findDomainRequest);
        }
Esempio n. 6
0
        internal static FindTenantRequest ConstructTenantExistsRequest(Guid tenantId, Namespace[] ns, GlsAPIReadFlag readFlag)
        {
            LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
            LocatorServiceClientAdapter.ThrowIfInvalidNamespace(ns);
            FindTenantRequest findTenantRequest = new FindTenantRequest();

            findTenantRequest.ReadFlag = (int)readFlag;
            string[] propertyNames = (from item in ns
                                      select NamespaceUtil.NamespaceWildcard(item)).ToArray <string>();
            findTenantRequest.Tenant = new TenantQuery
            {
                TenantId      = tenantId,
                PropertyNames = propertyNames
            };
            return(findTenantRequest);
        }
Esempio n. 7
0
 internal static FindDomainRequest ConstructFindDomainRequest(SmtpDomain domain, DomainProperty[] domainProperties, TenantProperty[] tenantProperties, GlsAPIReadFlag readFlag)
 {
     LocatorServiceClientAdapter.ThrowIfNull(domain, "domain");
     LocatorServiceClientAdapter.ThrowIfNull(domainProperties, "domainProperties");
     LocatorServiceClientAdapter.ThrowIfNull(tenantProperties, "tenantProperties");
     return(new FindDomainRequest
     {
         ReadFlag = (int)readFlag,
         Domain = new DomainQuery
         {
             DomainName = domain.Domain,
             PropertyNames = LocatorServiceClientReader.GetPropertyNames(domainProperties)
         },
         Tenant = new TenantQuery
         {
             PropertyNames = LocatorServiceClientReader.GetPropertyNames(tenantProperties)
         }
     });
 }
 // Token: 0x06000C56 RID: 3158 RVA: 0x00037DE4 File Offset: 0x00035FE4
 internal static SaveTenantRequest ConstructSaveTenantRequest(Guid tenantId, KeyValuePair <TenantProperty, PropertyValue>[] properties)
 {
     LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
     LocatorServiceClientAdapter.ThrowIfNull(properties, "properties");
     foreach (KeyValuePair <TenantProperty, PropertyValue> keyValuePair in properties)
     {
         if (keyValuePair.Key.DataType != keyValuePair.Value.DataType)
         {
             throw new ArgumentException("key and value have different data types!", "properties");
         }
     }
     return(new SaveTenantRequest
     {
         TenantInfo = new TenantInfo
         {
             TenantId = tenantId,
             Properties = LocatorServiceClientWriter.GetPropertyValues(properties)
         }
     });
 }
 // Token: 0x06000C5A RID: 3162 RVA: 0x00037F98 File Offset: 0x00036198
 internal static DeleteDomainRequest ConstructDeleteDomainRequest(SmtpDomain domain, Guid tenantId, Namespace ns, bool skipTenantCheck)
 {
     LocatorServiceClientAdapter.ThrowIfNull(domain, "domain");
     if (!skipTenantCheck)
     {
         LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
     }
     LocatorServiceClientAdapter.ThrowIfInvalidNamespace(ns);
     return(new DeleteDomainRequest
     {
         TenantId = tenantId,
         Domain = new DomainQuery
         {
             DomainName = domain.Domain,
             PropertyNames = new string[]
             {
                 NamespaceUtil.NamespaceWildcard(ns)
             }
         }
     });
 }
        internal LocatorServiceClientAdapter(GlsCallerId glsCallerId)
        {
            this.requestIdentity = new RequestIdentity
            {
                CallerId     = glsCallerId.CallerIdString,
                TrackingGuid = glsCallerId.TrackingGuid
            };
            WSHttpBinding wshttpBinding = new WSHttpBinding(SecurityMode.Transport)
            {
                ReceiveTimeout         = TimeSpan.FromSeconds(20.0),
                SendTimeout            = TimeSpan.FromSeconds(15.0),
                MaxBufferPoolSize      = 524288L,
                MaxReceivedMessageSize = 65536L
            };

            wshttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Certificate;
            ServiceEndpoint serviceEndpoint = LocatorServiceClientAdapter.LoadServiceEndpoint();

            this.serviceProxyPool = new ServiceProxyPool <LocatorService>(wshttpBinding, serviceEndpoint);
            this.endpointHostName = serviceEndpoint.Uri.Host;
        }
 // Token: 0x06000C57 RID: 3159 RVA: 0x00037E80 File Offset: 0x00036080
 internal static SaveDomainRequest ConstructSaveDomainRequest(SmtpDomain domain, string domainKey, Guid tenantId, KeyValuePair <DomainProperty, PropertyValue>[] properties)
 {
     LocatorServiceClientAdapter.ThrowIfEmptyGuid(tenantId, "tenantId");
     LocatorServiceClientAdapter.ThrowIfNull(domain, "domain");
     LocatorServiceClientAdapter.ThrowIfNull(properties, "properties");
     foreach (KeyValuePair <DomainProperty, PropertyValue> keyValuePair in properties)
     {
         if (keyValuePair.Key.DataType != keyValuePair.Value.DataType)
         {
             throw new ArgumentException("key and value have different data types!", "properties");
         }
     }
     return(new SaveDomainRequest
     {
         TenantId = tenantId,
         DomainInfo = new DomainInfo
         {
             DomainName = domain.Domain,
             DomainKey = domainKey,
             Properties = LocatorServiceClientWriter.GetPropertyValues(properties)
         }
     });
 }