Пример #1
0
        public override void Run()
        {
            // This is a sample worker implementation. Replace with your logic.
            Trace.TraceInformation("NotificationWorker entry point called");

            try
            {
                IUnityContainer container = Utils.Configuration.CurrentContainer;
                //TODO container.LoadConfiguration();


                container.RegisterType <IHttpClientManager, HttpClientManager>(
                    new PerThreadLifetimeManager(),
                    new InjectionConstructor(RoleEnvironment.GetConfigurationSettingValue("AuthorizationSchema")));

                container.RegisterType <IWhitespacesDataClient, WhitespacesDataClient>(
                    new InjectionConstructor(new ResolvedParameter <IHttpClientManager>()));

                this.auditNotificationSystem        = container.Resolve <NotificationSystem>("auditTracker");
                this.userRequestsNotificationSystem = container.Resolve <NotificationSystem>("userAccessRequestTracker");
                this.whitespacesManager             = container.Resolve <WhitespacesManager>();
                this.notificationAuditor            = container.Resolve <AzureAuditor>();
                this.notificationLogger             = container.Resolve <Logger>();

                while (true)
                {
                    if (!this.auditNotificationSystem.Enabled)
                    {
                        this.auditNotificationSystem.StartTracking();
                    }

                    if (!this.userRequestsNotificationSystem.Enabled)
                    {
                        this.userRequestsNotificationSystem.StartTracking();
                    }

                    this.MonitorGetChannelList();

                    Thread.Sleep(TimeSpan.FromMinutes(10));
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.TraceError(ex.ToString());

                if (this.auditNotificationSystem.Enabled)
                {
                    this.auditNotificationSystem.StopTracking();
                }

                if (!this.userRequestsNotificationSystem.Enabled)
                {
                    this.userRequestsNotificationSystem.StopTracking();
                }
            }
        }
        public RegionManagementController(IRegionManager regionManager, IWhitespacesManager whitespacesManager, IRegionSource regionSource)
        {
            Microsoft.WhiteSpaces.Common.Check.IsNotNull(regionManager, "User Manager");
            Microsoft.WhiteSpaces.Common.Check.IsNotNull(whitespacesManager, "Whitespaces Manager");
            Microsoft.WhiteSpaces.Common.Check.IsNotNull(regionSource, "Region Source");

            this.regionManager      = regionManager;
            this.whitespacesManager = whitespacesManager;
            this.regionSource       = regionSource;
        }
Пример #3
0
 public WSDInfoSystemController(IWhitespacesManager whitespacesManager)
 {
     if (whitespacesManager == null)
     {
         throw new ArgumentNullException("whitespacesManager");
     }
     else
     {
         this.whitespacesManager = whitespacesManager;
     }
 }
Пример #4
0
        public WSFinderController(IWhitespacesManager whitespacesManager, IRegionSource regionSource)
        {
            if (whitespacesManager == null)
            {
                throw new ArgumentNullException("whitespacesManager");
            }

            if (regionSource == null)
            {
                throw new ArgumentNullException("regionSource");
            }

            this.whitespacesManager = whitespacesManager;
            this.regionSource       = regionSource;
        }
 public RegisterLicensedLpAuxController(IWhitespacesManager whitespacesManager, IUserManager userManager)
 {
     this.whitespacesManager = whitespacesManager;
 }
 public RegisterMVPDController(IWhitespacesManager whitespacesManager, IUserManager userManager)
 {
     this.whitespacesManager = whitespacesManager;
 }
 public UserManagementController(IUserAdminManager userManager, IWhitespacesManager whitespacesManager)
 {
     this.adminManager       = userManager;
     this.whitespacesManager = whitespacesManager;
 }