/// <summary>
        /// Use HTTP transportation for this <see cref="IServiceBus"/> using the a predefined HTTP client.
        /// </summary>
        /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
        /// <param name="client">The HTTP client to use.</param>
        /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
        /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
        public static ITransportConfiguration WithHttpTransport(this IHostAddressConfiguration hostAddressConfiguration, HttpClient client, IMessageSerialiser messageSerialiser)
        {
            Argument.CannotBeNull(client, "client", "The HTTP transporter cannot accept a null HTTP Client.");
            Argument.CannotBeNull(messageSerialiser, "messageSerialiser", "A message serialiser to be used by the transporter cannot be null.");

            var transporter = new HttpTransporter(client, messageSerialiser);

            return(new TransportConfiguration(hostAddressConfiguration, transporter));
        }
Esempio n. 2
0
        /// <summary>
        /// Use FTP transportation for this <see cref="IServiceBus"/> using the a predefined FTP client factory.
        /// </summary>
        /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
        /// <param name="clientFactory">The FTP client factory to use.</param>
        /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
        /// <param name="pathToReciever">The full file path of the location this peers FTP server is mapped to receive messages.</param>
        /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
        public static ITransportConfiguration WithFtpTransport(this IHostAddressConfiguration hostAddressConfiguration, IFtpClientFactory clientFactory, IMessageSerialiser messageSerialiser, string pathToReciever)
        {
            Argument.CannotBeNull(clientFactory, "clientFactory", "The FTP transporter cannot accept a null FTP Client Factory.");
            Argument.CannotBeNull(messageSerialiser, "messageSerialiser", "A message serialiser to be used by the transporter cannot be null.");
            Argument.CannotBe(pathToReciever, "pathToReciever", path => !string.IsNullOrEmpty(path));

            var transporter = new FtpTransporter(clientFactory, messageSerialiser, pathToReciever);

            return(new TransportConfiguration(hostAddressConfiguration, transporter));
        }
 /// <summary>
 /// Initialises a new instance of the <see cref="HostAddressConfiguration"/> class.
 /// </summary>
 /// <param name="hostAddressConfiguration">The previously set configuration of the host address.</param>
 public HostAddressConfiguration(IHostAddressConfiguration hostAddressConfiguration)
     : this(hostAddressConfiguration.LoggingConfigurationInstance, hostAddressConfiguration.HostAddress)
 {
     this.HostAddressConfigurationInstance = hostAddressConfiguration;
 }
 /// <summary>
 /// Initialises a new instance of the <see cref="TransportConfiguration"/> class.
 /// </summary>
 /// <param name="hostAddress">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="transporter">The <see cref="ITransporter"/> for the <see cref="IServiceBus"/> to use.</param>
 public TransportConfiguration(IHostAddressConfiguration hostAddress, ITransporter transporter)
     : base(hostAddress)
 {
     this.Transporter = transporter;
 }
Esempio n. 5
0
 /// <summary>
 /// Use FTP transportation for this <see cref="IServiceBus"/> using the default FTP client factory.
 /// </summary>
 /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
 /// <param name="pathToReciever">The full file path of the location this peers FTP server is mapped to receive messages.</param>
 /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
 public static ITransportConfiguration WithFtpTransport(this IHostAddressConfiguration hostAddressConfiguration, IMessageSerialiser messageSerialiser, string pathToReciever)
 {
     return(hostAddressConfiguration.WithFtpTransport(new FtpClientFactory(), messageSerialiser, pathToReciever));
 }
Esempio n. 6
0
 /// <summary>
 /// Initialises a new instance of the <see cref="HostAddressConfiguration"/> class.
 /// </summary>
 /// <param name="hostAddressConfiguration">The previously set configuration of the host address.</param>
 public HostAddressConfiguration(IHostAddressConfiguration hostAddressConfiguration)
     : this(hostAddressConfiguration.LoggingConfigurationInstance, hostAddressConfiguration.HostAddress)
 {
     this.HostAddressConfigurationInstance = hostAddressConfiguration;
 }
Esempio n. 7
0
 /// <summary>
 /// Initialises a new instance of the <see cref="TransportConfiguration"/> class.
 /// </summary>
 /// <param name="hostAddress">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="transporter">The <see cref="ITransporter"/> for the <see cref="IServiceBus"/> to use.</param>
 public TransportConfiguration(IHostAddressConfiguration hostAddress, ITransporter transporter)
     : base(hostAddress)
 {
     this.Transporter = transporter;
 }
 /// <summary>
 /// Use HTTP transportation for this <see cref="IServiceBus"/> using the default HTTP client.
 /// </summary>
 /// <param name="hostAddressConfiguration">The <see cref="IHostAddressConfiguration"/>.</param>
 /// <param name="messageSerialiser">The <see cref="IMessageSerialiser"/> to use.</param>
 /// <returns>The <see cref="ITransportConfiguration"/>.</returns>
 public static ITransportConfiguration WithHttpTransport(this IHostAddressConfiguration hostAddressConfiguration, IMessageSerialiser messageSerialiser)
 {
     return(hostAddressConfiguration.WithHttpTransport(new HttpClient(), messageSerialiser));
 }