public class ServerRemoteRestAdminCommand extends RemoteRestAdminCommand
This class identifies the origin as a server (as opposed to a true admin client) for server-to-server authentication.
AdminCommandEventBroker.AdminCommandListener<T>, AdminCommandEventBroker.BrokerListenerRegEvent, AdminCommandEventBroker.EventBrokerUtils
authToken, COMMAND_MODEL_MATCH_HEADER, host, logger, name, notify, operands, options, output, password, port, prohibitDirectoryUploads, scope, secure, user
LOCAL_EVENT_PREFIX
Constructor and Description |
---|
ServerRemoteRestAdminCommand(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.
|
closeSse, executeCommand, fetchCommandModel, findPropertyInReport, getActionReport, getAttributes, getCanonicalHost, getCommandModel, getCommandURI, getFromEnvironment, getManPage, getReadTimeout, getUsage, headers, isCommandModelFromCache, preinit, processHeaders, refetchInvalidModel, reportAuthenticationException, retryUsingSecureConnection, setActionReport, setCommandModel, setConnectTimeout, setEnableCommandModelCache, setFileOutputDirectory, setInteractive, setReadTimeout, setResponseFormatType, setUserOut, updateAuthentication, useSse
fireEvent, fireEvent, getUtils, listening, registerListener, unregisterListener
public ServerRemoteRestAdminCommand(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)
RemoteRestAdminCommand
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 RemoteRestAdminCommand
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 RemoteRestAdminCommand
protected void addAdditionalHeaders(URLConnection urlConnection)
addAdditionalHeaders
in class RemoteRestAdminCommand
urlConnection
- Copyright © 2019. All rights reserved.