Package com.sun.enterprise.admin.remote
Class ServerRemoteRestAdminCommand
- java.lang.Object
-
- com.sun.enterprise.admin.event.AdminCommandEventBrokerImpl<GfSseInboundEvent>
-
- com.sun.enterprise.admin.remote.RemoteRestAdminCommand
-
- com.sun.enterprise.admin.remote.ServerRemoteRestAdminCommand
-
- All Implemented Interfaces:
org.glassfish.api.admin.AdminCommandEventBroker<GfSseInboundEvent>
- Direct Known Subclasses:
InstanceRestCommandExecutor
public class ServerRemoteRestAdminCommand extends RemoteRestAdminCommand
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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.glassfish.api.admin.AdminCommandEventBroker
org.glassfish.api.admin.AdminCommandEventBroker.AdminCommandListener<T extends Object>, org.glassfish.api.admin.AdminCommandEventBroker.BrokerListenerRegEvent, org.glassfish.api.admin.AdminCommandEventBroker.EventBrokerUtils
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddAdditionalHeaders(URLConnection urlConnection)Adds the admin indicator header to the request so.protected AuthenticationInfoauthenticationInfo()protected HttpConnectorAddressgetHttpConnectorAddress(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.RemoteRestAdminCommand
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
-
Methods inherited from class com.sun.enterprise.admin.event.AdminCommandEventBrokerImpl
fireEvent, fireEvent, getUtils, listening, registerListener, unregisterListener
-
-
-
-
Constructor Detail
-
ServerRemoteRestAdminCommand
public ServerRemoteRestAdminCommand(org.glassfish.hk2.api.ServiceLocator habitat, String name, String host, int port, boolean secure, String user, String password, Logger logger) throws org.glassfish.api.admin.CommandException- Throws:
org.glassfish.api.admin.CommandException
-
-
Method Detail
-
getHttpConnectorAddress
protected HttpConnectorAddress getHttpConnectorAddress(String host, int port, boolean shouldUseSecure)
Description copied from class:RemoteRestAdminCommandProvides 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:
getHttpConnectorAddressin classRemoteRestAdminCommand- Parameters:
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 not- Returns:
-
authenticationInfo
protected AuthenticationInfo authenticationInfo()
- Overrides:
authenticationInfoin classRemoteRestAdminCommand
-
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:
addAdditionalHeadersin classRemoteRestAdminCommand- Parameters:
urlConnection-
-
-