public DeviceManager(
     IDeviceManagementRepo deviceRepo,
     IDeviceConfigHelper deviceConfigHelper,
     IAdminLogger logger,
     IAppConfig appConfig,
     IDependencyManager depmanager,
     ISecurity security,
     IDeviceExceptionRepo deviceExceptionRepo,
     IDeviceArchiveRepo deviceArchiveRepo,
     IDeviceConnectionEventRepo deviceConnectionEventRepo,
     IMediaServicesManager mediaServicesManager,
     IDeviceRepositoryRepo deviceRepoRepo,
     IDeviceTypeRepo deviceTypeRepo,
     IProxyFactory proxyFactory) :
     base(logger, appConfig, depmanager, security)
 {
     _defaultRepo               = deviceRepo ?? throw new ArgumentNullException(nameof(deviceRepo));
     _deviceConfigHelper        = deviceConfigHelper ?? throw new ArgumentNullException(nameof(deviceConfigHelper));
     _proxyFactory              = proxyFactory ?? throw new ArgumentNullException(nameof(proxyFactory));
     _deviceExceptionRepo       = deviceExceptionRepo ?? throw new ArgumentNullException(nameof(deviceExceptionRepo));
     _deviceArchiveRepo         = deviceArchiveRepo ?? throw new ArgumentNullException(nameof(deviceArchiveRepo));
     _deviceConnectionEventRepo = deviceConnectionEventRepo ?? throw new ArgumentNullException(nameof(deviceConnectionEventRepo));
     _mediaServicesManager      = mediaServicesManager ?? throw new ArgumentNullException(nameof(mediaServicesManager));
     _deviceRepoRepo            = deviceRepoRepo ?? throw new ArgumentNullException(nameof(deviceRepoRepo));
     _deviceTypeRepo            = deviceTypeRepo ?? throw new ArgumentNullException(nameof(deviceTypeRepo));
 }
Esempio n. 2
0
 public DeviceGroupManager(IDeviceGroupRepo deviceGroupRepo, IDeviceManagementRepo deviceManagementRepo, IDeviceGroupEntryRepo deviceGroupEntryRepo, IAdminLogger logger, IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) :
     base(logger, appConfig, depmanager, security)
 {
     _deviceGroupRepo      = deviceGroupRepo;
     _deviceGroupEntryRepo = deviceGroupEntryRepo;
     _deviceManagementRepo = deviceManagementRepo;
 }
 public DeviceGroupManager(IDeviceGroupRepo deviceGroupRepo, IDeviceManagementRepo deviceManagementRepo, IAdminLogger logger, IAppConfig appConfig,
                           IDependencyManager depmanager, ISecurity security, IProxyFactory proxyFactory) :
     base(logger, appConfig, depmanager, security)
 {
     _defaultDeviceGroupRepo      = deviceGroupRepo;
     _defaultDeviceManagementRepo = deviceManagementRepo;
     _proxyFactory = proxyFactory;
 }
Esempio n. 4
0
 public DeviceManager(IDeviceManagementRepo deviceRepo, IDeviceManagementConnector deviceConnectorService,
                      IDeviceConfigHelper deviceConfigHelper, IAdminLogger logger, ISecureStorage secureStorage,
                      IAppConfig appConfig, IDependencyManager depmanager, ISecurity security) : base(logger, appConfig, depmanager, security)
 {
     _deviceRepo             = deviceRepo;
     _secureStorage          = secureStorage;
     _deviceConfigHelper     = deviceConfigHelper;
     _deviceConnectorService = deviceConnectorService;
 }
 public DeviceManager(
     IDeviceManagementRepo deviceRepo,
     IDeviceConfigHelper deviceConfigHelper,
     IAdminLogger logger,
     ISecureStorage secureStorage,
     IAppConfig appConfig,
     IDependencyManager depmanager,
     ISecurity security,
     IProxyFactory proxyFactory) :
     base(logger, appConfig, depmanager, security)
 {
     _defaultRepo        = deviceRepo;
     _secureStorage      = secureStorage;
     _deviceConfigHelper = deviceConfigHelper;
     _proxyFactory       = proxyFactory;
 }
Esempio n. 6
0
        static public void Initialize()
        {
            if (_initialized)
            {
                return;
            }
            _initialized = true;

            Logger = new AdminLogger(new ConsoleLogWriter(), HostId);

            AsyncCoupler = new AsyncCoupler <IMessage>(Logger, new UsageMetrics(HostId, InstanceId, PipelineModuleId));

            TransceiverSettings.RpcClientReceiver.AccountId = System.Environment.GetEnvironmentVariable("RPC_TESTS_SERVICE_BUS", EnvironmentVariableTarget.User);
            Assert.IsNotNull(TransceiverSettings.RpcClientReceiver.AccountId, "Please add environment variable for [RPC_TESTS_RECEIVE_KEY] with read acess to service bus");

            TransceiverSettings.RpcClientReceiver.UserName  = "******";
            TransceiverSettings.RpcClientReceiver.AccessKey = System.Environment.GetEnvironmentVariable("RPC_TESTS_RECEIVE_KEY", EnvironmentVariableTarget.User);
            Assert.IsNotNull(TransceiverSettings.RpcClientReceiver.AccessKey, "Please add environment variable for [RPC_TESTS_RECEIVE_KEY] with read acess to service bus");
            TransceiverSettings.RpcClientReceiver.ResourceName = "rpc_test";
            TransceiverSettings.RpcClientReceiver.Uri          = "application";

            TransceiverSettings.RpcClientTransmitter.AccountId = TransceiverSettings.RpcClientReceiver.AccountId;
            TransceiverSettings.RpcClientTransmitter.UserName  = "******";
            TransceiverSettings.RpcClientTransmitter.AccessKey = System.Environment.GetEnvironmentVariable("RPC_TESTS_SEND_KEY", EnvironmentVariableTarget.User);
            Assert.IsNotNull(TransceiverSettings.RpcClientReceiver.AccessKey, "Please add environment variable for [RPC_TESTS_RECEIVE_KEY] with read acess to service bus");
            TransceiverSettings.RpcClientTransmitter.ResourceName     = "rpc_test";
            TransceiverSettings.RpcClientTransmitter.TimeoutInSeconds = 30;

            TransceiverSettings.RpcServerTransmitter.AccountId = TransceiverSettings.RpcClientReceiver.AccountId;
            TransceiverSettings.RpcServerTransmitter.UserName  = "******";
            TransceiverSettings.RpcServerTransmitter.AccessKey = System.Environment.GetEnvironmentVariable("RPC_TESTS_SEND_KEY", EnvironmentVariableTarget.User);
            Assert.IsNotNull(TransceiverSettings.RpcServerTransmitter.AccessKey, "Please add environment variable for [RPC_TESTS_RECEIVE_KEY] with read acess to service bus");
            TransceiverSettings.RpcServerTransmitter.ResourceName     = "rpc_test";
            TransceiverSettings.RpcServerTransmitter.TimeoutInSeconds = 30;

            TransceiverSettings.RpcServerReceiver.AccountId    = System.Environment.GetEnvironmentVariable("RPC_TESTS_SERVICE_BUS", EnvironmentVariableTarget.User);
            TransceiverSettings.RpcServerReceiver.UserName     = "******";
            TransceiverSettings.RpcServerReceiver.AccessKey    = System.Environment.GetEnvironmentVariable("RPC_TESTS_RECEIVE_KEY", EnvironmentVariableTarget.User);
            TransceiverSettings.RpcServerReceiver.ResourceName = "rpc_test";
            TransceiverSettings.RpcServerReceiver.Uri          = "application";

            RpcTransceiver = new ServiceBusProxyClient(AsyncCoupler, Logger);
            RpcTransceiver.StartAsync(TransceiverSettings).Wait();

            ProxySettings = new ProxySettings
            {
                OrganizationId = OrganizationId,
                InstanceId     = InstanceId
            };

            ProxyFactory = new ProxyFactory(TransceiverSettings, RpcTransceiver, AsyncCoupler, Logger);

            DeviceManagementRepoProxy = ProxyFactory.Create <IDeviceManagementRepo>(ProxySettings);
            DeviceArchiveRepoProxy    = ProxyFactory.Create <IDeviceArchiveRepo>(ProxySettings);
            DeviceLogRepo             = ProxyFactory.Create <IDeviceLogRepo>(ProxySettings);
            DevicePEMRepo             = ProxyFactory.Create <IDevicePEMRepo>(ProxySettings);

            DeviceGroupRepo           = ProxyFactory.Create <IDeviceGroupRepo>(ProxySettings);
            DeviceMediaRepo           = ProxyFactory.Create <IDeviceMediaRepo>(ProxySettings);
            DeviceMediaItemRepo       = ProxyFactory.Create <IDeviceMediaItemRepo>(ProxySettings);
            DeviceMediaRepoRemote     = ProxyFactory.Create <IDeviceMediaRepoRemote>(ProxySettings);
            DeviceMediaItemRepoRemote = ProxyFactory.Create <IDeviceMediaItemRepoRemote>(ProxySettings);
        }