// Token: 0x06000494 RID: 1172 RVA: 0x0001C434 File Offset: 0x0001A634 internal override Command.ExecutionState ExecuteCommand() { try { XmlDocument xmlDocument = new SafeXmlDocument(); try { this.LoadSyncState(); this.ParseRequest(base.MailboxSession); this.ProcessCommand(base.MailboxSession, xmlDocument); if (((FolderIdMapping)this.syncState[CustomStateDatumType.IdMapping]).IsDirty) { this.syncState.Commit(); } } finally { if (this.syncState != null) { this.syncState.Dispose(); } this.syncState = null; } base.XmlResponse = xmlDocument; } catch (QuotaExceededException) { throw; } catch (ObjectNotFoundException innerException) { throw new AirSyncPermanentException(StatusCode.Sync_ProtocolError, CollectionCommand.ConstructErrorXml(StatusCode.Sync_ProtocolError), innerException, false) { ErrorStringForProtocolLogger = "FolderNotFound" }; } catch (StoragePermanentException ex) { throw new AirSyncPermanentException(StatusCode.Sync_ClientServerConversion, CollectionCommand.ConstructErrorXml(StatusCode.Sync_ClientServerConversion), ex, false) { ErrorStringForProtocolLogger = ex.GetType().FullName }; } return(Command.ExecutionState.Complete); }
// Token: 0x06000498 RID: 1176 RVA: 0x0001C590 File Offset: 0x0001A790 private void ParseRequest(MailboxSession mailboxSession) { this.collectionRequest = default(CollectionCommand.CollectionRequestStruct); string collectionId = this.CollectionId; if (collectionId != null) { MailboxSyncItemId mailboxSyncItemId = ((FolderIdMapping)this.syncState[CustomStateDatumType.IdMapping])[collectionId] as MailboxSyncItemId; if (mailboxSyncItemId == null) { throw new AirSyncPermanentException(StatusCode.Sync_ProtocolError, CollectionCommand.ConstructErrorXml(StatusCode.Sync_ProtocolError), null, false) { ErrorStringForProtocolLogger = "FolderNotFound2" }; } this.collectionRequest.CollectionId = (StoreObjectId)mailboxSyncItemId.NativeId; AirSyncDiagnostics.TraceDebug <string, StoreObjectId>(ExTraceGlobals.RequestsTracer, this, "Received request with syncCollectionId {0}, which maps to collection Id {1}.", collectionId, this.collectionRequest.CollectionId); } string parentId = this.ParentId; if (parentId == "0") { this.collectionRequest.ParentId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Root); } else if (parentId != null) { MailboxSyncItemId mailboxSyncItemId2 = ((FolderIdMapping)this.syncState[CustomStateDatumType.IdMapping])[parentId] as MailboxSyncItemId; if (mailboxSyncItemId2 == null) { throw new AirSyncPermanentException(StatusCode.Sync_ServerError, CollectionCommand.ConstructErrorXml(StatusCode.Sync_ServerError), null, false) { ErrorStringForProtocolLogger = "NoIdMappingForParentId" }; } this.collectionRequest.ParentId = (StoreObjectId)mailboxSyncItemId2.NativeId; AirSyncDiagnostics.TraceDebug <string, StoreObjectId>(ExTraceGlobals.RequestsTracer, this, "Received request with syncParentId {0}, which maps to parent Id {1}.", parentId, this.collectionRequest.ParentId); } this.collectionRequest.CollectionName = this.CollectionName; }
// Token: 0x06000496 RID: 1174 RVA: 0x0001C530 File Offset: 0x0001A730 protected override bool HandleQuarantinedState() { base.XmlResponse = CollectionCommand.ConstructErrorXml(StatusCode.Sync_ClientServerConversion); return(false); }
protected override void ProcessCommand(MailboxSession mailboxSession, XmlDocument doc) { if (base.CollectionRequest.CollectionName == null || base.CollectionRequest.ParentId == null || base.CollectionRequest.CollectionId == null) { base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "InvalidURLParameters"); throw new AirSyncPermanentException(HttpStatusCode.BadRequest, StatusCode.InvalidCombinationOfIDs, null, false); } using (Folder folder = Folder.Bind(mailboxSession, base.CollectionRequest.CollectionId, null)) { if (folder.DisplayName == base.CollectionRequest.CollectionName && folder.ParentId.Equals(base.CollectionRequest.ParentId)) { base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "FolderExistsInCollectionMove"); throw new AirSyncPermanentException(StatusCode.Sync_ProtocolVersionMismatch, CollectionCommand.ConstructErrorXml(StatusCode.Sync_ProtocolVersionMismatch), null, false); } if (base.CollectionRequest.CollectionName != null) { folder.DisplayName = base.CollectionRequest.CollectionName; folder.Save(); folder.Load(); } if (!base.CollectionRequest.ParentId.Equals(folder.ParentId)) { OperationResult operationResult = mailboxSession.Move(base.CollectionRequest.ParentId, new StoreObjectId[] { base.CollectionRequest.CollectionId }).OperationResult; if (operationResult != OperationResult.Succeeded) { base.ProtocolLogger.SetValue(ProtocolLoggerData.Error, "FolderNotFoundInCollectionMove"); throw new AirSyncPermanentException(StatusCode.Sync_ProtocolError, CollectionCommand.ConstructErrorXml(StatusCode.Sync_ProtocolError), null, false); } } } XmlNode xmlNode = doc.CreateElement("Response", "FolderHierarchy:"); XmlNode xmlNode2 = doc.CreateElement("Status", "FolderHierarchy:"); xmlNode2.InnerText = "1"; doc.AppendChild(xmlNode); xmlNode.AppendChild(xmlNode2); }