com.sun.enterprise.admin.remote
Class ServerRemoteAdminCommand

java.lang.Object
  extended by com.sun.enterprise.admin.remote.RemoteAdminCommand
      extended by com.sun.enterprise.admin.remote.ServerRemoteAdminCommand
Direct Known Subclasses:
InstanceCommandExecutor

public class ServerRemoteAdminCommand
extends RemoteAdminCommand

RemoteAdminCommand which is sent from a server (DAS or instance).

This class identifies the origin as a server (as opposed to a true admin client) for server-to-server authentication.

Author:
Tim Quinn

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
ServerRemoteAdminCommand(org.jvnet.hk2.component.Habitat habitat, String name, String host, int port, boolean secure, String user, String password, Logger logger)
           
 
Method Summary
protected  void addAdditionalHeaders(URLConnection urlConnection)
          Adds the admin indicator header to the request so.
protected  AuthenticationInfo authenticationInfo()
           
protected  HttpConnectorAddress getHttpConnectorAddress(String host, int port, boolean shouldUseSecure)
          Provides an HttpConnectorAddress for use in connecting to the desired admin listener.
 
Methods inherited from class com.sun.enterprise.admin.remote.RemoteAdminCommand
executeCommand, getAttributes, getCommandModel, getFromEnvironment, getReadTimeout, getUsage, headers, reportAuthenticationException, retryUsingSecureConnection, setCommandModel, setConnectTimeout, setFileOutputDirectory, setInteractive, setReadTimeout, setResponseFormatType, setUserOut, updateAuthentication
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServerRemoteAdminCommand

public ServerRemoteAdminCommand(org.jvnet.hk2.component.Habitat habitat,
                                String name,
                                String host,
                                int port,
                                boolean secure,
                                String user,
                                String password,
                                Logger logger)
                         throws CommandException
Throws:
CommandException
Method Detail

getHttpConnectorAddress

protected HttpConnectorAddress getHttpConnectorAddress(String host,
                                                       int port,
                                                       boolean shouldUseSecure)
Description copied from class: RemoteAdminCommand
Provides an HttpConnectorAddress for use in connecting to the desired admin listener.

This implementation works for true admin clients and will not work correctly for commands submitted to instances from inside the DAS. (That is done from the implementation in ServerRemoteAdminCommand which extends this class.)

This code constructs the HttpConnectorAddress in a way that uses either no SSLSocketFactory (if security is off) or uses an SSLSocketFactory linked to the asadmin truststore.

Overrides:
getHttpConnectorAddress in class RemoteAdminCommand
Parameters:
host - the host name to which the connection should be made
port - the admin port on that host
shouldUseSecure - whether SSL should be used to connect or not
Returns:

authenticationInfo

protected AuthenticationInfo authenticationInfo()
Overrides:
authenticationInfo in class RemoteAdminCommand

addAdditionalHeaders

protected void addAdditionalHeaders(URLConnection urlConnection)
Adds the admin indicator header to the request so. Do this whether secure admin is enabled or not, because the indicator is unique among domains to help make sure only processes in the same domain talk to each other.

Overrides:
addAdditionalHeaders in class RemoteAdminCommand
Parameters:
urlConnection -


Copyright © 2012 GlassFish Community. All Rights Reserved.