protected virtual void SaveExtendedProperties(IAnchorDataProvider provider)
 {
     AnchorUtil.AssertOrThrow(this.StoreObjectId != null, "Object should have been created before trying to save properties.", new object[0]);
     using (IAnchorStoreObject anchorStoreObject = this.FindStoreObject(provider, AnchorPersistableBase.MigrationBaseDefinitions))
     {
         anchorStoreObject.OpenAsReadWrite();
         this.WriteExtendedPropertiesToMessageItem(anchorStoreObject);
         anchorStoreObject.Save(SaveMode.FailOnAnyConflict);
     }
 }
예제 #2
0
        // Token: 0x060001E6 RID: 486 RVA: 0x00007328 File Offset: 0x00005528
        public IAnchorStoreObject GetFolderByName(string folderName, PropertyDefinition[] properties)
        {
            AnchorUtil.ThrowOnNullArgument(properties, "properties");
            AnchorUtil.AssertOrThrow(this.MailboxSession != null, "Should have a MailboxSession", new object[0]);
            IAnchorStoreObject result;

            using (DisposeGuard disposeGuard = default(DisposeGuard))
            {
                IAnchorStoreObject anchorStoreObject = AnchorFolder.GetFolder(this.anchorContext, this.MailboxSession, folderName);
                disposeGuard.Add <IAnchorStoreObject>(anchorStoreObject);
                anchorStoreObject.Load(properties);
                disposeGuard.Success();
                result = anchorStoreObject;
            }
            return(result);
        }
 public virtual void CreateInStore(IAnchorDataProvider dataProvider, Action <IAnchorStoreObject> streamAction)
 {
     AnchorUtil.ThrowOnNullArgument(dataProvider, "dataProvider");
     AnchorUtil.AssertOrThrow(this.StoreObjectId == null, "Object should not have been created already.", new object[0]);
     using (IAnchorStoreObject anchorStoreObject = this.CreateStoreObject(dataProvider))
     {
         if (streamAction != null)
         {
             streamAction(anchorStoreObject);
         }
         this.WriteToMessageItem(anchorStoreObject, false);
         anchorStoreObject.Save(SaveMode.FailOnAnyConflict);
         anchorStoreObject.Load(this.PropertyDefinitions);
         this.ReadStoreObjectIdProperties(anchorStoreObject);
     }
 }
예제 #4
0
        internal UpgradeHandlerScheduler(AnchorContext context, IOrganizationOperation orgOperationProxyInstance, ISymphonyProxy symphonyProxyInstance, WaitHandle stopEvent) : base(context, stopEvent)
        {
            string domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;

            AnchorUtil.AssertOrThrow(!string.IsNullOrEmpty(domainName), "Expect to have valid domain name set", new object[0]);
            int num = domainName.IndexOf('.');

            AnchorUtil.AssertOrThrow(num >= 0, "Expect a valid dns name {0}", new object[]
            {
                domainName
            });
            this.ForestName        = domainName.Substring(0, num);
            this.orgOperationProxy = orgOperationProxyInstance;
            if (orgOperationProxyInstance is OrgOperationProxy)
            {
                ((OrgOperationProxy)this.orgOperationProxy).Context = context;
            }
            this.symphonyProxy = symphonyProxyInstance;
            if (symphonyProxyInstance is SymphonyProxy)
            {
                ((SymphonyProxy)this.symphonyProxy).WorkloadUri = new Uri(context.Config.GetConfig <Uri>("WebServiceUri"), "WorkloadService.svc");
                ((SymphonyProxy)this.symphonyProxy).Cert        = CertificateHelper.GetExchangeCertificate(context.Config.GetConfig <string>("CertificateSubject"));
            }
        }
예제 #5
0
        protected override AnchorJobProcessorResult ProcessEntry(CacheEntryBase cacheEntry)
        {
            AuthAdminContext authAdminContext = base.Context as AuthAdminContext;

            AnchorUtil.AssertOrThrow(authAdminContext != null, "expect to have a valid AuthAdminContext", new object[0]);
            authAdminContext.Logger.Log(MigrationEventType.Information, "Checking if mailbox {0} active on current server", new object[]
            {
                cacheEntry
            });
            AnchorJobProcessorResult anchorJobProcessorResult = base.ProcessEntry(cacheEntry);

            if (anchorJobProcessorResult == AnchorJobProcessorResult.Deleted)
            {
                authAdminContext.Logger.Log(MigrationEventType.Information, "Mailbox {0} is not active on current server, skipping Auth Admin tasks", new object[]
                {
                    cacheEntry
                });
                return(anchorJobProcessorResult);
            }
            authAdminContext.Logger.Log(MigrationEventType.Information, "Mailbox {0} is active on current server", new object[]
            {
                cacheEntry
            });
            try
            {
                authAdminContext.Logger.Log(MigrationEventType.Information, "Starting Auth Admin tasks", new object[0]);
                ITopologyConfigurationSession session = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(false, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromRootOrgScopeSet(), 81, "ProcessEntry", "f:\\15.00.1497\\sources\\dev\\Management\\src\\ServiceHost\\Servicelets\\AuthAdmin\\Program\\AuthAdminScheduler.cs");
                this.authAdminAuthConfig.DoScheduledWork(session);
                this.authAdminCertificates.DoScheduledWork(session);
            }
            catch (ADTransientException ex)
            {
                authAdminContext.Logger.LogTerseEvent(MigrationEventType.Error, MSExchangeAuthAdminEventLogConstants.Tuple_TransientException, new string[]
                {
                    AnchorLogger.GetDiagnosticInfo(ex, null)
                });
                throw;
            }
            catch (DataSourceTransientException ex2)
            {
                authAdminContext.Logger.LogTerseEvent(MigrationEventType.Error, MSExchangeAuthAdminEventLogConstants.Tuple_TransientException, new string[]
                {
                    AnchorLogger.GetDiagnosticInfo(ex2, null)
                });
                throw;
            }
            catch (Exception ex3)
            {
                authAdminContext.Logger.LogTerseEvent(MigrationEventType.Error, MSExchangeAuthAdminEventLogConstants.Tuple_PermanentException, new string[]
                {
                    AnchorLogger.GetDiagnosticInfo(ex3, null)
                });
            }
            finally
            {
                authAdminContext.Logger.LogTerseEvent(MigrationEventType.Information, MSExchangeAuthAdminEventLogConstants.Tuple_AuthAdminCompleted, new string[]
                {
                    cacheEntry.ToString()
                });
            }
            return(AnchorJobProcessorResult.Waiting);
        }