org.rhq.enterprise.client
Class ClientMain

java.lang.Object
  extended by org.rhq.enterprise.client.ClientMain

public class ClientMain
extends Object

Author:
Greg Hinkle, Simeon Pinder

Field Summary
static int DEFAULT_CONSOLE_WIDTH
           
 
Constructor Summary
ClientMain()
           
 
Method Summary
 void addMenuNote(String note)
          This method allows ClientCommands to insert a small note to be displayed after the command has been executed.
 boolean executePromptCommand(String[] args)
           
 Map<String,ClientCommand> getCommands()
           
 jline.ConsoleReader getConsoleReader()
           
 int getConsoleWidth()
           
 String getHost()
           
 String getPass()
           
 int getPort()
           
 PrintWriter getPrintWriter()
           
 Recorder getRecorder()
           
 RemoteClient getRemoteClient()
           
 org.rhq.core.domain.auth.Subject getSubject()
           
 String getTransport()
           
 String getUser()
           
 String getUserInput(String prompt)
           
 boolean isInteractiveMode()
           
 boolean loggedIn()
          Indicates whether the 'Subject', used for all authenticated actions, is currently logged in.
static void main(String[] args)
           
 String[] parseCommandLine(String cmdLine)
          Given a command line, this will parse each argument and return the argument array.
 void setHost(String host)
           
 void setPass(String pass)
           
 void setPort(int port)
           
 void setPrintWriter(PrintWriter writer)
           
 void setRecorder(Recorder recorder)
           
 void setRemoteClient(RemoteClient remoteClient)
           
 void setSubject(org.rhq.core.domain.auth.Subject subject)
           
 void setTransport(String transport)
           
 void setUser(String user)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CONSOLE_WIDTH

public static final int DEFAULT_CONSOLE_WIDTH
See Also:
Constant Field Values
Constructor Detail

ClientMain

public ClientMain()
Method Detail

main

public static void main(String[] args)
                 throws Exception
Throws:
Exception

getUserInput

public String getUserInput(String prompt)

getConsoleReader

public jline.ConsoleReader getConsoleReader()

loggedIn

public boolean loggedIn()
Indicates whether the 'Subject', used for all authenticated actions, is currently logged in.

Returns:
flag indicating status of realtime check.

executePromptCommand

public boolean executePromptCommand(String[] args)
                             throws Exception
Throws:
Exception

parseCommandLine

public String[] parseCommandLine(String cmdLine)
Given a command line, this will parse each argument and return the argument array.

Parameters:
cmdLine - the command line
Returns:
the array of command line arguments

getRemoteClient

public RemoteClient getRemoteClient()

setRemoteClient

public void setRemoteClient(RemoteClient remoteClient)

getSubject

public org.rhq.core.domain.auth.Subject getSubject()

setSubject

public void setSubject(org.rhq.core.domain.auth.Subject subject)

getTransport

public String getTransport()

setTransport

public void setTransport(String transport)

getHost

public String getHost()

setHost

public void setHost(String host)

getPort

public int getPort()

setPort

public void setPort(int port)

getUser

public String getUser()

setUser

public void setUser(String user)

getPass

public String getPass()

setPass

public void setPass(String pass)

getPrintWriter

public PrintWriter getPrintWriter()

setPrintWriter

public void setPrintWriter(PrintWriter writer)

getConsoleWidth

public int getConsoleWidth()

getCommands

public Map<String,ClientCommand> getCommands()

addMenuNote

public void addMenuNote(String note)
This method allows ClientCommands to insert a small note to be displayed after the command has been executed. A note can be an indication of a problem that was handled or a note about some option that should be changed. These notes are meant to be terse, and pasted/purged at the end of every command execution.

Parameters:
note - the note to be displayed, e.g. "There were errors retrieving some data from the server objects. See System Admin."

isInteractiveMode

public boolean isInteractiveMode()

getRecorder

public Recorder getRecorder()

setRecorder

public void setRecorder(Recorder recorder)


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