com.xebialabs.deployit.hostsession.cifs
Class CifsTelnetHostSession

java.lang.Object
  extended by com.xebialabs.deployit.hostsession.common.AbstractHostSession
      extended by com.xebialabs.deployit.hostsession.cifs.CifsTelnetHostSession
All Implemented Interfaces:
HostSession

public class CifsTelnetHostSession
extends AbstractHostSession
implements HostSession


Field Summary
static int EXITCODE_CANNOT_DETERMINE_ERRORLEVEL
          The exitcode returned when the errorlevel of the Windows command could not be determined.
 
Fields inherited from class com.xebialabs.deployit.hostsession.common.AbstractHostSession
MAX_TEMP_RETRIES
 
Constructor Summary
CifsTelnetHostSession(OperatingSystemFamily osFamily, java.lang.String temporaryDirectoryPath, java.lang.String address, int port, java.lang.String username, java.lang.String password)
           
 
Method Summary
 int execute(CommandExecutionCallbackHandler handler, java.util.Map<java.lang.String,java.lang.String> inputResponse, java.lang.String... commandLine)
          Executes a command and responds to any output with the provided responses.
 int execute(CommandExecutionCallbackHandler handler, java.lang.String... commandLine)
          Executes a command with its arguments.
 HostFile getFile(HostFile parent, java.lang.String child)
          Creates a reference to a file in a directory on the host.
 HostFile getFile(java.lang.String hostPath)
          Creates a reference to a file on the host.
 HostFile getTempFile(java.lang.String prefix, java.lang.String suffix)
          Creates a reference to a temporary file on the host.
 CommandExecution startExecute(java.lang.String... commandLine)
          Starts the execution of a command and gives the caller full control over the execution.
 java.lang.String toString()
           
 
Methods inherited from class com.xebialabs.deployit.hostsession.common.AbstractHostSession
cleanupTemporaryFiles, close, copyToTemporaryFile, copyToTemporaryFile, createSessionTempDirectory, getHostOperatingSystem, getTempFile, getTemporaryDirectory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.xebialabs.deployit.hostsession.HostSession
close, copyToTemporaryFile, copyToTemporaryFile, getHostOperatingSystem, getTempFile
 

Field Detail

EXITCODE_CANNOT_DETERMINE_ERRORLEVEL

public static final int EXITCODE_CANNOT_DETERMINE_ERRORLEVEL
The exitcode returned when the errorlevel of the Windows command could not be determined.

See Also:
Constant Field Values
Constructor Detail

CifsTelnetHostSession

public CifsTelnetHostSession(OperatingSystemFamily osFamily,
                             java.lang.String temporaryDirectoryPath,
                             java.lang.String address,
                             int port,
                             java.lang.String username,
                             java.lang.String password)
Method Detail

execute

public int execute(CommandExecutionCallbackHandler handler,
                   java.lang.String... commandLine)
            throws RuntimeIOException
Description copied from interface: HostSession
Executes a command with its arguments.

Specified by:
execute in interface HostSession
Parameters:
handler - the callback handler that will be invoked when the executed command generated output.
commandLine - the command line to execute. The first element is the command, the other elements are its arguments.
Returns:
the exit value of the executed command. Is 0 on succesfull execution.
Throws:
RuntimeIOException - if an I/O error occurs

execute

public int execute(CommandExecutionCallbackHandler handler,
                   java.util.Map<java.lang.String,java.lang.String> inputResponse,
                   java.lang.String... commandLine)
Description copied from interface: HostSession
Executes a command and responds to any output with the provided responses.

Specified by:
execute in interface HostSession
Parameters:
handler - the callback handler that will be invoked when the executed command generated output.
inputResponse - expected output and the response to send
commandLine - the command line to execute. The first element is the command, the other elements are its arguments.
Returns:
the exit value of the executed command. Is 0 on succesfull execution.

startExecute

public CommandExecution startExecute(java.lang.String... commandLine)
Description copied from interface: HostSession
Starts the execution of a command and gives the caller full control over the execution.

Specified by:
startExecute in interface HostSession
Parameters:
commandLine - the command line to execute. The first element is the command, the other elements are its arguments.
Returns:
an object representing the executing command or null if this is not supported by the host session.

getFile

public HostFile getFile(java.lang.String hostPath)
                 throws RuntimeIOException
Description copied from interface: HostSession
Creates a reference to a file on the host.

Specified by:
getFile in interface HostSession
Parameters:
hostPath - the path of the host
Returns:
a reference to the file
Throws:
RuntimeIOException - if an I/O error occurs

getFile

public HostFile getFile(HostFile parent,
                        java.lang.String child)
                 throws RuntimeIOException
Description copied from interface: HostSession
Creates a reference to a file in a directory on the host.

Specified by:
getFile in interface HostSession
Parameters:
parent - the reference to the directory on the host
child - the name of the file in the directory
Returns:
a reference to the file in the directory
Throws:
RuntimeIOException - if an I/O error occurs

getTempFile

public HostFile getTempFile(java.lang.String prefix,
                            java.lang.String suffix)
                     throws RuntimeIOException
Description copied from interface: HostSession
Creates a reference to a temporary file on the host. This file has a unique name and will be automatically removed when this session is closed. N.B.: The file is not actually created until a put method is invoked.

Specified by:
getTempFile in interface HostSession
Parameters:
prefix - the prefix string to be used in generating the file's name; must be at least three characters long
suffix - the suffix string to be used in generating the file's name; may be null, in which case the suffix ".tmp" will be used
Returns:
a reference to the temporary file on the host
Throws:
RuntimeIOException - if an I/O error occurs

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.