示例#1
0
 internal JobCache(AnchorContext anchorContext)
 {
     this.Context        = anchorContext;
     this.sharedDataLock = new object();
     this.cacheEntries   = new Dictionary <ADObjectId, CacheEntryBase>(32);
     this.cacheUpdated   = new AutoResetEvent(false);
 }
 private AnchorRunspaceProxy(AnchorContext context, AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity runspaceFactory)
 {
     AnchorUtil.ThrowOnNullArgument(context, "context");
     AnchorUtil.ThrowOnNullArgument(runspaceFactory, "runspaceFactory");
     this.Context       = context;
     this.runspaceProxy = new RunspaceProxy(new RunspaceMediator(runspaceFactory, new EmptyRunspaceCache()));
 }
示例#3
0
 // Token: 0x0600011E RID: 286 RVA: 0x00004D0C File Offset: 0x00002F0C
 internal static void RunTimedOperation(AnchorContext context, Action operation, object debugInfo)
 {
     AnchorUtil.RunTimedOperation <int>(context, delegate()
     {
         operation();
         return(0);
     }, debugInfo);
 }
 // Token: 0x06000029 RID: 41 RVA: 0x0000227C File Offset: 0x0000047C
 public AnchorADProvider(AnchorContext context, OrganizationId organizationId, string preferredDomainController = null)
 {
     AnchorUtil.ThrowOnNullArgument(organizationId, "organizationId");
     this.Context                   = context;
     this.OrganizationId            = organizationId;
     this.preferredDomainController = preferredDomainController;
     this.RecipientSession          = this.CreateRecipientSession();
     this.lazyConfigurationSession  = new Lazy <ITopologyConfigurationSession>(new Func <ITopologyConfigurationSession>(AnchorADProvider.CreateTopologyConfigurationSession));
 }
示例#5
0
 // Token: 0x06000128 RID: 296 RVA: 0x000050A4 File Offset: 0x000032A4
 public CacheEntryBase(AnchorContext context, ADUser user)
 {
     this.Context           = context;
     this.ObjectId          = user.ObjectId;
     this.OrganizationId    = (user.OrganizationId ?? OrganizationId.ForestWideOrgId);
     this.UserPrincipalName = user.UserPrincipalName;
     this.LastSyncTime      = ExDateTime.MinValue;
     this.ADProvider        = new AnchorADProvider(this.Context, this.OrganizationId, null);
 }
        public static AnchorRunspaceProxy CreateRunspaceForDelegatedTenantAdmin(AnchorContext context, DelegatedPrincipal delegatedTenantAdmin)
        {
            AnchorUtil.ThrowOnNullArgument(delegatedTenantAdmin, "delegatedTenantAdmin");
            context.Logger.Log(MigrationEventType.Verbose, "AnchorRunspaceProxy. Creating delegated runspace proxy for user {0}", new object[]
            {
                delegatedTenantAdmin
            });
            ExchangeRunspaceConfigurationSettings configSettings = new ExchangeRunspaceConfigurationSettings(ExchangeRunspaceConfigurationSettings.ExchangeApplication.SimpleDataMigration, null, ExchangeRunspaceConfigurationSettings.SerializationLevel.None);

            return(new AnchorRunspaceProxy(context, AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity.CreateRbacFactory(context, delegatedTenantAdmin.ToString(), delegatedTenantAdmin.Identity, configSettings)));
        }
        public static AnchorRunspaceProxy CreateRunspaceForDelegatedPartner(AnchorContext context, DelegatedPrincipal delegatedPartnerAdmin, string tenantOrganization)
        {
            AnchorUtil.ThrowOnNullArgument(delegatedPartnerAdmin, "delegatedTenantAdmin");
            AnchorUtil.ThrowOnNullOrEmptyArgument(tenantOrganization, "tenantOrganization");
            context.Logger.Log(MigrationEventType.Verbose, "AnchorRunspaceProxy. Creating delegated partner runspace proxy for user {0}", new object[]
            {
                delegatedPartnerAdmin
            });
            ExchangeRunspaceConfigurationSettings configSettings = new ExchangeRunspaceConfigurationSettings(ExchangeRunspaceConfigurationSettings.ExchangeApplication.SimpleDataMigration, tenantOrganization, ExchangeRunspaceConfigurationSettings.GetDefaultInstance().CurrentSerializationLevel);

            return(new AnchorRunspaceProxy(context, AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity.CreateRbacFactory(context, delegatedPartnerAdmin.ToString(), delegatedPartnerAdmin.Identity, configSettings)));
        }
        public static AnchorRunspaceProxy CreateRunspaceForTenantAdmin(AnchorContext context, ADObjectId ownerId, ADUser tenantAdmin)
        {
            AnchorUtil.ThrowOnNullArgument(tenantAdmin, "tenantAdmin");
            AnchorUtil.ThrowOnNullArgument(ownerId, "ownerId");
            context.Logger.Log(MigrationEventType.Verbose, "AnchorRunspaceProxy. Creating runspace proxy for user {0}", new object[]
            {
                tenantAdmin.Name
            });
            ExchangeRunspaceConfigurationSettings configSettings = new ExchangeRunspaceConfigurationSettings(ExchangeRunspaceConfigurationSettings.ExchangeApplication.SimpleDataMigration, null, ExchangeRunspaceConfigurationSettings.SerializationLevel.None);

            return(new AnchorRunspaceProxy(context, AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity.CreateRbacFactory(context, ownerId.ToString(), new GenericSidIdentity(tenantAdmin.Name, string.Empty, tenantAdmin.Sid), configSettings)));
        }
示例#9
0
 // Token: 0x0600004B RID: 75 RVA: 0x000029AC File Offset: 0x00000BAC
 internal AnchorApplication(AnchorContext context, WaitHandle stopEvent)
 {
     this.Context     = context;
     this.JobCache    = new JobCache(this.Context);
     this.WaitHandles = new WaitHandle[]
     {
         stopEvent,
         this.JobCache.CacheUpdated
     };
     this.Components = this.Context.CreateCacheComponents(stopEvent);
     this.IssueCache = new AnchorIssueCache(this.Context, this.JobCache);
     this.IssueCache.EnableScanning();
 }
        // Token: 0x060000A1 RID: 161 RVA: 0x00003488 File Offset: 0x00001688
        internal static bool TrySendEventNotification(AnchorContext context, string notificationReason, string message, ResultSeverityLevel severity = ResultSeverityLevel.Error)
        {
            if (!context.Config.GetConfig <bool>("IssueCacheIsEnabled"))
            {
                return(false);
            }
            string config = context.Config.GetConfig <string>("MonitoringComponentName");

            if (string.IsNullOrEmpty(config))
            {
                return(false);
            }
            Component a = Component.FindWellKnownComponent(config);

            if (a == null)
            {
                return(false);
            }
            new EventNotificationItem(config, config, notificationReason, message, severity).Publish(false);
            return(true);
        }
 public static AnchorRunspaceProxy CreateRunspaceForDatacenterAdmin(AnchorContext context, string ownerId)
 {
     AnchorUtil.ThrowOnNullArgument(ownerId, "ownerId");
     context.Logger.Log(MigrationEventType.Verbose, "Creating runspace proxy for datacenter admin", new object[0]);
     return(new AnchorRunspaceProxy(context, AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity.CreateUnrestrictedFactory(ownerId)));
 }
 public static AnchorRunspaceProxy CreateRunspaceForDatacenterAdmin(AnchorContext context, ADObjectId ownerId)
 {
     AnchorUtil.ThrowOnNullArgument(ownerId, "ownerId");
     return(AnchorRunspaceProxy.CreateRunspaceForDatacenterAdmin(context, ownerId.ToString()));
 }
            public static AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity CreateRbacFactory(AnchorContext context, string affinityToken, IIdentity tenantIdentity, ExchangeRunspaceConfigurationSettings configSettings)
            {
                InitialSessionState initialSessionState;

                try
                {
                    initialSessionState = new ExchangeExpiringRunspaceConfiguration(tenantIdentity, configSettings).CreateInitialSessionState();
                    initialSessionState.LanguageMode = PSLanguageMode.FullLanguage;
                }
                catch (CmdletAccessDeniedException ex)
                {
                    context.Logger.Log(MigrationEventType.Warning, ex, "AnchorRunspaceProxy. error creating session for user {0}", new object[]
                    {
                        tenantIdentity
                    });
                    throw new UserDoesNotHaveRBACException(tenantIdentity.ToString(), ex);
                }
                catch (AuthzException ex2)
                {
                    context.Logger.Log(MigrationEventType.Error, ex2, "AnchorRunspaceProxy. authorization error creating session for user {0}", new object[]
                    {
                        tenantIdentity
                    });
                    throw new UserDoesNotHaveRBACException(tenantIdentity.ToString(), ex2);
                }
                return(new AnchorRunspaceProxy.RunspaceFactoryWithDCAffinity(affinityToken, new BasicInitialSessionStateFactory(initialSessionState), new BasicPSHostFactory(typeof(RunspaceHost), true)));
            }
 internal FirstOrgCacheScanner(AnchorContext context, WaitHandle stopEvent) : base(context, stopEvent)
 {
 }
 // Token: 0x06000099 RID: 153 RVA: 0x00003408 File Offset: 0x00001608
 public AnchorIssueCache(AnchorContext context, JobCache cache)
 {
     this.Context = context;
     this.Cache   = cache;
 }
 // Token: 0x06000034 RID: 52 RVA: 0x0000239E File Offset: 0x0000059E
 public static AnchorADProvider GetRootOrgProvider(AnchorContext context)
 {
     return(new AnchorADProvider(context, OrganizationId.ForestWideOrgId, null));
 }
 // Token: 0x06000167 RID: 359 RVA: 0x00005FD7 File Offset: 0x000041D7
 public CapabilityCacheEntry(AnchorContext context, ADUser user) : base(context, user)
 {
     this.MailboxUser = user;
 }
示例#18
0
 // Token: 0x0600015A RID: 346 RVA: 0x000055C1 File Offset: 0x000037C1
 internal CacheScanner(AnchorContext context, WaitHandle stopEvent) : base(context, stopEvent)
 {
     this.nextProcessTime = ExDateTime.MinValue;
 }
示例#19
0
        // Token: 0x0600011F RID: 287 RVA: 0x00004D3C File Offset: 0x00002F3C
        internal static T RunTimedOperation <T>(AnchorContext context, Func <T> operation, object debugInfo)
        {
            TimedOperationRunner timedOperationRunner = context.CreateOperationRunner();

            return(timedOperationRunner.RunOperation <T>(operation, debugInfo));
        }
示例#20
0
 internal CacheScheduler(AnchorContext context, WaitHandle stopEvent) : base(context, stopEvent)
 {
 }
示例#21
0
 internal CacheProcessorBase(AnchorContext context, WaitHandle stopEvent)
 {
     this.Context   = context;
     this.StopEvent = stopEvent;
 }