IServiceFactory.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System;
  2. using System.Text;
  3. using Renci.SshNet.Common;
  4. using Renci.SshNet.Sftp;
  5. namespace Renci.SshNet
  6. {
  7. /// <summary>
  8. /// Factory for creating new services.
  9. /// </summary>
  10. internal partial interface IServiceFactory
  11. {
  12. /// <summary>
  13. /// Creates a new <see cref="ISession"/> with the specified <see cref="ConnectionInfo"/>.
  14. /// </summary>
  15. /// <param name="connectionInfo">The <see cref="ConnectionInfo"/> to use for creating a new session.</param>
  16. /// <returns>
  17. /// An <see cref="ISession"/> for the specified <see cref="ConnectionInfo"/>.
  18. /// </returns>
  19. /// <exception cref="ArgumentNullException"><paramref name="connectionInfo"/> is <c>null</c>.</exception>
  20. ISession CreateSession(ConnectionInfo connectionInfo);
  21. /// <summary>
  22. /// Creates a new <see cref="ISftpSession"/> in a given <see cref="ISession"/> and with
  23. /// the specified operation timeout and encoding.
  24. /// </summary>
  25. /// <param name="session">The <see cref="ISession"/> to create the <see cref="INetConfSession"/> in.</param>
  26. /// <param name="operationTimeout">The operation timeout.</param>
  27. /// <param name="encoding">The encoding.</param>
  28. /// <returns>
  29. /// An <see cref="ISftpSession"/>.
  30. /// </returns>
  31. ISftpSession CreateSftpSession(ISession session, TimeSpan operationTimeout, Encoding encoding);
  32. /// <summary>
  33. /// Create a new <see cref="PipeStream"/>.
  34. /// </summary>
  35. /// <returns>
  36. /// A <see cref="PipeStream"/>.
  37. /// </returns>
  38. PipeStream CreatePipeStream();
  39. }
  40. }