public AddDirectoryCacheRequest(List <Tuple <string, KeyType> > keys, ADRawEntry objectToCache, string forestFqdn, OrganizationId organizationId, IEnumerable <PropertyDefinition> properties, int secondsTimeout = 2147483646, CacheItemPriority priority = CacheItemPriority.Default) { ArgumentValidator.ThrowIfNull("keys", keys); ArgumentValidator.ThrowIfNull("objectToCache", objectToCache); ArgumentValidator.ThrowIfOutOfRange <int>("secondsTimeout", secondsTimeout, 1, 2147483646); ArgumentValidator.ThrowIfNull("organizationId", organizationId); if (keys.Count == 0) { throw new InvalidOperationException("Keys should not be empty"); } this.Keys = keys; ADObject adobject = objectToCache as ADObject; if (adobject != null) { this.Object = SimpleADObject.CreateFrom(adobject, properties); } else { this.Object = SimpleADObject.CreateFromRawEntry(objectToCache, properties, true); } this.ObjectType = CacheUtils.GetObjectTypeFor(objectToCache.GetType(), true); this.SecondsTimeout = secondsTimeout; this.Priority = priority; base.ForestOrPartitionFqdn = forestFqdn; base.InternalSetOrganizationId(organizationId); }
internal static void PopulateAndCheckObjectType <TObject>(DirectoryCacheRequest cacheRequest) { ArgumentValidator.ThrowIfNull("cacheRequest", cacheRequest); ObjectType objectType = cacheRequest.ObjectType; cacheRequest.ObjectType = CacheUtils.GetObjectTypeFor(typeof(TObject), true); }
// Token: 0x0600095D RID: 2397 RVA: 0x000299C8 File Offset: 0x00027BC8 internal static List <Tuple <string, KeyType> > GetAddKeysFromObject(ADObject adObject) { ArgumentValidator.ThrowIfNull("adObject", adObject); ObjectType objectTypeFor = CacheUtils.GetObjectTypeFor(adObject.GetType(), true); List <Tuple <string, KeyType> > list = new List <Tuple <string, KeyType> >(); if (!string.IsNullOrEmpty(adObject.DistinguishedName)) { list.Add(new Tuple <string, KeyType>(adObject.DistinguishedName.ToLower(), KeyType.DistinguishedName)); } if (!Guid.Empty.Equals(adObject.Guid)) { list.Add(new Tuple <string, KeyType>(adObject.Guid.ToString(), KeyType.Guid)); } ObjectType objectType = objectTypeFor; if (objectType <= ObjectType.OWAMiniRecipient) { if (objectType <= ObjectType.FederatedOrganizationId) { switch (objectType) { case ObjectType.ExchangeConfigurationUnit: list.Add(new Tuple <string, KeyType>(adObject.Id.Parent.Name, KeyType.Name)); list.Add(new Tuple <string, KeyType>(((ExchangeConfigurationUnit)adObject).ExternalDirectoryOrganizationId, KeyType.ExternalDirectoryOrganizationId)); return(list); case ObjectType.Recipient: { list.AddRange(KeyBuilder.GetSidKeys(adObject)); list.AddRange(KeyBuilder.GetExchangeGuidKeys(adObject)); string text = (string)adObject[ADRecipientSchema.LegacyExchangeDN]; if (!string.IsNullOrEmpty(text)) { list.Add(new Tuple <string, KeyType>(text, KeyType.LegacyExchangeDN)); } list.AddRange(KeyBuilder.GetExchangeEmailAddressesKeys(adObject)); return(list); } case ObjectType.ExchangeConfigurationUnit | ObjectType.Recipient: return(list); case ObjectType.AcceptedDomain: list.Add(new Tuple <string, KeyType>(adObject.Name, KeyType.Name)); return(list); default: if (objectType != ObjectType.FederatedOrganizationId) { return(list); } list.Add(new Tuple <string, KeyType>(adObject.Id.Parent.DistinguishedName, KeyType.OrgCUDN)); return(list); } } else { if (objectType == ObjectType.MiniRecipient) { if ((adObject as MiniRecipient).NetID != null) { list.Add(KeyBuilder.LookupKeysFromNetId((adObject as MiniRecipient).NetID.ToString())); } ProxyAddressCollection proxyAddressCollection = (ProxyAddressCollection)adObject[ADRecipientSchema.EmailAddresses]; if (proxyAddressCollection != null) { foreach (ProxyAddress proxyAddress in proxyAddressCollection) { list.AddRange(KeyBuilder.LookupKeysFromProxyAddress(proxyAddress)); } } list.AddRange(KeyBuilder.GetSidKeys(adObject)); return(list); } if (objectType != ObjectType.TransportMiniRecipient && objectType != ObjectType.OWAMiniRecipient) { return(list); } } } else if (objectType <= ObjectType.StorageMiniRecipient) { if (objectType != ObjectType.ActiveSyncMiniRecipient && objectType != ObjectType.StorageMiniRecipient) { return(list); } } else if (objectType != ObjectType.LoadBalancingMiniRecipient) { if (objectType == ObjectType.MiniRecipientWithTokenGroups) { list.AddRange(KeyBuilder.GetSidKeys(adObject)); return(list); } if (objectType != ObjectType.FrontEndMiniRecipient) { return(list); } list.AddRange(KeyBuilder.GetExchangeGuidKeys(adObject)); return(list); } ProxyAddressCollection proxyAddressCollection2 = (ProxyAddressCollection)adObject[ADRecipientSchema.EmailAddresses]; if (proxyAddressCollection2 != null) { foreach (ProxyAddress proxyAddress2 in proxyAddressCollection2) { list.AddRange(KeyBuilder.LookupKeysFromProxyAddress(proxyAddress2)); } } list.AddRange(KeyBuilder.GetSidKeys(adObject)); return(list); }