com.mindbright.ssh2
Interface SSH2Interactor

All Known Implementing Classes:
BasicClient, MindTermLite, SSHInteractiveClient

public interface SSH2Interactor

This interface defines the different types of prompts which are needed for interactive authentication. It's made generic to be able to allow flexibility in the level of sophistication one wants for user interaction.

Which of these functions are called and with which prompts are provided is entirely up to the ssh-server. The server expects that these functions will interact via graphical dialogs with the user. Therefore the function calls includes things as instructions and suggested names of dialogs and settings which tells if the user should see what they type echo or not, as when entering passwords.

See Also:
SSH2AuthKbdInteract, SSH2AuthPassword

Method Summary
 java.lang.String promptLine(java.lang.String prompt, boolean echo)
          Prompt for a single string.
 int promptList(java.lang.String name, java.lang.String instruction, java.lang.String[] choices)
          This function is only used by AppGate internal code so there is no need to actually implement it in any other code.
 java.lang.String[] promptMulti(java.lang.String[] prompts, boolean[] echos)
          Prompt for multiple strings.
 java.lang.String[] promptMultiFull(java.lang.String name, java.lang.String instruction, java.lang.String[] prompts, boolean[] echos)
          Prompt for multiple strings.
 

Method Detail

promptLine

java.lang.String promptLine(java.lang.String prompt,
                            boolean echo)
                            throws SSH2UserCancelException
Prompt for a single string.

Parameters:
prompt - The prompt string to show
echo - True if the text the user enters should be echoed.
Returns:
The text entered by the user.
Throws:
SSH2UserCancelException

promptMulti

java.lang.String[] promptMulti(java.lang.String[] prompts,
                               boolean[] echos)
                               throws SSH2UserCancelException
Prompt for multiple strings. The expectation here is that the client will put up a dialog where the user sees multiple prompts and input fields.

Parameters:
prompts - List of prompts to show
echos - List of boolean values which indicates if the text entered for the corresponding prompt should be echoed.
Returns:
An array of strings which contains on element for each prompt, in the same order. The elements should contain the text the user entered.
Throws:
SSH2UserCancelException

promptMultiFull

java.lang.String[] promptMultiFull(java.lang.String name,
                                   java.lang.String instruction,
                                   java.lang.String[] prompts,
                                   boolean[] echos)
                                   throws SSH2UserCancelException
Prompt for multiple strings. The expectation here is that the client will put up a dialog where the user sees multiple prompts and input fields. This version of the call includes more elements which should be shown in the dialog.

Parameters:
name - Suggested title of the dialog
instruction - Instructions to show to user in the dialog
prompts - List of prompts to show
echos - List of boolean values which indicates if the text entered for the corresponding prompt should be echoed.
Returns:
An array of strings which contains on element for each prompt, in the same order. The elements should contain the text the user entered.
Throws:
SSH2UserCancelException

promptList

int promptList(java.lang.String name,
               java.lang.String instruction,
               java.lang.String[] choices)
               throws SSH2UserCancelException
This function is only used by AppGate internal code so there is no need to actually implement it in any other code.

It is used to let the user select one element in a list.

Parameters:
name - Suggested title of dialog
instruction - Instructions to show to user
choices - Array of possible choices
Returns:
index of selected list item
Throws:
SSH2UserCancelException