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 java.lang.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 java.lang.String getDomain()
           
static java.lang.String getPartition()
           
static java.lang.String getPassword()
           
static java.lang.String getRealm()
           
static java.lang.String getUsername()
           
static java.lang.String readTrimmedLine(java.io.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(java.lang.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(java.lang.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 java.lang.String readTrimmedLine(java.io.BufferedReader reader)
                                              throws java.io.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:
java.io.IOException - propogates any IOException encountered while reading a line

getUsername

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

getPassword

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

getDomain

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

getPartition

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

getRealm

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


Copyright © 2013 SunGard CSA LLC. All Rights Reserved.