org.rhq.enterprise.agent
Class JavaAgentInputReader

java.lang.Object
  extended by org.rhq.enterprise.agent.JavaAgentInputReader
All Implemented Interfaces:
AgentInputReader
Direct Known Subclasses:
SigarAgentInputReader

public class JavaAgentInputReader
extends Object
implements AgentInputReader


Constructor Summary
JavaAgentInputReader()
           
JavaAgentInputReader(FileReader fr)
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaAgentInputReader

public JavaAgentInputReader()
                     throws IOException
Throws:
IOException

JavaAgentInputReader

public JavaAgentInputReader(FileReader fr)
                     throws IOException
Throws:
IOException
Method Detail

isConsole

public boolean isConsole()
Description copied from interface: AgentInputReader
Indicates if the input is coming from a console (i.e. keyboard) or if its coming from a file.

Specified by:
isConsole in interface AgentInputReader
Returns:
true if console is the source of the input; false if file is the source

readLine

public String readLine()
                throws IOException
Description copied from interface: AgentInputReader
Reads a line from the input console.

Specified by:
readLine in interface AgentInputReader
Returns:
the line
Throws:
IOException

readLineNoEcho

public String readLineNoEcho()
                      throws IOException
Description copied from interface: AgentInputReader
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.

Specified by:
readLineNoEcho in interface AgentInputReader
Returns:
the line typed by the user
Throws:
IOException

close

public void close()
           throws IOException
Description copied from interface: AgentInputReader
Close the reader.

Specified by:
close in interface AgentInputReader
Throws:
IOException


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