protected override IConfigurable ResolveDataObject() { this.Identity.AllowInvalid = true; this.m_dbCopy = (DatabaseCopy)base.GetDataObject <DatabaseCopy>(this.Identity, base.DataSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(this.Identity.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(this.Identity.ToString()))); if (base.Fields["ActivationPreference"] != null && (this.m_dbCopy.HostServerUnlinked || this.ClearHostServer)) { base.WriteError(new ArgumentException(Strings.ErrorActivationPreferenceNotAllowedWhenHostServerUnlinked), ErrorCategory.InvalidOperation, this.m_dbCopy); } Server server; DatabaseTasksHelper.ValidateDatabaseCopyActionTask(this.m_dbCopy, true, false, base.DataSession, this.RootId, new Task.TaskErrorLoggingDelegate(base.WriteError), Strings.ErrorMailboxDatabaseNotUnique(this.m_dbCopy.Identity.ToString()), null, out server); this.m_databaseCopies = this.m_dbCopy.GetAllDatabaseCopies(); return(this.m_dbCopy); }
protected override void InternalValidate() { TaskLogger.LogEnter(); base.InternalValidate(); if (base.HasErrors) { TaskLogger.LogExit(); return; } this.m_databaseCopy = this.DataObject; DatabaseTasksHelper.ValidateDatabaseCopyActionTask(this.m_databaseCopy, false, true, base.DataSession, this.RootId, new Task.TaskErrorLoggingDelegate(base.WriteError), Strings.ErrorMailboxDatabaseNotUnique(this.Identity.ToString()), new LocalizedString?(Strings.ErrorSingleDatabaseCopy(this.Identity.ToString())), out this.m_server); Database database = this.DataObject.GetDatabase <Database>(); if (database != null) { MapiTaskHelper.VerifyDatabaseIsWithinScope(base.SessionSettings, database, new Task.ErrorLoggerDelegate(base.WriteError)); } }
private void ValidateDatabaseCopy() { this.m_databaseCopy = base.DataObject; this.m_database = this.m_databaseCopy.GetDatabase <Database>(); DatabaseTasksHelper.ValidateDatabaseCopyActionTask(this.m_databaseCopy, true, true, base.DataSession, this.RootId, new Task.TaskErrorLoggingDelegate(base.WriteError), Strings.ErrorMailboxDatabaseNotUnique(this.m_database.Identity.ToString()), new LocalizedString?(Strings.ErrorSingleDatabaseCopyRemove(this.m_database.Identity.ToString(), this.m_databaseCopy.HostServerName)), out this.m_server); if (this.m_server == null) { this.m_serverName = this.m_databaseCopy.Name; } else { this.m_serverName = this.m_server.Name; } DatabaseCopy[] allDatabaseCopies = this.m_database.AllDatabaseCopies; this.m_originalCopiesLength = allDatabaseCopies.Length; if (this.m_originalCopiesLength == 2 && this.m_database.CircularLoggingEnabled) { base.WriteError(new InvalidOperationException(Strings.ErrorInvalidRemoveOperationOnDBCopyForCircularLoggingEnabledDB(this.m_database.Name)), ErrorCategory.InvalidOperation, base.DataObject.Identity); } }