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); }
/// <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)); }
/// <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)); }