edu.utk.cs.icl.rest.comm
Class GsapUserInfo

java.lang.Object
  extended byedu.utk.cs.icl.rest.comm.GsapUserInfo
All Implemented Interfaces:
com.jcraft.jsch.UIKeyboardInteractive, com.jcraft.jsch.UserInfo

public class GsapUserInfo
extends Object
implements com.jcraft.jsch.UserInfo, com.jcraft.jsch.UIKeyboardInteractive

Prompts user when needed for things such as password, passphrase, and yes/no.


Constructor Summary
GsapUserInfo()
          Create a blank GsapUserInfo w/ no stored password or passphrase
 
Method Summary
 char[] getPassphrase()
          Get the passphrase from the user.
 char[] getPassword()
          Get the password from the user.
 boolean isGrouped()
          Getter for property grouped.
static boolean isHeadless()
           
 char[][] promptKeyboardInteractive(String destination, String name, String instruction, String[] prompt, boolean[] echo)
           
 boolean promptPassphrase(String message)
          Print the passphrase prompt.
 boolean promptPassword(String message)
          Print the password prompt
 boolean promptYesNo(String message)
          Print a yes or no prompt.
 boolean promptYesNo(String shortMsg, String message)
          Print a yes or no prompt.
 boolean promptYesNo(String shortMsg, String message, String tooltip)
          Print a yes or no prompt.
 void purgePassphrase()
          Forget saved passphrase.
 void purgePassword()
          Forget saved password.
 void purgePassword(boolean groupFinished)
           
 void setGrouped(boolean grouped)
          Setter for property grouped.
 void setGrouped(String grouped)
           
static void setHeadless(boolean b)
           
 void setPassphrase(char[] pwd)
          Set the passphrase
 void setPassword(char[] pwd)
          Set the password
 void showMessage(String message)
          Print a message to the user.
 void showMessage(String shortMsg, String message)
          Print a message to the user.
 void showMessage(String shortMsg, String message, String tooltip)
          Print a message to the user.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GsapUserInfo

public GsapUserInfo()
Create a blank GsapUserInfo w/ no stored password or passphrase

Method Detail

setHeadless

public static void setHeadless(boolean b)

isHeadless

public static boolean isHeadless()

setGrouped

public void setGrouped(boolean grouped)
Setter for property grouped.

Parameters:
grouped - New value of property grouped.

setGrouped

public void setGrouped(String grouped)

isGrouped

public boolean isGrouped()
Getter for property grouped.

Returns:
Value of property grouped.

setPassphrase

public void setPassphrase(char[] pwd)
Set the passphrase

Parameters:
pwd - as char[]

getPassphrase

public char[] getPassphrase()
Get the passphrase from the user.

Specified by:
getPassphrase in interface com.jcraft.jsch.UserInfo
Returns:
Passphrase as a char[]

setPassword

public void setPassword(char[] pwd)
Set the password

Parameters:
pwd - as char[]

getPassword

public char[] getPassword()
Get the password from the user.

Specified by:
getPassword in interface com.jcraft.jsch.UserInfo
Returns:
Password as char[]

promptKeyboardInteractive

public char[][] promptKeyboardInteractive(String destination,
                                          String name,
                                          String instruction,
                                          String[] prompt,
                                          boolean[] echo)
Specified by:
promptKeyboardInteractive in interface com.jcraft.jsch.UIKeyboardInteractive

promptPassphrase

public boolean promptPassphrase(String message)
Print the passphrase prompt.

Specified by:
promptPassphrase in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user
Returns:
If the passphrase was entered

promptPassword

public boolean promptPassword(String message)
Print the password prompt

Specified by:
promptPassword in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user
Returns:
If the password was entered

promptYesNo

public boolean promptYesNo(String message)
Print a yes or no prompt.

Specified by:
promptYesNo in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user
Returns:
True/False, usere's choice.

promptYesNo

public boolean promptYesNo(String shortMsg,
                           String message)
Print a yes or no prompt.

Specified by:
promptYesNo in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user
Returns:
True/False, usere's choice.

promptYesNo

public boolean promptYesNo(String shortMsg,
                           String message,
                           String tooltip)
Print a yes or no prompt.

Specified by:
promptYesNo in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user
Returns:
True/False, usere's choice.

purgePassphrase

public void purgePassphrase()
Forget saved passphrase. Maybe we can do this more securly later by writing over the saved data before setting to empty;


purgePassword

public void purgePassword()
Forget saved password. Maybe we can do this more securly later by writing over the saved data before setting to empty;


purgePassword

public void purgePassword(boolean groupFinished)

showMessage

public void showMessage(String message)
Print a message to the user.

Specified by:
showMessage in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user

showMessage

public void showMessage(String shortMsg,
                        String message)
Print a message to the user.

Specified by:
showMessage in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user

showMessage

public void showMessage(String shortMsg,
                        String message,
                        String tooltip)
Print a message to the user.

Specified by:
showMessage in interface com.jcraft.jsch.UserInfo
Parameters:
message - Message to display to the user