org.rhq.enterprise.client.commands
Class LoginCommand

java.lang.Object
  extended by org.rhq.enterprise.client.commands.LoginCommand
All Implemented Interfaces:
ClientCommand

public class LoginCommand
extends Object
implements ClientCommand

Author:
Greg Hinkle, Simeon Pinder

Field Summary
 
Fields inherited from interface org.rhq.enterprise.client.commands.ClientCommand
COMMANDS
 
Constructor Summary
LoginCommand()
           
 
Method Summary
 boolean execute(ClientMain client, String[] args)
          Executes the agent prompt command with the given arguments.
 org.rhq.core.domain.auth.Subject execute(ClientMain client, String username, String password)
           
 org.rhq.core.domain.auth.Subject execute(ClientMain client, String username, String password, String host, int port, String transport)
           
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoginCommand

public LoginCommand()
Method Detail

getPromptCommandString

public String getPromptCommandString()
Description copied from interface: ClientCommand
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 ClientCommand
Returns:
the prompt command string - if the first prompt argument is this value, then this prompt command will be executed.

execute

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

Specified by:
execute in interface ClientCommand
Parameters:
client - the ClientMain class 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

execute

public org.rhq.core.domain.auth.Subject execute(ClientMain client,
                                                String username,
                                                String password)
                                         throws Exception
Throws:
Exception

execute

public org.rhq.core.domain.auth.Subject execute(ClientMain client,
                                                String username,
                                                String password,
                                                String host,
                                                int port,
                                                String transport)
                                         throws Exception
Throws:
Exception

getSyntax

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

Specified by:
getSyntax in interface ClientCommand
Returns:
syntax string

getHelp

public String getHelp()
Description copied from interface: ClientCommand
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 ClientCommand
Returns:
help string

getDetailedHelp

public String getDetailedHelp()
Description copied from interface: ClientCommand
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 ClientCommand
Returns:
detailed help string


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