private void LoadSyncStateCache() { MrsTracer.Provider.Function("PstDestinationMailbox.LoadSyncStateData", new object[0]); if (this.syncStateCache != null) { return; } try { if (this.syncStatePropId == 0) { this.syncStatePropId = base.IPst.ReadIdFromNamedProp(PstDestinationMailbox.syncStateNamedProp.Name, 0U, PstDestinationMailbox.syncStateNamedProp.Guid, true); } this.syncStateCache = new PSTSyncStateDictionary(); PropertyValue property = base.MessageStorePropertyBag.GetProperty(new PropertyTag((PropertyId)this.syncStatePropId, PropertyType.Unicode)); if (!property.IsError) { this.syncStateCache = XMLSerializableBase.Deserialize<PSTSyncStateDictionary>((string)property.Value, true); } } catch (PSTExceptionBase innerException) { throw new UnableToLoadPSTSyncStatePermanentException(base.IPst.FileName, innerException); } catch (MoveJobDeserializationFailedPermanentException innerException2) { throw new UnableToLoadPSTSyncStatePermanentException(base.IPst.FileName, innerException2); } }
void IMailbox.UpdateMovedMailbox(UpdateMovedMailboxOperation op, ADUser remoteRecipientData, string domainController, out ReportEntry[] entries, Guid newDatabaseGuid, Guid newArchiveDatabaseGuid, string archiveDomain, ArchiveStatusFlags archiveStatus, UpdateMovedMailboxFlags updateMovedMailboxFlags, Guid?newMailboxContainerGuid, CrossTenantObjectId newUnifiedMailboxId) { entries = null; MrsTracer.ProxyClient.Function("RemoteMailbox.UpdateMovedMailbox", new object[0]); this.VerifyMailboxConnection(); string remoteRecipientData2 = ConfigurableObjectXML.Serialize <ADUser>(remoteRecipientData); string text = null; if (base.ServerVersion[46]) { byte[] newUnifiedMailboxIdData = (newUnifiedMailboxId == null) ? null : newUnifiedMailboxId.GetBytes(); base.MrsProxy.IMailbox_UpdateMovedMailbox4(base.Handle, op, remoteRecipientData2, domainController, out text, newDatabaseGuid, newArchiveDatabaseGuid, archiveDomain, (int)archiveStatus, (int)updateMovedMailboxFlags, newMailboxContainerGuid, newUnifiedMailboxIdData); } else if (base.ServerVersion[36]) { base.MrsProxy.IMailbox_UpdateMovedMailbox3(base.Handle, op, remoteRecipientData2, domainController, out text, newDatabaseGuid, newArchiveDatabaseGuid, archiveDomain, (int)archiveStatus, (int)updateMovedMailboxFlags); } else if (base.ServerVersion[9]) { base.MrsProxy.IMailbox_UpdateMovedMailbox2(base.Handle, op, remoteRecipientData2, domainController, out text, newDatabaseGuid, newArchiveDatabaseGuid, archiveDomain, (int)archiveStatus); } else { base.MrsProxy.IMailbox_UpdateMovedMailbox(base.Handle, op, remoteRecipientData2, domainController, out text); } if (text != null) { List <ReportEntry> list = XMLSerializableBase.Deserialize <List <ReportEntry> >(text, false); entries = ((list != null) ? list.ToArray() : null); } }
public TransactionalRequestJob ValidateAndPopulateRequestJob(TransactionalRequestJob requestJob, out List <ReportEntry> entries) { List <ReportEntry> entriesInternal = null; string resultString = null; string requestJobXML = XMLSerializableBase.Serialize(new RequestJobXML(requestJob), false); try { this.CallService(delegate() { string text = null; try { resultString = this.Channel.ValidateAndPopulateRequestJob(requestJobXML, out text); } finally { if (text != null) { entriesInternal = XMLSerializableBase.Deserialize <List <ReportEntry> >(text, false); } } }); } finally { entries = entriesInternal; } return(new TransactionalRequestJob(XMLSerializableBase.Deserialize <RequestJobXML>(resultString, false))); }
public static ImapFolderState Deserialize(byte[] compressedXml) { byte[] bytes = CommonUtils.DecompressData(compressedXml); string @string = Encoding.UTF7.GetString(bytes); if (string.IsNullOrEmpty(@string)) { throw new CorruptSyncStateException(new ArgumentNullException("data", "Cannot deserialize null or empty data")); } return(XMLSerializableBase.Deserialize <ImapFolderState>(@string, true)); }
private static T DeserializeFromStream(Stream stream, bool throwOnDeserializationError) { if (typeof(T) == typeof(string)) { using (StreamReader streamReader = new StreamReader(stream)) { return((T)((object)streamReader.ReadToEnd())); } } return(XMLSerializableBase.Deserialize <T>(stream, throwOnDeserializationError)); }
private MessageExportResultsMessage(bool useCompression, byte[] blob) { this.BadMessages = new List <BadMessageRec>(); this.MissingMessages = new List <MessageRec>(); string serializedXML = CommonUtils.UnpackString(blob, useCompression); MessageExportResults messageExportResults = XMLSerializableBase.Deserialize <MessageExportResults>(serializedXML, false); if (messageExportResults != null) { this.MissingMessages = messageExportResults.GetMissingMessages(); this.BadMessages.AddRange(messageExportResults.BadMessages); } }
public static PopFolderState Deserialize(byte[] compressedXml) { byte[] bytes = CommonUtils.DecompressData(compressedXml); string @string = Encoding.UTF7.GetString(bytes); if (string.IsNullOrEmpty(@string)) { throw new CorruptSyncStateException(new ArgumentNullException("data", "Cannot deserialize null or empty data")); } PopFolderState popFolderState = XMLSerializableBase.Deserialize <PopFolderState>(@string, true); popFolderState.MessageList = PopBookmark.Parse(popFolderState.MessageListString); return(popFolderState); }
// Token: 0x06000282 RID: 642 RVA: 0x000093F0 File Offset: 0x000075F0 public override bool ReadFromMessageItem(IAnchorStoreObject message) { if (!base.ReadFromMessageItem(message)) { return(false); } if (!AnchorXmlSerializableObject <TXmlSerializable> .GetItemClass().Equals(message[StoreObjectSchema.ItemClass])) { return(false); } string text = message[ItemSchema.TextBody] as string; if (string.IsNullOrEmpty(text)) { return(false); } this.PersistedObject = XMLSerializableBase.Deserialize <TXmlSerializable>(text, true); return(true); }
internal static MapiSyncState Deserialize(string data) { return(XMLSerializableBase.Deserialize <MapiSyncState>(data, false)); }
MailboxInformation IMailboxReplicationService.GetMailboxInformation4(string requestJobXml, Guid primaryMailboxGuid, Guid physicalMailboxGuid, byte[] partitionHint, Guid targetMdbGuid, string targetMdbName, string remoteHostName, string remoteOrgName, string remoteDCName, string username, string password, string domain) { MailboxInformation info = null; this.ForwardKnownExceptions(delegate { TenantPartitionHint partitionHint2 = (partitionHint != null) ? TenantPartitionHint.FromPersistablePartitionHint(partitionHint) : null; bool flag = string.IsNullOrEmpty(targetMdbName) && targetMdbGuid == Guid.Empty; NetworkCredential networkCredential = (!string.IsNullOrEmpty(username)) ? new NetworkCredential(username, password, domain) : null; MailboxType mbxType; IMailbox mailbox; if (string.IsNullOrEmpty(remoteHostName)) { if (!string.IsNullOrEmpty(remoteDCName)) { if (flag) { mbxType = MailboxType.SourceMailbox; mailbox = new MapiSourceMailbox(LocalMailboxFlags.Move); } else { mbxType = MailboxType.DestMailboxIntraOrg; mailbox = new MapiDestinationMailbox(LocalMailboxFlags.None); } mailbox.ConfigADConnection(remoteDCName, remoteDCName, networkCredential); } else { ProxyServerSettings proxyServerSettings; if (targetMdbGuid != Guid.Empty) { proxyServerSettings = CommonUtils.MapDatabaseToProxyServer(targetMdbGuid); } else { proxyServerSettings = CommonUtils.MapMailboxToProxyServer(new Guid?(physicalMailboxGuid), new Guid?(primaryMailboxGuid), partitionHint); } if (flag) { if (proxyServerSettings.Scenario == ProxyScenarios.LocalMdbAndProxy) { mailbox = new StorageSourceMailbox(LocalMailboxFlags.Move); } else { mailbox = new RemoteSourceMailbox(proxyServerSettings.Fqdn, null, null, ProxyControlFlags.DoNotApplyProxyThrottling, null, false, LocalMailboxFlags.Move); } mbxType = MailboxType.SourceMailbox; } else { if (proxyServerSettings.Scenario == ProxyScenarios.LocalMdbAndProxy) { mailbox = new StorageDestinationMailbox(LocalMailboxFlags.Move); } else { mailbox = new RemoteDestinationMailbox(proxyServerSettings.Fqdn, null, null, ProxyControlFlags.DoNotApplyProxyThrottling, null, false, LocalMailboxFlags.Move); } mbxType = MailboxType.DestMailboxIntraOrg; } } } else { ProxyControlFlags proxyControlFlags = ProxyControlFlags.DoNotApplyProxyThrottling; RequestJobXML requestJobXML = XMLSerializableBase.Deserialize <RequestJobXML>(requestJobXml, true); if (requestJobXML != null) { using (TransactionalRequestJob transactionalRequestJob = new TransactionalRequestJob(requestJobXML)) { transactionalRequestJob.IsFake = true; proxyControlFlags |= transactionalRequestJob.GetProxyControlFlags(); } } if (flag) { mailbox = new RemoteSourceMailbox(remoteHostName, remoteOrgName, networkCredential, proxyControlFlags, null, true, LocalMailboxFlags.Move); mbxType = MailboxType.SourceMailbox; } else { mailbox = new RemoteDestinationMailbox(remoteHostName, remoteOrgName, networkCredential, proxyControlFlags, null, true, LocalMailboxFlags.Move); mbxType = MailboxType.DestMailboxCrossOrg; } } using (mailbox) { mailbox.Config(null, primaryMailboxGuid, physicalMailboxGuid, partitionHint2, targetMdbGuid, mbxType, null); if (!string.IsNullOrEmpty(targetMdbName)) { mailbox.ConfigMDBByName(targetMdbName); } mailbox.Connect(MailboxConnectFlags.None); using (SettingsContextBase.ActivateContext(mailbox as ISettingsContextProvider)) { info = mailbox.GetMailboxInformation(); ADUser aduser = mailbox.GetADUser(); if (!this.clientVersion[2] && aduser.HasSeparatedArchive) { throw new UnsupportedClientVersionPermanentException(this.clientVersion.ComputerName, this.clientVersion.ToString(), "ArchiveSeparation"); } info.UserDataXML = ConfigurableObjectXML.Serialize <ADUser>(aduser); info.ServerInformation = mailbox.GetMailboxServerInformation(); mailbox.Disconnect(); } } }, null); return(info); }
string IMailboxReplicationService.ValidateAndPopulateRequestJob(string requestJobXML, out string reportEntryXMLs) { string reportString = null; string resultString = null; try { this.ForwardKnownExceptions(delegate { List <ReportEntry> list = new List <ReportEntry>(); try { RequestJobXML requestJob = XMLSerializableBase.Deserialize <RequestJobXML>(requestJobXML, true); using (TransactionalRequestJob transactionalRequestJob = new TransactionalRequestJob(requestJob)) { transactionalRequestJob.IsFake = true; transactionalRequestJob.Identity = new RequestJobObjectId((transactionalRequestJob.RequestType == MRSRequestType.Move) ? transactionalRequestJob.ExchangeGuid : transactionalRequestJob.RequestGuid, (transactionalRequestJob.WorkItemQueueMdb == null) ? Guid.Empty : transactionalRequestJob.WorkItemQueueMdb.ObjectGuid, null); RequestIndexEntryProvider requestIndexEntryProvider = new RequestIndexEntryProvider(); using (requestIndexEntryProvider.RescopeTo(transactionalRequestJob.DomainControllerToUpdate, transactionalRequestJob.OrganizationId)) { if (transactionalRequestJob.SourceUserId != null) { transactionalRequestJob.SourceUser = requestIndexEntryProvider.ReadADUser(transactionalRequestJob.SourceUserId, transactionalRequestJob.SourceExchangeGuid); } if (transactionalRequestJob.TargetUserId != null) { transactionalRequestJob.TargetUser = requestIndexEntryProvider.ReadADUser(transactionalRequestJob.TargetUserId, transactionalRequestJob.TargetExchangeGuid); } } if (MailboxSyncerJobs.ContainsJob(transactionalRequestJob.IdentifyingGuid)) { resultString = requestJobXML; } else { BaseJob baseJob = MailboxSyncerJobs.ConstructJob(transactionalRequestJob); if (baseJob == null) { MrsTracer.Service.Error("Don't know how to process '{0}' request", new object[] { transactionalRequestJob.RequestType }); throw new RequestTypeNotUnderstoodPermanentException(CommonUtils.LocalComputerName, VersionInformation.MRS.ToString(), (int)transactionalRequestJob.RequestType); } using (baseJob) { baseJob.Initialize(transactionalRequestJob); baseJob.ValidateAndPopulateRequestJob(list); transactionalRequestJob.Message = baseJob.CachedRequestJob.Message; transactionalRequestJob.SourceVersion = baseJob.CachedRequestJob.SourceVersion; transactionalRequestJob.SourceArchiveVersion = baseJob.CachedRequestJob.SourceArchiveVersion; transactionalRequestJob.SourceServer = baseJob.CachedRequestJob.SourceServer; transactionalRequestJob.SourceArchiveServer = baseJob.CachedRequestJob.SourceArchiveServer; transactionalRequestJob.TargetVersion = baseJob.CachedRequestJob.TargetVersion; transactionalRequestJob.TargetArchiveVersion = baseJob.CachedRequestJob.TargetArchiveVersion; transactionalRequestJob.TargetServer = baseJob.CachedRequestJob.TargetServer; transactionalRequestJob.TargetArchiveServer = baseJob.CachedRequestJob.TargetArchiveServer; transactionalRequestJob.RemoteDatabaseGuid = baseJob.CachedRequestJob.RemoteDatabaseGuid; resultString = XMLSerializableBase.Serialize(new RequestJobXML(transactionalRequestJob), false); } } } } finally { reportString = XMLSerializableBase.Serialize(list, false); } }, null); } finally { reportEntryXMLs = reportString; } return(resultString); }
internal static ConfigurableObjectXML Parse(string serializedData) { return(XMLSerializableBase.Deserialize <ConfigurableObjectXML>(serializedData, false)); }
internal static EasFolderSyncState Deserialize(byte[] data) { string @string = Encoding.UTF7.GetString(data); return(XMLSerializableBase.Deserialize <EasFolderSyncState>(@string, true)); }
public static ReplaySyncState Deserialize(string data) { return(XMLSerializableBase.Deserialize <ReplaySyncState>(data, true)); }
internal static PersistedSyncData Deserialize(string data) { return(XMLSerializableBase.Deserialize <PersistedSyncData>(data, true)); }
public static MailboxMapiSyncState Deserialize(string data) { return(XMLSerializableBase.Deserialize <MailboxMapiSyncState>(data, true)); }
public static StorageActionWatermark Deserialize(string data) { return(XMLSerializableBase.Deserialize <StorageActionWatermark>(data, true)); }
internal static EasHierarchySyncState Deserialize(string data) { return(XMLSerializableBase.Deserialize <EasHierarchySyncState>(data, false)); }
internal static PSTSyncStateDictionary Deserialize(string blob) { return(XMLSerializableBase.Deserialize <PSTSyncStateDictionary>(blob, false)); }
private void PrivateValidate(ConfigSchemaBase schema) { if ("EnableSettingsGroup" == base.ParameterSetName) { HashSet <string> hashSet = new HashSet <string>(); foreach (string text in new string[] { this.EnableGroup, this.DisableGroup }) { if (!string.IsNullOrEmpty(text)) { if (!this.DataObject.Settings.ContainsKey(text)) { base.WriteError(new ExchangeSettingsGroupNotFoundException(text), ExchangeErrorCategory.Client, this.DataObject); } if (hashSet.Contains(text)) { base.WriteError(new ExchangeSettingsGroupFoundMultipleTimesException(text), ExchangeErrorCategory.Client, this.DataObject); } hashSet.Add(text); } } if (hashSet.Count <= 0) { base.WriteError(new RecipientTaskException(Strings.ExchangeSettingsEnableUsage), ExchangeErrorCategory.Client, this.DataObject); } return; } if ("CreateSettingsGroupAdvanced" == base.ParameterSetName || "UpdateSettingsGroupAdvanced" == base.ParameterSetName) { this.SelectedSettingsGroup = XMLSerializableBase.Deserialize <SettingsGroup>(this.SettingsGroup, InternalExchangeSettingsSchema.ConfigurationXMLRaw); this.ValidateGroupName(this.SelectedSettingsGroup.Name, "CreateSettingsGroupAdvanced" == base.ParameterSetName); this.ValidatePriority(this.SelectedSettingsGroup.Priority); this.ValidateSettingsGroup(schema); return; } bool flag = "CreateSettingsGroup" == base.ParameterSetName || "CreateSettingsGroupGeneric" == base.ParameterSetName; this.ValidateGroupName(this.GroupName, flag); if (flag) { this.SelectedSettingsGroup = this.CreateNewSettingsGroup(); if (!this.Disable) { this.SelectedSettingsGroup.Enabled = true; } } else if (this.GroupName == "default" && !this.DataObject.Settings.ContainsKey(this.GroupName) && ("UpdateSetting" == base.ParameterSetName || "UpdateMultipleSettings" == base.ParameterSetName)) { base.WriteVerbose(new LocalizedString(string.Format("Creating default group for new settings", new object[0]))); this.SelectedSettingsGroup = this.CreateNewSettingsGroup(); this.SelectedSettingsGroup.Enabled = true; this.DataObject.AddSettingsGroup(this.SelectedSettingsGroup); } else if (!this.ClearHistory || this.IsFieldSet("GroupName")) { this.SelectedSettingsGroup = this.DataObject.GetSettingsGroupForModification(this.GroupName); } if (this.IsFieldSet("Priority")) { this.ValidatePriority(this.Priority); this.SelectedSettingsGroup.Priority = this.Priority; } else if (flag) { this.ValidatePriority(this.SelectedSettingsGroup.Priority); } if ("UpdateSettingsGroup" == base.ParameterSetName) { if (this.IsFieldSet("ScopeFilter")) { if (!this.SelectedSettingsGroup.HasExplicitScopeFilter && (this.SelectedSettingsGroup.Scopes.Count != 1 || !(this.SelectedSettingsGroup.Scopes[0] is SettingsForestScope))) { base.WriteError(new ExchangeSettingsCannotChangeScopeFilterOnDownlevelGroupException(this.GroupName), ExchangeErrorCategory.Client, this.DataObject); } this.SelectedSettingsGroup.ScopeFilter = this.ScopeFilter; } if (this.IsFieldSet("ExpirationDate")) { if (this.ExpirationDate != null && this.ExpirationDate.Value < DateTime.UtcNow) { this.WriteWarning(Strings.ExchangeSettingsExpirationDateIsInThePastWarning(this.ExpirationDate.Value.ToString())); } this.SelectedSettingsGroup.ExpirationDate = (this.ExpirationDate ?? DateTime.MinValue); } } if (this.ScopeId == null && ("RemoveScope" == base.ParameterSetName || "UpdateScope" == base.ParameterSetName)) { if (this.SelectedSettingsGroup.Scopes.Count != 1) { base.WriteError(new ExchangeSettingsDefaultScopeNotFoundException(this.GroupName), ExchangeErrorCategory.Client, this.DataObject); } this.ScopeId = new Guid?(this.SelectedSettingsGroup.Scopes[0].ScopeId); base.WriteVerbose(new LocalizedString(string.Format("Using default scope {0}", this.ScopeId))); } if ("RemoveScope" == base.ParameterSetName) { if (this.SelectedSettingsGroup.HasExplicitScopeFilter) { base.WriteError(new ExchangeSettingsCannotChangeScopeOnScopeFilteredGroupException(this.GroupName), ExchangeErrorCategory.Client, this.DataObject); } int num = this.SelectedSettingsGroup.Scopes.RemoveAll((SettingsScope x) => x.ScopeId == this.ScopeId); if (num <= 0) { base.WriteError(new ExchangeSettingsScopeNotFoundException(this.GroupName, this.ScopeId.ToString()), ExchangeErrorCategory.Client, this.DataObject); } if (this.SelectedSettingsGroup.Scopes.Count <= 0) { this.SelectedSettingsGroup.Scopes.Add(new SettingsForestScope()); } } else if ("AddScope" == base.ParameterSetName) { if (this.SelectedSettingsGroup.HasExplicitScopeFilter) { base.WriteError(new ExchangeSettingsCannotChangeScopeOnScopeFilteredGroupException(this.GroupName), ExchangeErrorCategory.Client, this.DataObject); } this.SelectedSettingsGroup.Scopes.Add(this.CreateDownlevelScope()); } else if ("UpdateScope" == base.ParameterSetName) { if (this.SelectedSettingsGroup.HasExplicitScopeFilter) { base.WriteError(new ExchangeSettingsCannotChangeScopeOnScopeFilteredGroupException(this.GroupName), ExchangeErrorCategory.Client, this.DataObject); } SettingsScope settingsScope = this.SelectedSettingsGroup.Scopes.Find((SettingsScope x) => x.ScopeId == this.ScopeId); if (settingsScope == null) { base.WriteError(new ExchangeSettingsScopeNotFoundException(this.GroupName, this.ScopeId.ToString()), ExchangeErrorCategory.Client, this.DataObject); } this.WriteWarning(new LocalizedString("The use of Scopes is deprecated, use ScopeFilter instead.")); if (settingsScope is SettingsForestScope) { base.WriteError(new ExchangeSettingsUpdateScopeForestException(this.GroupName, this.ScopeId.ToString()), ExchangeErrorCategory.Client, this.DataObject); } else if (settingsScope is SettingsGenericScope) { if (this.IsFieldSet("GenericScopeName")) { settingsScope.Restriction.SubType = this.GenericScopeName; } if (this.IsFieldSet("GenericScopeValue")) { settingsScope.Restriction.NameMatch = this.GenericScopeValue; } } else { if (this.IsFieldSet("NameMatch")) { settingsScope.Restriction.NameMatch = this.NameMatch; } if (this.IsFieldSet("GuidMatch") && this.GuidMatch != null) { settingsScope.Restriction.NameMatch = this.GuidMatch.ToString(); } if (this.IsFieldSet("MinVersion")) { settingsScope.Restriction.MinVersion = this.MinVersion; } if (this.IsFieldSet("MaxVersion")) { settingsScope.Restriction.MaxVersion = this.MaxVersion; } } } if ("UpdateSettingsGroup" == base.ParameterSetName || "CreateSettingsGroup" == base.ParameterSetName || "AddScope" == base.ParameterSetName || "UpdateScope" == base.ParameterSetName || "CreateSettingsGroupGeneric" == base.ParameterSetName || "RemoveScope" == base.ParameterSetName) { this.ValidateSettingsGroup(schema); } if ("UpdateSetting" == base.ParameterSetName || "RemoveSetting" == base.ParameterSetName) { this.ModifiedSettings = new List <KeyValuePair <string, string> >(1); this.ModifiedSettings.Add(new KeyValuePair <string, string>(this.ConfigName, this.ConfigValue)); } else if ("UpdateMultipleSettings" == base.ParameterSetName || "RemoveMultipleSettings" == base.ParameterSetName) { this.ModifiedSettings = new List <KeyValuePair <string, string> >(this.ConfigPairs.Length); foreach (string text2 in this.ConfigPairs) { string key = text2; string value = null; int num2 = text2.IndexOf('='); if (num2 < 0) { if ("UpdateMultipleSettings" == base.ParameterSetName) { base.WriteError(new ExchangeSettingsBadFormatOfConfigPairException(text2), ExchangeErrorCategory.Client, this.DataObject); } } else { key = text2.Substring(0, num2); value = text2.Substring(num2 + 1); } this.ModifiedSettings.Add(new KeyValuePair <string, string>(key, value)); } } if (("UpdateSetting" == base.ParameterSetName || "UpdateMultipleSettings" == base.ParameterSetName) && !this.Force) { foreach (KeyValuePair <string, string> keyValuePair in this.ModifiedSettings) { try { schema.ParseAndValidateConfigValue(keyValuePair.Key, keyValuePair.Value, null); } catch (ConfigurationSettingsException exception) { base.WriteError(exception, ExchangeErrorCategory.Client, this.DataObject); } } } }