/// <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);
        }
Esempio n. 2
0
        /// <summary>
        /// Initialises a new instance of the <see cref="FtpTransporter"/> class.
        /// </summary>
        /// <param name="clientFactory">The <see cref="FtpMessageSender"/> to use to send messages.</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>
        public FtpTransporter(IFtpClientFactory clientFactory, IMessageSerialiser messageSerialiser, string pathToReciever)
        {
            this._clientFactory          = clientFactory;
            this._serialiser             = messageSerialiser;
            this._messageRecievedWatcher = new FileSystemWatcher(pathToReciever, "*.msg")
            {
                NotifyFilter = NotifyFilters.LastWrite
            };

            this._messageRecievedWatcher.Changed += async(sender, args) => await this.MessageReceived(sender, args);

            this._messageRecievedWatcher.EnableRaisingEvents = true;
        }
Esempio n. 3
0
        /// <summary>
        /// Initialises a new instance of the <see cref="FtpTransporter"/> class.
        /// </summary>
        /// <param name="clientFactory">The <see cref="FtpMessageSender"/> to use to send messages.</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>
        public FtpTransporter(IFtpClientFactory clientFactory, IMessageSerialiser messageSerialiser, string pathToReciever)
        {
            this._clientFactory = clientFactory;
            this._serialiser = messageSerialiser;
            this._messageRecievedWatcher = new FileSystemWatcher(pathToReciever, "*.msg")
                                           {
                                               NotifyFilter = NotifyFilters.LastWrite
                                           };

            this._messageRecievedWatcher.Changed += async (sender, args) => await this.MessageReceived(sender, args);

            this._messageRecievedWatcher.EnableRaisingEvents = true;
        }
        public FtpXboxGameRepository(IFtpClientFactory ftpClientFactory, FtpXboxSettings ftpXboxSettings, PolicyRegistry policyRegistry)
        {
            if (ftpClientFactory == null)
            {
                throw new ArgumentNullException(nameof(ftpClientFactory));
            }
            if (ftpXboxSettings == null)
            {
                throw new ArgumentNullException(nameof(ftpXboxSettings));
            }
            _ftpClientFactory = ftpClientFactory;
            _ftpXboxSettings  = ftpXboxSettings;
            _policyRegistry   = policyRegistry;

            _ftpPolicy = _policyRegistry.Get <Policy>("Ftp");
            _currentWorkingDirectory = "";
        }
Esempio n. 5
0
 public XmlOrderWriter(IConfigurationManager configurationManager, IFtpClientFactory ftpClientfactory)
 {
     _configurationManager = configurationManager;
     _ftpClient            = ftpClientfactory.CreateFtpClient();
 }
Esempio n. 6
0
 public FtpProvider(IFtpConfig config, IFtpClientFactory ftpClientFactory, IFtpParser <TPayload> parser)
 {
     _config    = config;
     _ftpClient = ftpClientFactory.Create(config.Host, config.Credentials);
     _parser    = parser;
 }
Esempio n. 7
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));
        }
Esempio n. 8
0
 public FtpUploader(IFtpClientFactory ftpClientFactory, IArchiveService archive, IKernel kernel)
 {
     _ftpClientFactory = ftpClientFactory;
     _archive          = archive;
     _configuration    = kernel.Resolve <IGlobaseConfiguration>();
 }
Esempio n. 9
0
 public MainframeFtp(IConfigurationManager configuration, ILog log, IFtpClientFactory ftpClientFactory)
 {
     _log       = log;
     _ftpClient = ftpClientFactory.CreateFtpClient();
 }
        private FtpXboxGameRepository CreateSut(FtpXboxSettings settings, IFtpClientFactory ftpClientFactory)
        {
            var sut = new FtpXboxGameRepository(ftpClientFactory, settings, _policyRegistry);

            return(sut);
        }