com.xebialabs.deployit.hostsession.ssh
Class SshSudoPasswordPromptHandler

java.lang.Object
  extended by com.xebialabs.deployit.hostsession.ssh.SshSudoPasswordPromptHandler
All Implemented Interfaces:
CommandExecutionCallbackHandler

public class SshSudoPasswordPromptHandler
extends java.lang.Object
implements CommandExecutionCallbackHandler

Decorates a CommandExecutionCallbackHandler, handling SUDO password prompts transparently and removing them from the output passed to the decorated handler.


Constructor Summary
SshSudoPasswordPromptHandler(CommandExecutionCallbackHandler decoratedHandler, java.io.OutputStream remoteStdin, java.lang.String password)
           
 
Method Summary
 void handleErrorLine(java.lang.String line)
          Invoked when an executed command generated a line of error (stderr).
 void handleOutput(char c)
          Invoked when an executed command generates a character of output (stdout).
 void handleOutputLine(java.lang.String line)
          Invoked when an executed command generated a line of output (stdout).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SshSudoPasswordPromptHandler

public SshSudoPasswordPromptHandler(CommandExecutionCallbackHandler decoratedHandler,
                                    java.io.OutputStream remoteStdin,
                                    java.lang.String password)
Method Detail

handleOutput

public void handleOutput(char c)
Description copied from interface: CommandExecutionCallbackHandler
Invoked when an executed command generates a character of output (stdout).

Specified by:
handleOutput in interface CommandExecutionCallbackHandler
Parameters:
c - the character of output generated.

handleOutputLine

public void handleOutputLine(java.lang.String line)
Description copied from interface: CommandExecutionCallbackHandler
Invoked when an executed command generated a line of output (stdout).

Specified by:
handleOutputLine in interface CommandExecutionCallbackHandler
Parameters:
line - the line of output generated.

handleErrorLine

public void handleErrorLine(java.lang.String line)
Description copied from interface: CommandExecutionCallbackHandler
Invoked when an executed command generated a line of error (stderr).

Specified by:
handleErrorLine in interface CommandExecutionCallbackHandler
Parameters:
line - the line of output generated.


Copyright © 2010. All Rights Reserved.