Ejemplo n.º 1
0
 /// <summary>
 /// Create handler
 /// </summary>
 /// <param name="iothub"></param>
 /// <param name="broker"></param>
 /// <param name="logger"></param>
 public DiscovererTwinEventHandler(IIoTHubTwinServices iothub,
                                   IRegistryEventBroker <IDiscovererRegistryListener> broker, ILogger logger)
 {
     _iothub = iothub ?? throw new ArgumentNullException(nameof(iothub));
     _broker = broker ?? throw new ArgumentNullException(nameof(broker));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
 /// <summary>
 /// Create registry services
 /// </summary>
 /// <param name="iothub"></param>
 /// <param name="broker"></param>
 /// <param name="logger"></param>
 public GatewayRegistry(IIoTHubTwinServices iothub,
                        IRegistryEventBroker <IGatewayRegistryListener> broker, ILogger logger)
 {
     _iothub = iothub ?? throw new ArgumentNullException(nameof(iothub));
     _broker = broker ?? throw new ArgumentNullException(nameof(broker));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Create registry services
 /// </summary>
 /// <param name="iothub"></param>
 /// <param name="broker"></param>
 /// <param name="serializer"></param>
 /// <param name="logger"></param>
 public PublisherRegistry(IIoTHubTwinServices iothub, IJsonSerializer serializer,
                          IRegistryEventBroker <IPublisherRegistryListener> broker, ILogger logger)
 {
     _iothub     = iothub ?? throw new ArgumentNullException(nameof(iothub));
     _broker     = broker ?? throw new ArgumentNullException(nameof(broker));
     _logger     = logger ?? throw new ArgumentNullException(nameof(logger));
     _serializer = serializer ?? throw new ArgumentNullException(nameof(serializer));
 }
        /// <summary>
        /// Create registry services
        /// </summary>
        /// <param name="database"></param>
        /// <param name="endpoints"></param>
        /// <param name="bulk"></param>
        /// <param name="broker"></param>
        /// <param name="logger"></param>
        /// <param name="metrics"></param>
        public ApplicationRegistry(IApplicationRepository database,
                                   IApplicationEndpointRegistry endpoints, IEndpointBulkProcessor bulk,
                                   IRegistryEventBroker <IApplicationRegistryListener> broker,
                                   ILogger logger, IMetricsLogger metrics)
        {
            _logger   = logger ?? throw new ArgumentNullException(nameof(logger));
            _metrics  = metrics ?? throw new ArgumentNullException(nameof(metrics));
            _broker   = broker ?? throw new ArgumentNullException(nameof(broker));
            _database = database ?? throw new ArgumentNullException(nameof(database));

            _bulk      = bulk ?? throw new ArgumentNullException(nameof(bulk));
            _endpoints = endpoints ?? throw new ArgumentNullException(nameof(endpoints));
        }
Ejemplo n.º 5
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);
        }