org.rhq.enterprise.agent.promptcmd
Class SetupPromptCommand

java.lang.Object
  extended by org.rhq.enterprise.agent.promptcmd.SetupPromptCommand
All Implemented Interfaces:
AgentPromptCommand

public class SetupPromptCommand
extends Object
implements AgentPromptCommand

Sets up the agent with configuration information that the user enters at the prompt.

Author:
John Mazzitelli

Constructor Summary
SetupPromptCommand()
           
 
Method Summary
 boolean execute(AgentMain agent, String[] args)
          Executes the agent prompt command with the given arguments.
 String getDetailedHelp()
          Returns a detailed help message to describe to the user what the command's syntax is and any detailed information that is useful to the user that wants to use this command.
 String getHelp()
          Returns a help summary to describe to the user what the prompt command does and its purpose.
 String getPromptCommandString()
          All implementations must indicate what the prompt command is that will trigger its execution.
 String getSyntax()
          Returns a one-line usage string to describe the syntax of the command including all optional and required arguments.
 void performAdvancedSetup(Preferences prefs, PromptInput in, PrintWriter out)
          This performs the actual setup by executing the setup instructions - it asks for some additional configuration settings above and beyond the basic setup allowing for a more advanced ability to configure the agent.
 void performAllSetup(Preferences prefs, PromptInput in, PrintWriter out)
          This performs the actual setup by executing the setup instructions - it asks for practically all possible configuration settings allowing for a complete ability to configure the agent.
 void performBasicSetup(Preferences prefs, PromptInput in, PrintWriter out)
          This performs the actual setup by executing the setup instructions - it only asks for a minimal, basic set of setup values to get the agent up and running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetupPromptCommand

public SetupPromptCommand()
Method Detail

getPromptCommandString

public String getPromptCommandString()
Description copied from interface: AgentPromptCommand
All implementations must indicate what the prompt command is that will trigger its execution. This method returns the prompt command name.

Specified by:
getPromptCommandString in interface AgentPromptCommand
Returns:
the prompt command string - if the first prompt argument is this value, then this prompt command will be executed.
See Also:
AgentPromptCommand.getPromptCommandString()

execute

public boolean execute(AgentMain agent,
                       String[] args)
Description copied from interface: AgentPromptCommand
Executes the agent prompt command with the given arguments.

Specified by:
execute in interface AgentPromptCommand
Parameters:
agent - the agent itself
args - the arguments passed to the agent on the agent prompt
Returns:
true if the agent can continue accepting prompt commands; false if the agent should die
See Also:
AgentPromptCommand.execute(AgentMain, String[])

performBasicSetup

public void performBasicSetup(Preferences prefs,
                              PromptInput in,
                              PrintWriter out)
This performs the actual setup by executing the setup instructions - it only asks for a minimal, basic set of setup values to get the agent up and running.

Parameters:
prefs - the agent's configuration preferences
in - the input that the agent uses to get user input
out - the output stream that the agent uses to show messages to the user

performAdvancedSetup

public void performAdvancedSetup(Preferences prefs,
                                 PromptInput in,
                                 PrintWriter out)
This performs the actual setup by executing the setup instructions - it asks for some additional configuration settings above and beyond the basic setup allowing for a more advanced ability to configure the agent.

Parameters:
prefs - the agent's configuration preferences
in - the input stream that the agent uses to get user input
out - the output stream that the agent uses to show messages to the user

performAllSetup

public void performAllSetup(Preferences prefs,
                            PromptInput in,
                            PrintWriter out)
This performs the actual setup by executing the setup instructions - it asks for practically all possible configuration settings allowing for a complete ability to configure the agent.

Parameters:
prefs - the agent's configuration preferences
in - the input that the agent uses to get user input
out - the output stream that the agent uses to show messages to the user

getSyntax

public String getSyntax()
Description copied from interface: AgentPromptCommand
Returns a one-line usage string to describe the syntax of the command including all optional and required arguments.

Specified by:
getSyntax in interface AgentPromptCommand
Returns:
syntax string
See Also:
AgentPromptCommand.getSyntax()

getHelp

public String getHelp()
Description copied from interface: AgentPromptCommand
Returns a help summary to describe to the user what the prompt command does and its purpose. It is usually a short one line help summary.

Specified by:
getHelp in interface AgentPromptCommand
Returns:
help string
See Also:
AgentPromptCommand.getHelp()

getDetailedHelp

public String getDetailedHelp()
Description copied from interface: AgentPromptCommand
Returns a detailed help message to describe to the user what the command's syntax is and any detailed information that is useful to the user that wants to use this command.

Specified by:
getDetailedHelp in interface AgentPromptCommand
Returns:
detailed help string
See Also:
AgentPromptCommand.getDetailedHelp()


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