Exemplo n.º 1
0
 private void ValidateShadowRetryValueGreaterThanZero(int value, string name, ShadowMessagePreference preference)
 {
     if (value <= 0)
     {
         base.WriteError(new InvalidShadowRedundancyConfigurationException(Strings.ErrorZeroOrLessValueForShadowRetry(name, preference.ToString())), ErrorCategory.InvalidOperation, base.Identity);
     }
 }
Exemplo n.º 2
0
        internal static object InternalShadowMessagePreferenceGetter(IPropertyBag bag)
        {
            TransportSettingFlags   transportSettingFlags   = (TransportSettingFlags)bag[ADAMTransportConfigContainerSchema.Flags];
            ShadowMessagePreference shadowMessagePreference = (ShadowMessagePreference)((transportSettingFlags & TransportSettingFlags.ShadowMessagePreferenceSetting) >> 27);

            return(EnumValidator.IsValidValue <ShadowMessagePreference>(shadowMessagePreference) ? shadowMessagePreference : ShadowMessagePreference.PreferRemote);
        }
Exemplo n.º 3
0
 private void ValidateShadowRedundancyPreference(TransportConfigContainer originalObject)
 {
     if (this.DataObject.IsModified(ADAMTransportConfigContainerSchema.MaxRetriesForRemoteSiteShadow) || this.DataObject.IsModified(ADAMTransportConfigContainerSchema.MaxRetriesForLocalSiteShadow) || this.IsFlagValueModified <ShadowMessagePreference>(originalObject, ADAMTransportConfigContainerSchema.ShadowMessagePreferenceSetting))
     {
         int value  = (int)this.DataObject[ADAMTransportConfigContainerSchema.MaxRetriesForLocalSiteShadow];
         int value2 = (int)this.DataObject[ADAMTransportConfigContainerSchema.MaxRetriesForRemoteSiteShadow];
         ShadowMessagePreference shadowMessagePreference = (ShadowMessagePreference)this.DataObject[ADAMTransportConfigContainerSchema.ShadowMessagePreferenceSetting];
         if (ShadowMessagePreference.LocalOnly == shadowMessagePreference)
         {
             this.ValidateShadowRetryValueZero(value2, "MaxRetriesForRemoteSiteShadow", shadowMessagePreference);
             this.ValidateShadowRetryValueGreaterThanZero(value, "MaxRetriesForLocalSiteShadow", shadowMessagePreference);
             return;
         }
         if (ShadowMessagePreference.RemoteOnly == shadowMessagePreference)
         {
             this.ValidateShadowRetryValueZero(value, "MaxRetriesForLocalSiteShadow", shadowMessagePreference);
             this.ValidateShadowRetryValueGreaterThanZero(value2, "MaxRetriesForRemoteSiteShadow", shadowMessagePreference);
             return;
         }
         if (shadowMessagePreference == ShadowMessagePreference.PreferRemote)
         {
             this.ValidateShadowRetryValueGreaterThanZero(value, "MaxRetriesForLocalSiteShadow", shadowMessagePreference);
             this.ValidateShadowRetryValueGreaterThanZero(value2, "MaxRetriesForRemoteSiteShadow", shadowMessagePreference);
         }
     }
 }