org.rhq.enterprise.agent
Interface AgentInputReader

All Known Implementing Classes:
JavaAgentInputReader, JLineAgentInputReader, SigarAgentInputReader

public interface AgentInputReader

Abstracts out the console input to allow us to use either a native console or a Java based console.

Author:
John Mazzitelli

Method Summary
 void close()
          Close the reader.
 boolean isConsole()
          Indicates if the input is coming from a console (i.e.
 String readLine()
          Reads a line from the input console.
 String readLineNoEcho()
          Read a line of input, but do not echo back to the user what is being typed.
 

Method Detail

isConsole

boolean isConsole()
Indicates if the input is coming from a console (i.e. keyboard) or if its coming from a file.

Returns:
true if console is the source of the input; false if file is the source

readLine

String readLine()
                throws IOException
Reads a line from the input console.

Returns:
the line
Throws:
IOException

readLineNoEcho

String readLineNoEcho()
                      throws IOException
Read a line of input, but do not echo back to the user what is being typed. This is used mainly when asking for things like passwords. If the console implementation does not support no-echo input, the input will be output as the user typed it.

Returns:
the line typed by the user
Throws:
IOException

close

void close()
           throws IOException
Close the reader.

Throws:
IOException


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.