org.eclipse.stardust.engine.cli.security.authentication
Class ConsolePrompt

java.lang.Object
  extended by org.eclipse.stardust.engine.cli.security.authentication.ConsolePrompt

public class ConsolePrompt
extends Object

Utility class used to prompt for and reading user credentials when login is done from console (System.out) .

Version:
$Revision$
Author:
ubirkemeyer

Constructor Summary
ConsolePrompt()
           
 
Method Summary
static String getDomain()
           
static String getPartition()
           
static String getPassword()
           
static String getRealm()
           
static String getUsername()
           
static String readTrimmedLine(BufferedReader reader)
          Reads a single trimmed-line from the reader.
static void show()
          Prompts for credentials and reads them from console (System.out).
static void writeToConsole(String message)
          Writes the given message to the console (System.out) and flushes it to make sure that it is written.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsolePrompt

public ConsolePrompt()
Method Detail

show

public static void show()
Prompts for credentials and reads them from console (System.out).


writeToConsole

public static final void writeToConsole(String message)
Writes the given message to the console (System.out) and flushes it to make sure that it is written.

Parameters:
message - message to be written to the console. Even null is accepted.

readTrimmedLine

public static final String readTrimmedLine(BufferedReader reader)
                                    throws IOException
Reads a single trimmed-line from the reader. Note: It is a blocking operation and blocks till a line is available to be read.

Parameters:
reader - to read from
Returns:
null if no line could be read or a trimmed line from the reader
Throws:
IOException - propogates any IOException encountered while reading a line

getUsername

public static String getUsername()
Returns:
the username. May be an empty string or null.

getPassword

public static String getPassword()
Returns:
the password. May be an empty string or null.

getDomain

public static String getDomain()
Returns:
the domain. May be an empty string or null.

getPartition

public static String getPartition()
Returns:
the partition. May be an empty string or null.

getRealm

public static String getRealm()
Returns:
the realm. May be an empty string or null.


Copyright © 2017 Eclipse Stardust. All Rights Reserved.