/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="settings">Set of options to use</param>
        /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
        /// <param name="addressRegistry">Reference to the address registry</param>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        protected MessagingCore(
            MessagingSettings settings,
            ICollaborationProtocolRegistry collaborationProtocolRegistry,
            IAddressRegistry addressRegistry)
        {
            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }
            if (collaborationProtocolRegistry == null)
            {
                throw new ArgumentNullException(nameof(collaborationProtocolRegistry));
            }
            if (addressRegistry == null)
            {
                throw new ArgumentNullException(nameof(addressRegistry));
            }

            Settings = settings;
            CollaborationProtocolRegistry = collaborationProtocolRegistry;
            AddressRegistry = addressRegistry;

            DefaultCertificateValidator = new CertificateValidator();
            DefaultMessageProtection    = new SignThenEncryptMessageProtection();
            ServiceBus = new ServiceBusCore(this);

            Settings.Validate();
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings">Set of options to use</param>
 /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
 /// <param name="addressRegistry">Reference to the address registry</param>
 public MessagingClient(
     MessagingSettings settings,
     ICollaborationProtocolRegistry collaborationProtocolRegistry,
     IAddressRegistry addressRegistry) : base(settings, collaborationProtocolRegistry, addressRegistry)
 {
     _asynchronousServiceBusSender = new AsynchronousSender(ServiceBus);
     _synchronousServiceBusSender  = new SynchronousSender(ServiceBus);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings">Set of options to use</param>
 /// <param name="loggerFactory">Logger Factory</param>
 /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
 /// <param name="addressRegistry">Reference to the address registry</param>
 public MessagingServer(
     MessagingSettings settings,
     ILoggerFactory loggerFactory,
     ICollaborationProtocolRegistry collaborationProtocolRegistry,
     IAddressRegistry addressRegistry) : base(settings, collaborationProtocolRegistry, addressRegistry)
 {
     _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     _logger        = _loggerFactory.CreateLogger(nameof(MessagingServer));
 }
Exemplo n.º 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings">Set of options to use</param>
 /// <param name="logger">Logger used for generic messages</param>
 /// <param name="loggerFactory">Logger Factory</param>
 /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
 /// <param name="addressRegistry">Reference to the address registry</param>
 /// <param name="certificateStore">Reference to an implementation of <see cref="ICertificateStore"/>.</param>
 public MessagingServer(
     MessagingSettings settings,
     ILogger logger,
     ILoggerFactory loggerFactory,
     ICollaborationProtocolRegistry collaborationProtocolRegistry,
     IAddressRegistry addressRegistry,
     ICertificateStore certificateStore) : base(settings, collaborationProtocolRegistry, addressRegistry, certificateStore)
 {
     _logger        = logger ?? throw new ArgumentNullException(nameof(logger));
     _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings">Set of options to use</param>
 /// <param name="loggerFactory"></param>
 /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
 /// <param name="addressRegistry">Reference to the address registry</param>
 public MessagingClient(
     MessagingSettings settings,
     ILoggerFactory loggerFactory,
     ICollaborationProtocolRegistry collaborationProtocolRegistry,
     IAddressRegistry addressRegistry) : base(settings, collaborationProtocolRegistry, addressRegistry)
 {
     _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     _logger        = _loggerFactory.CreateLogger(nameof(MessagingClient));
     _asynchronousServiceBusSender = new AsynchronousSender(ServiceBus);
     _synchronousServiceBusSender  = new SynchronousSender(ServiceBus);
 }
Exemplo n.º 6
0
 public MessagingClient(
     MessagingSettings settings,
     ICollaborationProtocolRegistry collaborationProtocolRegistry,
     IAddressRegistry addressRegistry,
     ICertificateStore certificateStore,
     ICertificateValidator certificateValidator,
     IMessageProtection messageProtection) : base(settings, collaborationProtocolRegistry, addressRegistry, certificateStore, certificateValidator, messageProtection)
 {
     _asynchronousServiceBusSender = new AsynchronousSender(ServiceBus);
     _synchronousServiceBusSender  = new SynchronousSender(ServiceBus);
 }
Exemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="settings">Set of options to use</param>
 /// <param name="loggerFactory">Logger Factory</param>
 /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
 /// <param name="addressRegistry">Reference to the address registry</param>
 /// <param name="certificateStore">Reference to an implementation of <see cref="ICertificateStore"/>.</param>
 /// <param name="certificateValidator">Reference to an implementation of <see cref="ICertificateValidator"/>.</param>
 /// <param name="messageProtection">Reference to an implementation of <see cref="IMessageProtection"/>.</param>
 public MessagingServer(
     MessagingSettings settings,
     ILoggerFactory loggerFactory,
     ICollaborationProtocolRegistry collaborationProtocolRegistry,
     IAddressRegistry addressRegistry,
     ICertificateStore certificateStore,
     ICertificateValidator certificateValidator,
     IMessageProtection messageProtection) : base(settings, collaborationProtocolRegistry, addressRegistry, certificateStore, certificateValidator, messageProtection)
 {
     _loggerFactory = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     _logger        = _loggerFactory.CreateLogger(nameof(MessagingServer));
 }
Exemplo n.º 8
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="settings">Set of options to use</param>
        /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
        /// <param name="addressRegistry">Reference to the address registry</param>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        protected MessagingCore(
            MessagingSettings settings,
            ICollaborationProtocolRegistry collaborationProtocolRegistry,
            IAddressRegistry addressRegistry)
        {
            Settings = settings ?? throw new ArgumentNullException(nameof(settings));
            CollaborationProtocolRegistry = collaborationProtocolRegistry ?? throw new ArgumentNullException(nameof(collaborationProtocolRegistry));
            AddressRegistry = addressRegistry ?? throw new ArgumentNullException(nameof(addressRegistry));
            ServiceBus      = new ServiceBusCore(this);

            Settings.Validate();

            CertificateStore     = GetDefaultCertificateStore();
            CertificateValidator = GetDefaultCertificateValidator();
            MessageProtection    = GetDefaultMessageProtection();
        }
Exemplo n.º 9
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="settings">Set of options to use</param>
        /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
        /// <param name="addressRegistry">Reference to the address registry</param>
        /// <param name="certificateStore">
        /// Reference to a custom implementation of <see cref="ICertificateStore"/>, if not set the library will default to Windows Certificate Store.
        /// Setting this argument to null must be done cautiously as the default implementation of <see cref="IMessageProtection"/>
        /// <see cref="SignThenEncryptMessageProtection"/> relies on an <see cref="ICertificateStore"/> implementation.
        /// </param>
        /// <param name="certificateValidator">
        /// Reference to a custom implementation of <see cref="ICertificateValidator"/>, if not set the library will default to the standard implementation
        /// of <see cref="ICertificateValidator"/>. By setting this parameter to null you effectively disable certificate validation.
        /// </param>
        /// <param name="messageProtection">
        /// Reference to custom implemenation of <see cref="IMessageProtection"/>, if not set the library will default to standard behavior which relies on
        /// certificates retrieved from <see cref="ICertificateStore"/>. Setting this parameter to null will throw an <see cref="ArgumentNullException"/>.
        /// </param>
        /// <exception cref="ArgumentNullException"></exception>
        /// <exception cref="ArgumentOutOfRangeException"></exception>
        protected MessagingCore(
            MessagingSettings settings,
            ICollaborationProtocolRegistry collaborationProtocolRegistry,
            IAddressRegistry addressRegistry,
            ICertificateStore certificateStore,
            ICertificateValidator certificateValidator,
            IMessageProtection messageProtection)
        {
            Settings = settings ?? throw new ArgumentNullException(nameof(settings));
            CollaborationProtocolRegistry = collaborationProtocolRegistry ?? throw new ArgumentNullException(nameof(collaborationProtocolRegistry));
            AddressRegistry = addressRegistry ?? throw new ArgumentNullException(nameof(addressRegistry));
            ServiceBus      = new ServiceBusCore(this);

            Settings.Validate();

            CertificateStore     = certificateStore;
            CertificateValidator = certificateValidator;
            MessageProtection    = messageProtection ?? throw new ArgumentNullException(nameof(messageProtection));
        }
Exemplo n.º 10
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="settings">Set of options to use</param>
        /// <param name="logger">Logger used for generic messages</param>
        /// <param name="loggerFactory">Logger Factory</param>
        /// <param name="collaborationProtocolRegistry">Reference to the collaboration protocol registry</param>
        /// <param name="addressRegistry">Reference to the address registry</param>
        public MessagingServer(
            MessagingSettings settings,
            ILogger logger,
            ILoggerFactory loggerFactory,
            ICollaborationProtocolRegistry collaborationProtocolRegistry,
            IAddressRegistry addressRegistry) : base(settings, collaborationProtocolRegistry, addressRegistry)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (loggerFactory == null)
            {
                throw new ArgumentNullException(nameof(loggerFactory));
            }

            _logger        = logger;
            _loggerFactory = loggerFactory;
        }