public class ServerRemoteAdminCommand extends RemoteAdminCommand
This class identifies the origin as a server (as opposed to a true admin client) for server-to-server authentication.
authToken, COMMAND_MODEL_MATCH_HEADER, host, logger, name, operands, options, output, password, port, prohibitDirectoryUploads, scope, secure, user
Constructor and Description |
---|
ServerRemoteAdminCommand(org.glassfish.hk2.api.ServiceLocator habitat,
String name,
String host,
int port,
boolean secure,
String user,
String password,
Logger logger) |
Modifier and Type | Method and Description |
---|---|
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.
|
executeCommand, fetchCommandModel, getAttributes, getCanonicalHost, getCommandModel, getCommandURI, getFromEnvironment, getReadTimeout, getUsage, headers, isCommandModelFromCache, processHeaders, reportAuthenticationException, retryUsingSecureConnection, setCommandModel, setConnectTimeout, setFileOutputDirectory, setInteractive, setOmitCache, setReadTimeout, setResponseFormatType, setUserOut, updateAuthentication
public ServerRemoteAdminCommand(org.glassfish.hk2.api.ServiceLocator habitat, String name, String host, int port, boolean secure, String user, String password, Logger logger) throws CommandException
CommandException
protected HttpConnectorAddress getHttpConnectorAddress(String host, int port, boolean shouldUseSecure)
RemoteAdminCommand
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.
getHttpConnectorAddress
in class RemoteAdminCommand
host
- the host name to which the connection should be madeport
- the admin port on that hostshouldUseSecure
- whether SSL should be used to connect or notprotected AuthenticationInfo authenticationInfo()
authenticationInfo
in class RemoteAdminCommand
protected void addAdditionalHeaders(URLConnection urlConnection)
addAdditionalHeaders
in class RemoteAdminCommand
urlConnection
- Copyright © 2019. All rights reserved.