com.xebialabs.deployit.hostsession
Class HostSessionFactory

java.lang.Object
  extended by com.xebialabs.deployit.hostsession.HostSessionFactory

public class HostSessionFactory
extends java.lang.Object

Factory for host sessions.


Field Summary
static int DEFAULT_SSH_PORT
          The default port to use for SSH host sessions
 
Constructor Summary
HostSessionFactory()
           
 
Method Summary
static HostSession getHostSession(Host host)
          Returns an HostSession based on the information in a Host CI.
static HostSession getHostSession(OperatingSystemFamily osFamily, HostAccessMethod accessMethod, java.lang.String address, int port, java.lang.String username, java.lang.String password, java.lang.String sudoUsername, java.lang.String temporaryDirectoryPath)
          Creates a host session for the host.
static HostSession getHostSession(OperatingSystemFamily osFamily, HostAccessMethod accessMethod, java.lang.String hostSpecification, java.lang.String username, java.lang.String password, java.lang.String sudoUsername, java.lang.String temporaryDirectoryPath)
          Creates a host session for the host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SSH_PORT

public static final int DEFAULT_SSH_PORT
The default port to use for SSH host sessions

See Also:
Constant Field Values
Constructor Detail

HostSessionFactory

public HostSessionFactory()
Method Detail

getHostSession

public static HostSession getHostSession(OperatingSystemFamily osFamily,
                                         HostAccessMethod accessMethod,
                                         java.lang.String address,
                                         int port,
                                         java.lang.String username,
                                         java.lang.String password,
                                         java.lang.String sudoUsername,
                                         java.lang.String temporaryDirectoryPath)
Creates a host session for the host.

Parameters:
osFamily - the OS family of the host
accessMethod - the way the host is accessed, e.g. local access, SSH w/ SFTP, SSH w/ SCP, SSH w/ SUDO, etc.
address - the address of the host
port - the port on the host to connect with
username - the username to connect to the host
password - the password to connect to the host
sudoUsername - the username to sudo to
temporaryDirectoryPath - the path of the directory in which to store temporary files
Returns:
the session created
Throws:
java.lang.IllegalStateException - if no suitable session can be created.

getHostSession

public static HostSession getHostSession(OperatingSystemFamily osFamily,
                                         HostAccessMethod accessMethod,
                                         java.lang.String hostSpecification,
                                         java.lang.String username,
                                         java.lang.String password,
                                         java.lang.String sudoUsername,
                                         java.lang.String temporaryDirectoryPath)
Creates a host session for the host.

Parameters:
osFamily - the OS family of the host
accessMethod - the way the host is accessed, e.g. local access, SSH w/ SFTP, SSH w/ SCP, SSH w/ SUDO, etc.
hostSpecification - the host to connect with, specified as a host address optionally followed by a colon and a port number
username - the username to connect to the host
password - the password to connect to the host
sudoUsername - the username to sudo to
temporaryDirectoryPath - the path of the directory in which to store temporary files
Returns:
the session created
Throws:
java.lang.IllegalArgumentException - if the host specification contains an error
java.lang.IllegalStateException - if no suitable session can be created.

getHostSession

public static HostSession getHostSession(Host host)
Returns an HostSession based on the information in a Host CI.

Parameters:
host - the host from which to take the details.
Returns:
the session created
Throws:
java.lang.IllegalArgumentException - if the host specification contains an error
java.lang.IllegalStateException - if no suitable session can be created.


Copyright © 2010. All Rights Reserved.