org.rhq.enterprise.agent
Class JLineAgentInputReader

java.lang.Object
  extended by org.rhq.enterprise.agent.JLineAgentInputReader
All Implemented Interfaces:
AgentInputReader

public class JLineAgentInputReader
extends Object
implements AgentInputReader


Constructor Summary
JLineAgentInputReader(AgentMain agent)
           
JLineAgentInputReader(AgentMain agent, FileInputStream fis)
           
 
Method Summary
 void addCompletor()
           
 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

JLineAgentInputReader

public JLineAgentInputReader(AgentMain agent)
                      throws IOException
Throws:
IOException

JLineAgentInputReader

public JLineAgentInputReader(AgentMain agent,
                             FileInputStream fis)
                      throws IOException
Throws:
IOException
Method Detail

addCompletor

public void addCompletor()

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.