示例#1
0
 public StoreIntegrityCheckJobIdParameter(StoreIntegrityCheckJobIdentity objectId)
 {
     if (objectId == null)
     {
         throw new ArgumentNullException("objectId");
     }
     this.rawIdentity = objectId.ToString();
 }
示例#2
0
        void IIdentityParameter.Initialize(ObjectId objectId)
        {
            StoreIntegrityCheckJobIdentity storeIntegrityCheckJobIdentity = objectId as StoreIntegrityCheckJobIdentity;

            if (storeIntegrityCheckJobIdentity == null)
            {
                throw new ArgumentException("objectId");
            }
            this.rawIdentity = storeIntegrityCheckJobIdentity.ToString();
        }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            StoreIntegrityCheckJobIdentity storeIntegrityCheckJobIdentity = new StoreIntegrityCheckJobIdentity(this.Identity.RawIdentity);
            DatabaseIdParameter            databaseIdParameter            = new DatabaseIdParameter(new ADObjectId(storeIntegrityCheckJobIdentity.DatabaseGuid));

            this.jobGuid  = storeIntegrityCheckJobIdentity.JobGuid;
            this.database = (Database)base.GetDataObject <Database>(databaseIdParameter, this.ConfigurationSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(databaseIdParameter.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(databaseIdParameter.ToString())));
            TaskLogger.LogExit();
        }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            DatabaseIdParameter databaseIdParameter = null;
            Guid empty = Guid.Empty;

            if (base.ParameterSetName == "Identity")
            {
                if (this.Identity != null)
                {
                    StoreIntegrityCheckJobIdentity storeIntegrityCheckJobIdentity = new StoreIntegrityCheckJobIdentity(this.Identity.RawIdentity);
                    databaseIdParameter = new DatabaseIdParameter(new ADObjectId(storeIntegrityCheckJobIdentity.DatabaseGuid));
                    this.requestGuid    = storeIntegrityCheckJobIdentity.RequestGuid;
                    this.jobGuid        = storeIntegrityCheckJobIdentity.JobGuid;
                }
                else
                {
                    base.WriteError(new ArgumentNullException("identity"), ErrorCategory.InvalidArgument, null);
                }
            }
            else if (base.ParameterSetName == "Database")
            {
                databaseIdParameter = this.Database;
                if (this.StoreMailbox != null)
                {
                    Guid.TryParse(this.StoreMailbox.RawIdentity, out this.mailboxGuid);
                }
            }
            else if (base.ParameterSetName == "Mailbox")
            {
                ADUser aduser = ((ADRecipient)base.GetDataObject <ADRecipient>(this.Mailbox, this.RecipientSession, null, new LocalizedString?(Strings.ErrorMailboxNotFound(this.Mailbox.ToString())), new LocalizedString?(Strings.ErrorMailboxNotUnique(this.Mailbox.ToString())))) as ADUser;
                if (!this.Archive)
                {
                    databaseIdParameter = new DatabaseIdParameter(aduser.Database);
                    this.mailboxGuid    = aduser.ExchangeGuid;
                }
                else if (aduser.ArchiveDomain == null && aduser.ArchiveGuid != Guid.Empty)
                {
                    databaseIdParameter = new DatabaseIdParameter(aduser.ArchiveDatabase ?? aduser.Database);
                    this.mailboxGuid    = aduser.ArchiveGuid;
                }
                else if (aduser.ArchiveDomain != null)
                {
                    base.WriteError(new MdbAdminTaskException(Strings.ErrorRemoteArchiveNoStats(aduser.ToString())), (ErrorCategory)1003, this.Mailbox);
                }
                else
                {
                    base.WriteError(new MdbAdminTaskException(Strings.ErrorArchiveNotEnabled(aduser.ToString())), ErrorCategory.InvalidArgument, this.Mailbox);
                }
            }
            this.databaseObject = (Database)base.GetDataObject <Database>(databaseIdParameter, this.ConfigurationSession, null, new LocalizedString?(Strings.ErrorDatabaseNotFound(databaseIdParameter.ToString())), new LocalizedString?(Strings.ErrorDatabaseNotUnique(databaseIdParameter.ToString())));
            TaskLogger.LogExit();
        }