Example #1
0
        public InternetOfThings(int commandTopics        = PARTITION_DEF_COMMAND_TOPICS,
                                int commandSubscriptions = PARTITION_DEF_COMMAND_SUBSCRIPTIONS)
        {
            if (commandTopics <= 0 || _commandTopics > PARTITION_MAX_COMMAND_TOPICS)
            {
                throw new ArgumentOutOfRangeException("commandTopics");
            }

            if (commandSubscriptions <= 0 || commandSubscriptions > PARTITION_MAX_COMMAND_SUBSCRIPTIONS)
            {
                throw new ArgumentOutOfRangeException("commandSubscriptions");
            }

            _commandTopics        = commandTopics;
            _commandSubscriptions = commandSubscriptions;

            _maxDeliveryCount   = PARTITION_DEF_MAX_DELIVERY_COUNT;
            _messageTtl         = TimeSpan.FromHours(PARTITION_DEF_MESSAGE_TTL);
            _duplicateDetection = TimeSpan.FromMinutes(PARTITION_DEF_DUPLICATE_DETECTION);
            _lockDuration       = TimeSpan.FromMinutes(PARTITION_DEF_LOCK_DURATION);
            _tokenLifeTime      = TimeSpan.FromMinutes(PARTITION_SECURITY_TOKEN_LIFETIME);

            _iotRepository       = InternetOfThingsRepositoryFactory.CreateInternetOfThingsRepository();
            _partitionRepository = _iotRepository as IPartitionRepository;
            _thingRepository     = _iotRepository as IThingRepository;
        }
Example #2
0
 public BaseHelper(IPartitionRepository <T> repo)
 => this.repo = repo;
Example #3
0
 public BaseDbController(ILogger <DataController> logger, IPartitionRepository <T> repo)
 => (_logger, _repo) = (logger, repo);