com.sun.enterprise.admin.cli.remote
Class RemoteCommand.CLIRemoteAdminCommand

java.lang.Object
  extended by com.sun.enterprise.admin.remote.RemoteAdminCommand
      extended by com.sun.enterprise.admin.cli.remote.RemoteCommand.CLIRemoteAdminCommand
Enclosing class:
RemoteCommand

private class RemoteCommand.CLIRemoteAdminCommand
extends RemoteAdminCommand

A special RemoteAdminCommand that overrides methods so that we can handle the interactive requirements of a CLI command.


Field Summary
 
Fields inherited from class com.sun.enterprise.admin.remote.RemoteAdminCommand
authToken, host, logger, name, operands, options, output, password, port, prohibitDirectoryUploads, secure, user
 
Constructor Summary
RemoteCommand.CLIRemoteAdminCommand(java.lang.String name, java.lang.String host, int port, boolean secure, java.lang.String user, java.lang.String password, java.util.logging.Logger logger, java.lang.String authToken)
          Construct a new remote command object.
 
Method Summary
protected  java.lang.String getFromEnvironment(java.lang.String name)
          Get from environment.
protected  java.lang.String reportAuthenticationException()
          Return the error message to be used in the AuthenticationException.
protected  boolean retryUsingSecureConnection(java.lang.String host, int port)
          Called when a non-secure connection attempt fails and it appears that the server requires a secure connection.
protected  boolean updateAuthentication()
          If we're interactive, prompt for a new username and password.
 
Methods inherited from class com.sun.enterprise.admin.remote.RemoteAdminCommand
addAdditionalHeaders, authenticationInfo, executeCommand, getAttributes, getCommandModel, getHttpConnectorAddress, getReadTimeout, getUsage, headers, setCommandModel, setConnectTimeout, setFileOutputDirectory, setInteractive, setReadTimeout, setResponseFormatType, setUserOut
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteCommand.CLIRemoteAdminCommand

public RemoteCommand.CLIRemoteAdminCommand(java.lang.String name,
                                           java.lang.String host,
                                           int port,
                                           boolean secure,
                                           java.lang.String user,
                                           java.lang.String password,
                                           java.util.logging.Logger logger,
                                           java.lang.String authToken)
                                    throws CommandException
Construct a new remote command object. The command and arguments are supplied later using the execute method in the superclass.

Throws:
CommandException
Method Detail

updateAuthentication

protected boolean updateAuthentication()
If we're interactive, prompt for a new username and password. Return true if we're successful in collecting new information (and thus the caller should try the request again).

Overrides:
updateAuthentication in class RemoteAdminCommand

getFromEnvironment

protected java.lang.String getFromEnvironment(java.lang.String name)
Get from environment.

Overrides:
getFromEnvironment in class RemoteAdminCommand

retryUsingSecureConnection

protected boolean retryUsingSecureConnection(java.lang.String host,
                                             int port)
Called when a non-secure connection attempt fails and it appears that the server requires a secure connection. Tell the user that we're retrying.

Overrides:
retryUsingSecureConnection in class RemoteAdminCommand

reportAuthenticationException

protected java.lang.String reportAuthenticationException()
Return the error message to be used in the AuthenticationException. Subclasses can override to provide a more detailed message, for example, indicating the source of the password that failed.

Overrides:
reportAuthenticationException in class RemoteAdminCommand


Copyright © 2012 GlassFish Community. All Rights Reserved.