Class SessionBuilder


  • public class SessionBuilder
    extends Object
    Builder for Session
    • Constructor Detail

      • SessionBuilder

        public SessionBuilder()
        Create new instance of SessionBuilder
    • Method Detail

      • identity

        public SessionBuilder identity​(IdentityProvider value)
        Parameters:
        value - identity provider to use for the session
        Returns:
        instance of this for fluent programming
      • user

        public SessionBuilder user​(String value)
        Parameters:
        value - user to be used by the session
        Returns:
        instance of this for fluent programming
      • host

        public SessionBuilder host​(String value)
        Parameters:
        value - host to be used by the session
        Returns:
        instance of this for fluent programming
      • port

        public SessionBuilder port​(int value)
        Parameters:
        value - port to be used by the session
        Returns:
        instance of this for fluent programming
      • config

        public SessionBuilder config​(String key,
                                     String value)
        Add an entry to this session's configuration.
        Parameters:
        key - key of the entry
        value - value of the entry
        Returns:
        instance of this for fluent programming
      • build

        public com.jcraft.jsch.Session build()
                                      throws com.jcraft.jsch.JSchException
        Returns:
        new instance of SSH Session
        Throws:
        com.jcraft.jsch.JSchException - if session creation fails
      • getPort

        public int getPort()
        Returns:
        port added to this SessionBuilder