private static void CreateUserConfiguration(StoreRetentionPolicyTagHelper tagHelper)
		{
			byte[] xmlData = MrmFaiFormatter.Serialize(tagHelper.TagData, tagHelper.defaultArchiveTagData, tagHelper.deletedTags, tagHelper.retentionHoldData, tagHelper.fullCrawlRequired, tagHelper.exchangePrincipal);
			CreateUserConfigurationType createUserConfiguration = new CreateUserConfigurationType
			{
				UserConfiguration = new UserConfigurationType
				{
					UserConfigurationName = new UserConfigurationNameType
					{
						Name = "MRM",
						Item = new DistinguishedFolderIdType
						{
							Id = DistinguishedFolderIdNameType.inbox
						}
					},
					XmlData = xmlData
				}
			};
			StoreRetentionPolicyTagHelper.CallEwsWithRetries(() => tagHelper.serviceBinding.CreateUserConfiguration(createUserConfiguration), delegate(ResponseMessageType responseMessage, int messageIndex)
			{
				if (responseMessage.ResponseClass == ResponseClassType.Success)
				{
					ExTraceGlobals.ELCTracer.TraceDebug(0L, "Successfully created MRM user configuration");
					return true;
				}
				ExTraceGlobals.ELCTracer.TraceDebug(0L, "MRM user configuration was not created");
				return false;
			}, tagHelper);
		}
		internal static void SyncOptionalTagsFromPrimaryToArchive(ADUser user)
		{
			if (user == null || !StoreRetentionPolicyTagHelper.HasOnPremArchiveMailbox(user))
			{
				return;
			}
			using (StoreRetentionPolicyTagHelper storeRetentionPolicyTagHelper = StoreRetentionPolicyTagHelper.FromADUser(user, false))
			{
				if (storeRetentionPolicyTagHelper.configItemExists)
				{
					using (StoreRetentionPolicyTagHelper storeRetentionPolicyTagHelper2 = StoreRetentionPolicyTagHelper.FromADUser(user, true))
					{
						List<StoreTagData> list = (from x in storeRetentionPolicyTagHelper.tagData.Values
						where !x.Tag.IsArchiveTag
						select x).ToList<StoreTagData>();
						if (!storeRetentionPolicyTagHelper2.configItemExists || storeRetentionPolicyTagHelper2.tagData == null || storeRetentionPolicyTagHelper2.tagData.Count == 0)
						{
							if (storeRetentionPolicyTagHelper2.tagData == null)
							{
								storeRetentionPolicyTagHelper2.tagData = new Dictionary<Guid, StoreTagData>(list.Count);
							}
							foreach (StoreTagData storeTagData in list)
							{
								if (!storeRetentionPolicyTagHelper2.tagData.Values.Contains(storeTagData))
								{
									storeRetentionPolicyTagHelper2.tagData.Add(storeTagData.Tag.RetentionId, storeTagData);
								}
							}
							storeRetentionPolicyTagHelper2.Save();
						}
					}
				}
			}
		}
Exemplo n.º 3
0
        private void Process(bool archiveMailbox, out ExchangePrincipal exchPrincipal)
        {
            ExchangePrincipal exchangePrincipal = null;

            try
            {
                using (StoreRetentionPolicyTagHelper storeRetentionPolicyTagHelper = StoreRetentionPolicyTagHelper.FromMailboxId(base.DomainController, this.Mailbox, archiveMailbox, base.CurrentOrganizationId))
                {
                    exchangePrincipal = storeRetentionPolicyTagHelper.UserPrincipal;
                    ELCTaskHelper.VerifyIsInScopes(storeRetentionPolicyTagHelper.Mailbox, base.ScopeSet, new Task.TaskErrorLoggingDelegate(base.WriteError));
                    if (storeRetentionPolicyTagHelper.Mailbox.ExchangeVersion.IsOlderThan(ExchangeObjectVersion.Exchange2010))
                    {
                        base.WriteError(new InvalidOperationException(Strings.OptInNotSupportedForPre14Mailbox(ExchangeObjectVersion.Exchange2010.ToString(), storeRetentionPolicyTagHelper.Mailbox.Identity.ToString(), storeRetentionPolicyTagHelper.Mailbox.ExchangeVersion.ToString())), ErrorCategory.InvalidOperation, storeRetentionPolicyTagHelper.Mailbox.Identity);
                    }
                    if (storeRetentionPolicyTagHelper.Mailbox.RetentionPolicy == null && !storeRetentionPolicyTagHelper.Mailbox.ShouldUseDefaultRetentionPolicy)
                    {
                        base.WriteError(new ArgumentException(Strings.RetentionPolicyNotEnabled, "Mailbox"), ErrorCategory.InvalidArgument, null);
                    }
                    IConfigurationSession configurationSession = base.DataSession as IConfigurationSession;
                    configurationSession.SessionSettings.IsSharedConfigChecked = true;
                    List <StoreTagData> optionalStoreTags = SetRetentionPolicyTag.ResolveTags(configurationSession, this.OptionalInMailbox);
                    this.ProcessOptionalTags(storeRetentionPolicyTagHelper.TagData, optionalStoreTags, archiveMailbox);
                    storeRetentionPolicyTagHelper.Save();
                }
            }
            catch (ElcUserConfigurationException exception)
            {
                base.WriteError(exception, ErrorCategory.ResourceUnavailable, null);
            }
            exchPrincipal = exchangePrincipal;
        }
		private static StoreRetentionPolicyTagHelper FromADUser(ADUser user, bool isArchiveMailbox)
		{
			StoreRetentionPolicyTagHelper storeRetentionPolicyTagHelper = new StoreRetentionPolicyTagHelper();
			storeRetentionPolicyTagHelper.user = user;
			storeRetentionPolicyTagHelper.isArchiveMailbox = isArchiveMailbox;
			StoreRetentionPolicyTagHelper.FetchRetentionPolicyTagDataFromMailbox(storeRetentionPolicyTagHelper);
			return storeRetentionPolicyTagHelper;
		}
		internal static StoreRetentionPolicyTagHelper FromMailboxId(string domainController, MailboxIdParameter mailbox, bool isArchiveMailbox, OrganizationId orgId)
		{
			StoreRetentionPolicyTagHelper storeRetentionPolicyTagHelper = new StoreRetentionPolicyTagHelper();
			storeRetentionPolicyTagHelper.user = StoreRetentionPolicyTagHelper.FetchRecipientFromMailboxId(domainController, mailbox, out storeRetentionPolicyTagHelper.recipientSession, orgId);
			storeRetentionPolicyTagHelper.isArchiveMailbox = isArchiveMailbox;
			StoreRetentionPolicyTagHelper.FetchRetentionPolicyTagDataFromMailbox(storeRetentionPolicyTagHelper);
			return storeRetentionPolicyTagHelper;
		}
		internal static bool HasOnPremArchiveMailbox(ADUser user)
		{
			if (user.ArchiveState == ArchiveState.Local)
			{
				ExchangePrincipal exchangePrincipal = ExchangePrincipal.FromADUser(user, RemotingOptions.AllowCrossSite);
				return StoreRetentionPolicyTagHelper.HasOnPremArchiveMailbox(exchangePrincipal);
			}
			return false;
		}
Exemplo n.º 7
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            if (this.Mailbox != null)
            {
                try
                {
                    using (StoreRetentionPolicyTagHelper storeRetentionPolicyTagHelper = StoreRetentionPolicyTagHelper.FromMailboxId(base.DomainController, this.Mailbox, base.CurrentOrganizationId))
                    {
                        if (storeRetentionPolicyTagHelper.Mailbox.ExchangeVersion.IsOlderThan(ExchangeObjectVersion.Exchange2010))
                        {
                            base.WriteError(new InvalidOperationException(Strings.OptInNotSupportedForPre14Mailbox(ExchangeObjectVersion.Exchange2010.ToString(), storeRetentionPolicyTagHelper.Mailbox.Identity.ToString(), storeRetentionPolicyTagHelper.Mailbox.ExchangeVersion.ToString())), ErrorCategory.InvalidOperation, storeRetentionPolicyTagHelper.Mailbox.Identity);
                        }
                        IConfigurationSession configurationSession = base.DataSession as IConfigurationSession;
                        configurationSession.SessionSettings.IsSharedConfigChecked = true;
                        if (storeRetentionPolicyTagHelper.TagData != null && storeRetentionPolicyTagHelper.TagData.Count > 0)
                        {
                            foreach (Guid guid in storeRetentionPolicyTagHelper.TagData.Keys)
                            {
                                RetentionPolicyTag retentionTagFromGuid = this.GetRetentionTagFromGuid(guid, configurationSession);
                                StoreTagData       storeTagData         = storeRetentionPolicyTagHelper.TagData[guid];
                                if ((storeTagData.IsVisible || storeTagData.Tag.Type == ElcFolderType.All) && ((this.OptionalInMailbox && storeTagData.OptedInto) || !this.OptionalInMailbox) && retentionTagFromGuid != null)
                                {
                                    this.WriteResult(retentionTagFromGuid);
                                }
                            }
                        }
                        if (!this.OptionalInMailbox && storeRetentionPolicyTagHelper.DefaultArchiveTagData != null && storeRetentionPolicyTagHelper.DefaultArchiveTagData.Count > 0)
                        {
                            foreach (Guid guid2 in storeRetentionPolicyTagHelper.DefaultArchiveTagData.Keys)
                            {
                                RetentionPolicyTag retentionTagFromGuid2 = this.GetRetentionTagFromGuid(guid2, configurationSession);
                                if (retentionTagFromGuid2 != null)
                                {
                                    StoreTagData storeTagData2 = storeRetentionPolicyTagHelper.DefaultArchiveTagData[guid2];
                                    if (storeTagData2.Tag.Type == ElcFolderType.All)
                                    {
                                        this.WriteResult(retentionTagFromGuid2);
                                    }
                                }
                            }
                        }
                    }
                    goto IL_20A;
                }
                catch (ElcUserConfigurationException exception)
                {
                    base.WriteError(exception, ErrorCategory.ResourceUnavailable, null);
                    goto IL_20A;
                }
            }
            base.InternalProcessRecord();
IL_20A:
            TaskLogger.LogExit();
        }
		private static void FetchRetentionPolicyTagDataFromService(StoreRetentionPolicyTagHelper srpth)
		{
			StoreRetentionPolicyTagHelper.InitializeServiceBinding(srpth);
			if (srpth.serviceBinding != null)
			{
				GetUserConfigurationType getUserConfiguration = new GetUserConfigurationType
				{
					UserConfigurationName = new UserConfigurationNameType
					{
						Name = "MRM",
						Item = new DistinguishedFolderIdType
						{
							Id = DistinguishedFolderIdNameType.inbox
						}
					},
					UserConfigurationProperties = (UserConfigurationPropertyType.Dictionary | UserConfigurationPropertyType.XmlData | UserConfigurationPropertyType.BinaryData)
				};
				StoreRetentionPolicyTagHelper.CallEwsWithRetries(() => srpth.serviceBinding.GetUserConfiguration(getUserConfiguration), delegate(ResponseMessageType responseMessage, int messageIndex)
				{
					GetUserConfigurationResponseMessageType getUserConfigurationResponseMessageType = responseMessage as GetUserConfigurationResponseMessageType;
					if (getUserConfigurationResponseMessageType.ResponseClass == ResponseClassType.Success && getUserConfigurationResponseMessageType.UserConfiguration != null)
					{
						if (getUserConfigurationResponseMessageType.UserConfiguration.XmlData != null)
						{
							ExTraceGlobals.ELCTracer.TraceDebug(0L, "Acquired MRM user configuration.");
							srpth.TagData = MrmFaiFormatter.Deserialize(getUserConfigurationResponseMessageType.UserConfiguration.XmlData, srpth.exchangePrincipal, out srpth.deletedTags, out srpth.retentionHoldData, true, out srpth.defaultArchiveTagData, out srpth.fullCrawlRequired);
							srpth.configItemExists = true;
						}
						else
						{
							ExTraceGlobals.ELCTracer.TraceDebug(0L, "MRM user configuration is null");
							srpth.TagData = new Dictionary<Guid, StoreTagData>();
							srpth.configItemExists = false;
						}
						return true;
					}
					if (getUserConfigurationResponseMessageType.ResponseClass == ResponseClassType.Error && getUserConfigurationResponseMessageType.ResponseCode == ResponseCodeType.ErrorItemNotFound)
					{
						ExTraceGlobals.ELCTracer.TraceDebug(0L, "MRM user configuration not found");
						srpth.TagData = new Dictionary<Guid, StoreTagData>();
						srpth.configItemExists = false;
						return true;
					}
					ExTraceGlobals.ELCTracer.TraceDebug(0L, "Getting MRM user configuration failed");
					return false;
				}, srpth);
				return;
			}
			throw new ElcUserConfigurationException(Strings.ElcUserConfigurationServiceBindingNotAvailable);
		}
		private static void FetchRetentionPolicyTagDataFromMailbox(StoreRetentionPolicyTagHelper srpth)
		{
			StoreRetentionPolicyTagHelper.InitializePrincipal(srpth);
			if (srpth.exchangePrincipal != null)
			{
				if (srpth.exchangePrincipal.MailboxInfo.Location.ServerVersion >= Server.E14SP1MinVersion)
				{
					ExTraceGlobals.ELCTracer.TraceDebug(0L, "Fetch retention policy tag data from EWS since user's version is " + srpth.exchangePrincipal.MailboxInfo.Location.ServerVersion);
					StoreRetentionPolicyTagHelper.FetchRetentionPolicyTagDataFromService(srpth);
					return;
				}
				ExTraceGlobals.ELCTracer.TraceDebug(0L, "Fetch retention policy tag data from XSO since user's version is " + srpth.exchangePrincipal.MailboxInfo.Location.ServerVersion);
				StoreRetentionPolicyTagHelper.FetchRetentionPolcyTagDataFromXSO(srpth);
			}
		}
		private void SaveToService()
		{
			StoreRetentionPolicyTagHelper.InitializePrincipal(this);
			StoreRetentionPolicyTagHelper.InitializeServiceBinding(this);
			if (this.serviceBinding == null)
			{
				throw new ElcUserConfigurationException(Strings.ElcUserConfigurationServiceBindingNotAvailable);
			}
			if (this.configItemExists)
			{
				StoreRetentionPolicyTagHelper.UpdateUserConfiguration(this);
				return;
			}
			StoreRetentionPolicyTagHelper.CreateUserConfiguration(this);
		}
		private static void InitializeServiceBinding(StoreRetentionPolicyTagHelper srpth)
		{
			if (srpth.exchangePrincipal != null)
			{
				string text = StoreRetentionPolicyTagHelper.DiscoverEwsUrl(srpth.exchangePrincipal);
				if (string.IsNullOrEmpty(text))
				{
					return;
				}
				srpth.serviceBinding = StoreRetentionPolicyTagHelper.CreateBinding(srpth.exchangePrincipal.MailboxInfo.PrimarySmtpAddress.ToString());
				srpth.serviceBinding.Timeout = (int)StoreRetentionPolicyTagHelper.DefaultSoapClientTimeout.TotalMilliseconds;
				srpth.serviceBinding.Url = text;
				ExTraceGlobals.ELCTracer.TraceDebug(0L, "Refreshed service binding, new url: " + text);
			}
		}
		private static void FetchRetentionPolcyTagDataFromXSO(StoreRetentionPolicyTagHelper srpth)
		{
			if (srpth.exchangePrincipal == null)
			{
				ExTraceGlobals.ELCTracer.TraceDebug(0L, "Cannot fetch retention policy tag data because Exchange principal is not available.");
				return;
			}
			srpth.mailboxSession = MailboxSession.OpenAsAdmin(srpth.exchangePrincipal, CultureInfo.InvariantCulture, "Client=Management;Action=Get-/Set-RetentionPolicyTag");
			srpth.configItem = ElcMailboxHelper.OpenFaiMessage(srpth.mailboxSession, "MRM", true);
			if (srpth.configItem != null)
			{
				srpth.TagData = MrmFaiFormatter.Deserialize(srpth.configItem, srpth.exchangePrincipal, out srpth.deletedTags, out srpth.retentionHoldData, true, out srpth.defaultArchiveTagData, out srpth.fullCrawlRequired);
				return;
			}
			srpth.TagData = new Dictionary<Guid, StoreTagData>();
		}
		private static void InitializePrincipal(StoreRetentionPolicyTagHelper srpth)
		{
			if (srpth.user != null)
			{
				srpth.exchangePrincipal = ExchangePrincipal.FromADUser(srpth.user.OrganizationId.ToADSessionSettings(), srpth.user);
				if (srpth.exchangePrincipal != null && srpth.isArchiveMailbox && srpth.user.ArchiveState == ArchiveState.Local)
				{
					srpth.exchangePrincipal = srpth.exchangePrincipal.GetArchiveExchangePrincipal(RemotingOptions.LocalConnectionsOnly);
					return;
				}
			}
			else
			{
				ExTraceGlobals.ELCTracer.TraceDebug(0L, "Exchange principal cannot be found because user is not available.");
			}
		}
		private static ExchangeServiceBinding CreateBinding(string email)
		{
			NetworkServiceImpersonator.Initialize();
			if (NetworkServiceImpersonator.Exception != null)
			{
				ExTraceGlobals.ELCTracer.TraceError<LocalizedException>(0L, "Unable to impersonate network service to call EWS due to exception {0}", NetworkServiceImpersonator.Exception);
				throw new ElcUserConfigurationException(Strings.ElcUserConfigurationServiceBindingNotAvailable, NetworkServiceImpersonator.Exception);
			}
			ExchangeServiceBinding exchangeServiceBinding = new ExchangeServiceBinding(new RemoteCertificateValidationCallback(StoreRetentionPolicyTagHelper.CertificateErrorHandler));
			exchangeServiceBinding.UserAgent = WellKnownUserAgent.GetEwsNegoAuthUserAgent("MRMTask");
			exchangeServiceBinding.RequestServerVersionValue = new RequestServerVersion
			{
				Version = ExchangeVersionType.Exchange2010_SP1
			};
			StoreRetentionPolicyTagHelper.SetSecurityHeader(exchangeServiceBinding, email);
			return exchangeServiceBinding;
		}
Exemplo n.º 15
0
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            string mailboxAddress = this.Identity.ToString();
            ADUser dataObject     = this.DataObject;

            ELCTaskHelper.VerifyIsInScopes(dataObject, base.ScopeSet, new Task.TaskErrorLoggingDelegate(base.WriteError));
            if (dataObject.ExchangeGuid != Guid.Empty && dataObject.RecipientType != RecipientType.MailUser && dataObject.Database != null)
            {
                MailboxDatabase mailboxDatabase = base.GlobalConfigSession.Read <MailboxDatabase>(dataObject.Database);
                if (mailboxDatabase == null)
                {
                    base.WriteError(new ArgumentException(Strings.ElcMdbNotFound(mailboxAddress), "Mailbox"), ErrorCategory.InvalidArgument, null);
                }
                this.InternalProcessOneMailbox(dataObject.ExchangeGuid, mailboxDatabase.Guid);
            }
            if (dataObject.ArchiveState == ArchiveState.Local)
            {
                ADObjectId      entryId          = dataObject.ArchiveDatabase ?? dataObject.Database;
                MailboxDatabase mailboxDatabase2 = base.GlobalConfigSession.Read <MailboxDatabase>(entryId);
                if (mailboxDatabase2 == null)
                {
                    base.WriteError(new ArgumentException(Strings.ElcMdbNotFound(mailboxAddress), "Archive Mailbox"), ErrorCategory.InvalidArgument, null);
                }
                if (StoreRetentionPolicyTagHelper.HasOnPremArchiveMailbox(dataObject))
                {
                    try
                    {
                        StoreRetentionPolicyTagHelper.SyncOptionalTagsFromPrimaryToArchive(dataObject);
                    }
                    catch (ElcUserConfigurationException)
                    {
                        this.WriteWarning(Strings.WarningArchiveMailboxNotReachable(mailboxAddress));
                    }
                }
                this.InternalProcessOneMailbox(dataObject.ArchiveGuid, mailboxDatabase2.Guid);
            }
            if (!this.processed)
            {
                this.WriteWarning(Strings.ElcNoLocalMbxOrArchive(mailboxAddress));
            }
            TaskLogger.LogExit();
        }
Exemplo n.º 16
0
 protected override void InternalProcessRecord()
 {
     TaskLogger.LogEnter();
     if (this.DataObject != null && SharedConfiguration.IsSharedConfiguration(this.DataObject.OrganizationId) && !base.ShouldContinue(Strings.ConfirmSharedConfiguration(this.DataObject.OrganizationId.OrganizationalUnit.Name)))
     {
         TaskLogger.LogExit();
         return;
     }
     if (this.Mailbox != null)
     {
         ExchangePrincipal exchangePrincipal = this.ProcessPrimaryMailbox();
         IRecipientSession recipientSession;
         ADUser            user = StoreRetentionPolicyTagHelper.FetchRecipientFromMailboxId(base.DomainController, this.Mailbox, out recipientSession, exchangePrincipal.MailboxInfo.OrganizationId);
         if (exchangePrincipal != null && StoreRetentionPolicyTagHelper.HasOnPremArchiveMailbox(user))
         {
             this.ProcessArchiveMailbox();
         }
     }
     else
     {
         bool flag = this.DataObject.IsChanged(ADObjectSchema.Name);
         if (this.DataObject.IsChanged(RetentionPolicyTagSchema.RetentionId) && !this.Force && !base.ShouldContinue(Strings.WarningRetentionTagIdChange(this.DataObject.Identity.ToString())))
         {
             return;
         }
         base.InternalProcessRecord();
         if (this.contentSettingsObject.ObjectState == ObjectState.Changed)
         {
             if (flag)
             {
                 ElcContentSettings elcContentSettings = this.DataObject.GetELCContentSettings().FirstOrDefault <ElcContentSettings>();
                 elcContentSettings.CopyChangesFrom(this.contentSettingsObject);
                 this.contentSettingsObject = elcContentSettings;
             }
             base.DataSession.Save(this.contentSettingsObject);
         }
     }
     TaskLogger.LogExit();
 }
		internal static StoreRetentionPolicyTagHelper FromMailboxId(string domainController, MailboxIdParameter mailbox, OrganizationId organizationId)
		{
			return StoreRetentionPolicyTagHelper.FromMailboxId(domainController, mailbox, false, organizationId);
		}
		private static void CallEwsWithRetries(Func<BaseResponseMessageType> delegateEwsCall, Func<ResponseMessageType, int, bool> responseMessageProcessor, StoreRetentionPolicyTagHelper srpth)
		{
			ExDateTime t = ExDateTime.UtcNow.Add(StoreRetentionPolicyTagHelper.TotalExecutionTimeWindow);
			Exception ex = null;
			int num = -1;
			bool flag;
			do
			{
				ex = null;
				flag = false;
				try
				{
					BaseResponseMessageType baseResponseMessageType = delegateEwsCall();
					num++;
					int i = 0;
					while (i < baseResponseMessageType.ResponseMessages.Items.Length)
					{
						ResponseMessageType responseMessageType = baseResponseMessageType.ResponseMessages.Items[i];
						if (responseMessageProcessor != null && responseMessageProcessor(responseMessageType, i))
						{
							ExTraceGlobals.ELCTracer.TraceDebug(0L, "Successfully executed EWS call");
							break;
						}
						if (responseMessageType.ResponseClass == ResponseClassType.Error)
						{
							if (responseMessageType.ResponseCode == ResponseCodeType.ErrorCrossSiteRequest)
							{
								ExTraceGlobals.ELCTracer.TraceDebug(0L, "Crosssite request error , recreate exchange binding and reset the url caches");
								flag = true;
								StoreRetentionPolicyTagHelper.InitializePrincipal(srpth);
								StoreRetentionPolicyTagHelper.InitializeServiceBinding(srpth);
								break;
							}
							if (!StoreRetentionPolicyTagHelper.TransientServiceErrors.Contains(responseMessageType.ResponseCode))
							{
								ExTraceGlobals.ELCTracer.TraceError(0L, string.Format("Permanent error encountered:  {0}, {1}, {2}", responseMessageType.ResponseClass.ToString(), responseMessageType.ResponseCode.ToString(), responseMessageType.MessageText.ToString()));
								throw new ElcUserConfigurationException(Strings.FailedToGetElcUserConfigurationFromService(responseMessageType.ResponseClass.ToString(), responseMessageType.ResponseCode.ToString(), responseMessageType.MessageText.ToString()));
							}
							flag = true;
							ex = new ElcUserConfigurationException(Strings.FailedToGetElcUserConfigurationFromService(responseMessageType.ResponseClass.ToString(), responseMessageType.ResponseCode.ToString(), responseMessageType.MessageText.ToString()));
							ExTraceGlobals.ELCTracer.TraceDebug(0L, "Transient error encountered, will attempt to retry, Exception: " + ex);
							break;
						}
						else
						{
							i++;
						}
					}
				}
				catch (CommunicationException ex2)
				{
					ex = ex2;
					ExTraceGlobals.ELCTracer.TraceDebug(0L, "Transient error encountered, will attempt to retry, Exception: " + ex);
					flag = true;
				}
				catch (WebException ex3)
				{
					ex = ex3;
					ExTraceGlobals.ELCTracer.TraceDebug(0L, "Transient error encountered, will attempt to retry, Exception: " + ex);
					flag = true;
				}
				catch (TimeoutException ex4)
				{
					ex = ex4;
					flag = false;
				}
				catch (SoapException ex5)
				{
					ex = ex5;
					flag = false;
				}
				catch (IOException ex6)
				{
					ex = ex6;
					flag = false;
				}
				catch (InvalidOperationException ex7)
				{
					ex = ex7;
					flag = false;
				}
				catch (LocalizedException ex8)
				{
					ex = ex8;
					flag = false;
				}
			}
			while (flag && t > ExDateTime.UtcNow);
			if (ex != null)
			{
				ExTraceGlobals.ELCTracer.TraceError(0L, string.Format("Failed to access elc user configuration.  Total attempts made {0}, Exception: {1} ", num, ex));
				throw new ElcUserConfigurationException(Strings.ErrorElcUserConfigurationServiceCall, ex);
			}
		}