/// <summary>
 /// Create listener
 /// </summary>
 /// <param name="db"></param>
 /// <param name="logger"></param>
 /// <param name="events"></param>
 public ApplicationRecordQuery(IItemContainerFactory db, ILogger logger,
                               IRegistryEvents <IApplicationRegistryListener> events = null)
 {
     _database   = new ApplicationDatabase(db, logger);
     _logger     = logger ?? throw new ArgumentNullException(nameof(logger));
     _unregister = events?.Register(this);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create endpoint registry
        /// </summary>
        /// <param name="iothub"></param>
        /// <param name="broker"></param>
        /// <param name="logger"></param>
        /// <param name="activator"></param>
        /// <param name="certificates"></param>
        /// <param name="supervisors"></param>
        /// <param name="serializer"></param>
        /// <param name="events"></param>
        public EndpointRegistry(IIoTHubTwinServices iothub, IJsonSerializer serializer,
                                IRegistryEventBroker <IEndpointRegistryListener> broker,
                                IActivationServices <EndpointRegistrationModel> activator,
                                ICertificateServices <EndpointRegistrationModel> certificates,
                                ISupervisorRegistry supervisors, ILogger logger,
                                IRegistryEvents <IApplicationRegistryListener> events = null)
        {
            _iothub       = iothub ?? throw new ArgumentNullException(nameof(iothub));
            _logger       = logger ?? throw new ArgumentNullException(nameof(logger));
            _certificates = certificates ?? throw new ArgumentNullException(nameof(certificates));
            _supervisors  = supervisors ?? throw new ArgumentNullException(nameof(supervisors));
            _activator    = activator ?? throw new ArgumentNullException(nameof(activator));
            _serializer   = serializer ?? throw new ArgumentNullException(nameof(serializer));
            _broker       = broker ?? throw new ArgumentNullException(nameof(broker));

            // Register for application registry events
            _unregister = events?.Register(this);
        }