public async Task DownloadApplicationBinaries(AppIdentity appIdentity, string localPath,
                                                      ConflictResolutionMode conflictResolutionMode)
        {
            bool exists = !FileUtils.DirectoryDoesntExistOrEmpty(localPath);

            if (exists)
            {
                if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
                {
                    return;
                }
                if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
                {
                    throw new DuplicateBinariesException(
                              $"Cannot download the binaries because the destination directory {localPath} contains files");
                }
            }
            CloudBlobDirectory blobDirectory = GetBlobDirectory(appIdentity);

            if (!await blobDirectory.ExistsAsync())
            {
                throw new BinariesNotFoundException("The binaries were not found in the Yams repository");
            }
            await BlobUtils.DownloadBlobDirectory(blobDirectory, localPath);
        }
        public async Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath,
                                                    ConflictResolutionMode conflictResolutionMode)
        {
            if (FileUtils.DirectoryDoesntExistOrEmpty(localPath))
            {
                throw new BinariesNotFoundException(
                          $"Binaries were not be uploaded because they were not found at the given path {localPath}");
            }

            if (conflictResolutionMode == ConflictResolutionMode.OverwriteExistingBinaries)
            {
                await DeleteApplicationBinaries(appIdentity);
            }
            else
            {
                bool exists = await HasApplicationBinaries(appIdentity);

                if (exists)
                {
                    if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
                    {
                        return;
                    }

                    if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
                    {
                        throw new DuplicateBinariesException(
                                  $"Cannot override binaries when flag {ConflictResolutionMode.FailIfBinariesExist} is used");
                    }
                }
            }

            // at this point we know that it is either OverwriteExistingBinaries mode or the binaries don't exist
            await BlobUtils.UploadDirectory(localPath, _blobContainer, GetBlobDirectoryRelPath(appIdentity));
        }
Esempio n. 3
0
        /// <summary>
        /// Update item.
        /// </summary>
        /// <param name="parentFolderId">The parent folder id.</param>
        /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
        /// <param name="messageDisposition">The message disposition.</param>
        /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param>
        /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
        /// <returns>Updated item.</returns>
        internal Item InternalUpdate(
            FolderId parentFolderId,
            ConflictResolutionMode conflictResolutionMode,
            MessageDisposition?messageDisposition,
            SendInvitationsOrCancellationsMode?sendInvitationsOrCancellationsMode,
            bool suppressReadReceipts)
        {
            this.ThrowIfThisIsNew();
            this.ThrowIfThisIsAttachment();

            Item returnedItem = null;

            if (this.IsDirty && this.PropertyBag.GetIsUpdateCallNecessary())
            {
                returnedItem = this.Service.UpdateItem(
                    this,
                    parentFolderId,
                    conflictResolutionMode,
                    messageDisposition,
                    sendInvitationsOrCancellationsMode.HasValue ? sendInvitationsOrCancellationsMode : this.DefaultSendInvitationsOrCancellationsMode,
                    suppressReadReceipts);
            }

            // Regardless of whether item is dirty or not, if it has unprocessed
            // attachment changes, validate them and process now.
            if (this.HasUnprocessedAttachmentChanges())
            {
                this.Attachments.Validate();
                this.Attachments.Save();
            }

            return(returnedItem);
        }
Esempio n. 4
0
 /// <summary>
 /// Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <returns>
 /// A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or
 /// a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence
 /// pattern; or null in every other case.
 /// </returns>
 public new Task Update(ConflictResolutionMode conflictResolutionMode)
 {
     return((Task)this.InternalUpdate(
                null /* parentFolder */,
                conflictResolutionMode,
                MessageDisposition.SaveOnly,
                null));
 }
        private static async Task UploadTestApplicationBinaries(ConflictResolutionMode conflictResolutionMode, string testFileContent)
        {
            string testDir = await CreateTestTempDirectory(nameof(UploadTestApplicationBinaries));

            CreateTestFile(testDir, testFileContent);

            await _deploymentRepository.UploadApplicationBinaries(TestAppIdentity, testDir, conflictResolutionMode);
        }
Esempio n. 6
0
 /// <summary>
 /// Update item.
 /// </summary>
 /// <param name="parentFolderId">The parent folder id.</param>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="messageDisposition">The message disposition.</param>
 /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param>
 /// <returns>Updated item.</returns>
 internal Item InternalUpdate(
     FolderId parentFolderId,
     ConflictResolutionMode conflictResolutionMode,
     MessageDisposition?messageDisposition,
     SendInvitationsOrCancellationsMode?sendInvitationsOrCancellationsMode)
 {
     return(this.InternalUpdate(parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode, false));
 }
Esempio n. 7
0
 /// <summary>
 /// Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <returns>
 /// A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or
 /// a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence
 /// pattern; or null in every other case.
 /// </returns>
 public new async Task <Task> Update(ConflictResolutionMode conflictResolutionMode, CancellationToken token = default(CancellationToken))
 {
     return((Task)await this.InternalUpdate(
                null /* parentFolder */,
                conflictResolutionMode,
                MessageDisposition.SaveOnly,
                null,
                token));
 }
Esempio n. 8
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
 public Task <Item> Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts)
 {
     return(this.InternalUpdate(
                null /* parentFolder */,
                conflictResolutionMode,
                MessageDisposition.SaveOnly,
                null,
                suppressReadReceipts));
 }
Esempio n. 9
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
 public void Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts)
 {
     this.InternalUpdate(
         null /* parentFolder */,
         conflictResolutionMode,
         MessageDisposition.SaveOnly,
         null,
         suppressReadReceipts);
 }
Esempio n. 10
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
 public Task <Item> Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts, CancellationToken token = default(CancellationToken))
 {
     return(this.InternalUpdate(
                null /* parentFolder */,
                conflictResolutionMode,
                MessageDisposition.SaveOnly,
                null,
                suppressReadReceipts,
                token));
 }
Esempio n. 11
0
 /// <summary>
 /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param>
 public void Update(
     ConflictResolutionMode conflictResolutionMode,
     SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)
 {
     this.InternalUpdate(
         null,
         conflictResolutionMode,
         null,
         sendInvitationsOrCancellationsMode);
 }
Esempio n. 12
0
 /// <summary>
 /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param>
 public Task <Item> Update(
     ConflictResolutionMode conflictResolutionMode,
     SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)
 {
     return(this.InternalUpdate(
                null,
                conflictResolutionMode,
                null,
                sendInvitationsOrCancellationsMode));
 }
Esempio n. 13
0
 /// <summary>
 /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param>
 public Task <Item> Update(
     ConflictResolutionMode conflictResolutionMode,
     SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode,
     CancellationToken token = default(CancellationToken))
 {
     return(this.InternalUpdate(
                null,
                conflictResolutionMode,
                null,
                sendInvitationsOrCancellationsMode,
                token));
 }
 public async Task DownloadApplicationBinaries(AppIdentity appIdentity, string localPath,
     ConflictResolutionMode conflictResolutionMode)
 {
     bool exists = !FileUtils.DirectoryDoesntExistOrEmpty(localPath);
     if (exists)
     {
         if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
         {
             return;
         }
         if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
         {
             throw new DuplicateBinariesException(
                 $"Cannot download the binaries because the destination directory {localPath} contains files");
         }
     }
     CloudBlobDirectory blobDirectory = GetBlobDirectory(appIdentity);
     if (!await blobDirectory.ExistsAsync())
     {
         throw new BinariesNotFoundException("The binaries were not found in the Yams repository");
     }
     await BlobUtils.DownloadBlobDirectory(blobDirectory, localPath);
 }
Esempio n. 15
0
        public Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode)
        {
            if (FileUtils.DirectoryDoesntExistOrEmpty(localPath))
            {
                throw new BinariesNotFoundException(
                    $"Binaries were not be uploaded because they were not found at the given path {localPath}");
            }

            string destPath = GetBinariesPath(appIdentity);
            bool binariesExist = FileUtils.DirectoryDoesntExistOrEmpty(destPath);
            if (binariesExist)
            {
                if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
                {
                    return Task.CompletedTask;
                }
                if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
                {
                    throw new DuplicateBinariesException();
                }
            }
            return FileUtils.CopyDir(_path, localPath, true);
        }
        public async Task DownloadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode)
        {
            var exists = !FileUtils.DirectoryDoesntExistOrEmpty(localPath);

            if (exists)
            {
                if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
                {
                    return;
                }

                if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
                {
                    throw new DuplicateBinariesException(
                              $"Cannot download the binaries because the destination directory {localPath} contains files");
                }
            }

            var path = GetBinariesPath(appIdentity);

            if (FileUtils.DirectoryDoesntExistOrEmpty(path))
            {
                throw new BinariesNotFoundException($"The binaries were not found in the Yams repository");
            }

            await FileUtils.CopyDir(path, localPath, true);
        }
Esempio n. 17
0
        public Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath, ConflictResolutionMode conflictResolutionMode)
        {
            if (FileUtils.DirectoryDoesntExistOrEmpty(localPath))
            {
                throw new BinariesNotFoundException(
                          $"Binaries were not be uploaded because they were not found at the given path {localPath}");
            }

            string destPath      = GetBinariesPath(appIdentity);
            bool   binariesExist = FileUtils.DirectoryDoesntExistOrEmpty(destPath);

            if (binariesExist)
            {
                if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
                {
                    return(Task.CompletedTask);
                }
                if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
                {
                    throw new DuplicateBinariesException();
                }
            }
            return(FileUtils.CopyDir(_path, localPath, true));
        }
Esempio n. 18
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 public async System.Threading.Tasks.Task UpdateAsync(ConflictResolutionMode conflictResolutionMode)
 {
     await this.UpdateAsync(conflictResolutionMode, false);
 }
Esempio n. 19
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 public Task <Item> Update(ConflictResolutionMode conflictResolutionMode)
 {
     return(this.Update(conflictResolutionMode, false));
 }
Esempio n. 20
0
 public SqlContainerImpl WithConflictResolutionProcedure(ConflictResolutionMode mode, string conflictResolutionProcedure)
 {
     return(this.WithConflictResolutionPolicy(new Models.ConflictResolutionPolicy(mode: mode, conflictResolutionProcedure: conflictResolutionProcedure)));
 }
Esempio n. 21
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 public void Update(ConflictResolutionMode conflictResolutionMode)
 {
     this.Update(conflictResolutionMode, false);
 }
Esempio n. 22
0
        /// <summary>
        /// Update item.
        /// </summary>
        /// <param name="parentFolderId">The parent folder id.</param>
        /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
        /// <param name="messageDisposition">The message disposition.</param>
        /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param>
        /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
        /// <returns>Updated item.</returns>
        internal Item InternalUpdate(
            FolderId parentFolderId,
            ConflictResolutionMode conflictResolutionMode,
            MessageDisposition? messageDisposition,
            SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode,
            bool suppressReadReceipts)
        {
            this.ThrowIfThisIsNew();
            this.ThrowIfThisIsAttachment();

            Item returnedItem = null;

            if (this.IsDirty && this.PropertyBag.GetIsUpdateCallNecessary())
            {
                returnedItem = this.Service.UpdateItem(
                    this,
                    parentFolderId,
                    conflictResolutionMode,
                    messageDisposition,
                    sendInvitationsOrCancellationsMode.HasValue ? sendInvitationsOrCancellationsMode : this.DefaultSendInvitationsOrCancellationsMode,
                    suppressReadReceipts);
            }

            // Regardless of whether item is dirty or not, if it has unprocessed
            // attachment changes, validate them and process now.
            if (this.HasUnprocessedAttachmentChanges())
            {
                this.Attachments.Validate();
                this.Attachments.Save();
            }

            return returnedItem;
        }
Esempio n. 23
0
 /// <summary>
 /// Update item.
 /// </summary>
 /// <param name="parentFolderId">The parent folder id.</param>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="messageDisposition">The message disposition.</param>
 /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param>
 /// <returns>Updated item.</returns>
 internal Item InternalUpdate(
     FolderId parentFolderId,
     ConflictResolutionMode conflictResolutionMode,
     MessageDisposition? messageDisposition,
     SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode)
 {
     return this.InternalUpdate(parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode, false);
 }
        public async Task UploadApplicationBinaries(AppIdentity appIdentity, string localPath,
            ConflictResolutionMode conflictResolutionMode)
        {
            if (FileUtils.DirectoryDoesntExistOrEmpty(localPath))
            {
                throw new BinariesNotFoundException(
                    $"Binaries were not be uploaded because they were not found at the given path {localPath}");
            }

            if (conflictResolutionMode == ConflictResolutionMode.OverwriteExistingBinaries)
            {
                await DeleteApplicationBinaries(appIdentity);
            }
            else
            {
                bool exists = await HasApplicationBinaries(appIdentity);

                if (exists)
                {
                    if (conflictResolutionMode == ConflictResolutionMode.DoNothingIfBinariesExist)
                    {
                        return;
                    }

                    if (conflictResolutionMode == ConflictResolutionMode.FailIfBinariesExist)
                    {
                        throw new DuplicateBinariesException(
                            $"Cannot override binaries when flag {ConflictResolutionMode.FailIfBinariesExist} is used");
                    }
                }
            }

            // at this point we know that it is either OverwriteExistingBinaries mode or the binaries don't exist
            await BlobUtils.UploadDirectory(localPath, _blobContainer, GetBlobDirectoryRelPath(appIdentity));
        }
Esempio n. 25
0
 public SqlContainerImpl WithConflictResolutionPath(ConflictResolutionMode mode, string conflictResolutionPath)
 {
     return(this.WithConflictResolutionPolicy(new Models.ConflictResolutionPolicy(mode: mode, conflictResolutionPath: conflictResolutionPath)));
 }
Esempio n. 26
0
 /// <summary>
 /// Applies the local changes that have been made to this appointment. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <param name="sendInvitationsOrCancellationsMode">Specifies if and how invitations or cancellations should be sent if this appointment is a meeting.</param>
 public void Update(
     ConflictResolutionMode conflictResolutionMode,
     SendInvitationsOrCancellationsMode sendInvitationsOrCancellationsMode)
 {
     this.InternalUpdate(
         null,
         conflictResolutionMode,
         null,
         sendInvitationsOrCancellationsMode);
 }
Esempio n. 27
0
 /// <summary>
 /// Applies the local changes that have been made to this task. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">Specifies how conflicts should be resolved.</param>
 /// <returns>
 /// A Task object representing the completed occurrence if the task is recurring and the update marks it as completed; or
 /// a Task object representing the current occurrence if the task is recurring and the uypdate changed its recurrence
 /// pattern; or null in every other case.
 /// </returns>
 public new Task Update(ConflictResolutionMode conflictResolutionMode)
 {
     return (Task)this.InternalUpdate(
         null /* parentFolder */,
         conflictResolutionMode,
         MessageDisposition.SaveOnly,
         null);
 }
Esempio n. 28
0
 /// <summary>
 /// Update item.
 /// </summary>
 /// <param name="parentFolderId">The parent folder id.</param>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="messageDisposition">The message disposition.</param>
 /// <param name="sendInvitationsOrCancellationsMode">The send invitations or cancellations mode.</param>
 /// <returns>Updated item.</returns>
 internal async System.Threading.Tasks.Task<Item> InternalUpdateAsync(
     FolderId parentFolderId,
     ConflictResolutionMode conflictResolutionMode,
     MessageDisposition? messageDisposition,
     SendInvitationsOrCancellationsMode? sendInvitationsOrCancellationsMode)
 {
     return await this.InternalUpdateAsync(parentFolderId, conflictResolutionMode, messageDisposition, sendInvitationsOrCancellationsMode, false);
 }
Esempio n. 29
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 public void Update(ConflictResolutionMode conflictResolutionMode)
 {
     this.Update(conflictResolutionMode, false);
 }
Esempio n. 30
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
 public async System.Threading.Tasks.Task UpdateAsync(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts)
 {
     await this.InternalUpdateAsync(
         null /* parentFolder */,
         conflictResolutionMode,
         MessageDisposition.SaveOnly,
         null,
         suppressReadReceipts);
 }
Esempio n. 31
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 /// <param name="suppressReadReceipts">Whether to suppress read receipts</param>
 public void Update(ConflictResolutionMode conflictResolutionMode, bool suppressReadReceipts)
 {
     this.InternalUpdate(
         null /* parentFolder */,
         conflictResolutionMode,
         MessageDisposition.SaveOnly,
         null,
         suppressReadReceipts);
 }
Esempio n. 32
0
 /// <summary>
 /// Applies the local changes that have been made to this item. Calling this method results in at least one call to EWS.
 /// Mutliple calls to EWS might be made if attachments have been added or removed.
 /// </summary>
 /// <param name="conflictResolutionMode">The conflict resolution mode.</param>
 public Task <Item> Update(ConflictResolutionMode conflictResolutionMode, CancellationToken token = default(CancellationToken))
 {
     return(this.Update(conflictResolutionMode, false, token));
 }