Exemple #1
0
        protected override void ProcessMetabaseProperties(ExchangeVirtualDirectory dataObject)
        {
            TaskLogger.LogEnter();
            base.ProcessMetabaseProperties(dataObject);
            ADOwaVirtualDirectory adowaVirtualDirectory = (ADOwaVirtualDirectory)dataObject;

            try
            {
                WebAppVirtualDirectoryHelper.UpdateFromMetabase(adowaVirtualDirectory);
                if (adowaVirtualDirectory.GzipLevel != GzipLevel.Off && !adowaVirtualDirectory.IsExchange2007OrLater && this.IsMailboxRoleInstalled(adowaVirtualDirectory))
                {
                    this.WriteWarning(Strings.OwaGzipEnabledOnLegacyVirtualDirectoryWhenMailboxRoleInstalledWarning(adowaVirtualDirectory.Id.Name));
                }
            }
            catch (Exception ex)
            {
                TaskLogger.Trace("Exception occurred: {0}", new object[]
                {
                    ex.Message
                });
                this.WriteError(new LocalizedException(Strings.OwaMetabaseGetPropertiesFailure), ErrorCategory.InvalidOperation, null, false);
            }
            finally
            {
                TaskLogger.LogExit();
            }
        }
        protected override void ProcessMetabaseProperties(ExchangeVirtualDirectory dataObject)
        {
            TaskLogger.LogEnter();
            base.ProcessMetabaseProperties(dataObject);
            ADEcpVirtualDirectory webAppVirtualDirectory = (ADEcpVirtualDirectory)dataObject;

            WebAppVirtualDirectoryHelper.UpdateFromMetabase(webAppVirtualDirectory);
            TaskLogger.LogExit();
        }
        internal static T FindWebAppVirtualDirectoryInSameWebSite <T>(ExchangeWebAppVirtualDirectory source, IConfigDataProvider dataProvider) where T : ExchangeWebAppVirtualDirectory, new()
        {
            T result = default(T);

            IConfigurable[] array = dataProvider.Find <T>(null, source.Server, true, null);
            if (array != null)
            {
                foreach (ExchangeWebAppVirtualDirectory exchangeWebAppVirtualDirectory in array)
                {
                    if (IisUtility.Exists(exchangeWebAppVirtualDirectory.MetabasePath))
                    {
                        WebAppVirtualDirectoryHelper.UpdateFromMetabase(exchangeWebAppVirtualDirectory);
                        if (string.Equals(source.WebSite, exchangeWebAppVirtualDirectory.WebSite, StringComparison.OrdinalIgnoreCase))
                        {
                            result = (T)((object)exchangeWebAppVirtualDirectory);
                            break;
                        }
                    }
                }
            }
            return(result);
        }
 protected override void StampChangesOn(IConfigurable dataObject)
 {
     WebAppVirtualDirectoryHelper.UpdateFromMetabase((ExchangeWebAppVirtualDirectory)dataObject);
     dataObject.ResetChangeTracking();
     base.StampChangesOn(dataObject);
 }