Esempio n. 1
0
        internal static QueryFilter RetainDeletedItemsUntilBackupFilterBuilder(SinglePropertyFilter filter)
        {
            LegacyDatabase.InternalAssertComparisonFilter(filter, LegacyDatabaseSchema.RetainDeletedItemsUntilBackup);
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, LegacyDatabaseSchema.DelItemAfterBackupEnum, ((bool)comparisonFilter.PropertyValue) ? Microsoft.Exchange.Data.Directory.Recipient.DeletedItemRetention.RetainUntilBackupOrCustomPeriod : Microsoft.Exchange.Data.Directory.Recipient.DeletedItemRetention.RetainForCustomPeriod));
        }
Esempio n. 2
0
        internal static QueryFilter MountAtStartupFilterBuilder(SinglePropertyFilter filter)
        {
            LegacyDatabase.InternalAssertComparisonFilter(filter, LegacyDatabaseSchema.MountAtStartup);
            ComparisonFilter comparisonFilter = filter as ComparisonFilter;

            return(new ComparisonFilter(comparisonFilter.ComparisonOperator, LegacyDatabaseSchema.EdbOfflineAtStartup, !(bool)comparisonFilter.PropertyValue));
        }
Esempio n. 3
0
 protected override void ValidateWrite(List <ValidationError> errors)
 {
     base.ValidateWrite(errors);
     errors.AddRange(LegacyDatabase.ValidateAscendingQuotas(this.propertyBag, new ProviderPropertyDefinition[]
     {
         LegacyDatabaseSchema.IssueWarningQuota,
         LegacyPublicFolderDatabaseSchema.ProhibitPostQuota
     }, this.Identity));
     if (!this.UseCustomReferralServerList && this.CustomReferralServerList.Count != 0)
     {
         this.CustomReferralServerList.Clear();
     }
     foreach (ServerCostPair serverCostPair in this.CustomReferralServerList)
     {
         if (string.IsNullOrEmpty(serverCostPair.ServerName))
         {
             errors.Add(new ObjectValidationError(DirectoryStrings.PublicFolderReferralServerNotExisting(serverCostPair.ServerGuid.ToString()), this.Identity, string.Empty));
         }
     }
     if (this.CustomReferralServerList.Count > 1)
     {
         for (int i = 0; i < this.CustomReferralServerList.Count - 1; i++)
         {
             for (int j = i + 1; j < this.CustomReferralServerList.Count; j++)
             {
                 if (this.CustomReferralServerList[i].ServerGuid == this.CustomReferralServerList[j].ServerGuid && this.CustomReferralServerList[i].Cost != this.CustomReferralServerList[j].Cost)
                 {
                     errors.Add(new ObjectValidationError(DirectoryStrings.ErrorPublicFolderReferralConflict(this.CustomReferralServerList[i].ToString(), this.CustomReferralServerList[j].ToString()), this.Identity, string.Empty));
                     break;
                 }
             }
         }
     }
 }
Esempio n. 4
0
        internal static object StorageGroupNameGetter(IPropertyBag propertyBag)
        {
            ADObjectId adobjectId = (ADObjectId)LegacyDatabase.StorageGroupGetter(propertyBag);

            if (adobjectId == null)
            {
                return(LegacyDatabaseSchema.StorageGroupName.DefaultValue);
            }
            return(adobjectId.Name);
        }
 protected override void ValidateWrite(List <ValidationError> errors)
 {
     base.ValidateWrite(errors);
     errors.AddRange(LegacyDatabase.ValidateAscendingQuotas(this.propertyBag, new ProviderPropertyDefinition[]
     {
         LegacyDatabaseSchema.IssueWarningQuota,
         LegacyMailboxDatabaseSchema.ProhibitSendQuota,
         LegacyMailboxDatabaseSchema.ProhibitSendReceiveQuota
     }, this.Identity));
 }
Esempio n. 6
0
        internal static QueryFilter HasLocalCopyFilterBuilder(SinglePropertyFilter filter)
        {
            LegacyDatabase.InternalAssertComparisonFilter(filter, LegacyDatabaseSchema.HasLocalCopy);
            ComparisonFilter   comparisonFilter   = filter as ComparisonFilter;
            ComparisonOperator comparisonOperator = comparisonFilter.ComparisonOperator;

            if (comparisonOperator != ComparisonOperator.Equal && ComparisonOperator.NotEqual != comparisonOperator)
            {
                throw new ADFilterException(DirectoryStrings.ExceptionInvalidBitwiseComparison(LegacyDatabaseSchema.HasLocalCopy.Name, comparisonOperator.ToString()));
            }
            bool        flag        = (bool)comparisonFilter.PropertyValue;
            bool        flag2       = ComparisonOperator.Equal == comparisonOperator;
            QueryFilter queryFilter = new BitMaskAndFilter(LegacyDatabaseSchema.HasLocalCopyValue, 1UL);

            if (flag ^ flag2)
            {
                queryFilter = new NotFilter(queryFilter);
            }
            return(queryFilter);
        }