@Service(name="enable-secure-admin") @PerLookup @ExecuteOn(value={DAS,INSTANCE}) public class EnableSecureAdminCommand extends SecureAdminCommand
###
### create new protocol for secure admin
###
asadmin create-protocol --securityenabled=true sec-admin-listener
asadmin create-http --default-virtual-server=__asadmin sec-admin-listener
#asadmin create-network-listener --listenerport 4849 --protocol sec-admin-listener sec-admin-listener
asadmin create-ssl --type network-listener --certname s1as --ssl2enabled=false --ssl3enabled=false --clientauthenabled=false sec-admin-listener
asadmin set configs.config.server-config.network-config.protocols.protocol.sec-admin-listener.ssl.client-auth=want
asadmin set configs.config.server-config.network-config.protocols.protocol.sec-admin-listener.ssl.classname=com.sun.enterprise.security.ssl.GlassfishSSLImpl
###
### create the port redirect config
###
asadmin create-protocol --securityenabled=false admin-http-redirect
asadmin create-http-redirect --secure-redirect true admin-http-redirect
#asadmin create-http-redirect --secure-redirect true --redirect-port 4849 admin-http-redirect
asadmin create-protocol --securityenabled=false pu-protocol
asadmin create-protocol-finder --protocol pu-protocol --targetprotocol sec-admin-listener --classname org.glassfish.grizzly.config.portunif.HttpProtocolFinder http-finder
asadmin create-protocol-finder --protocol pu-protocol --targetprotocol admin-http-redirect --classname org.glassfish.grizzly.config.portunif.HttpProtocolFinder admin-http-redirect
###
### update the admin listener
###
asadmin set configs.config.server-config.network-config.network-listeners.network-listener.admin-listener.protocol=pu-protocol
Modifier and Type | Field and Description |
---|---|
String |
adminalias |
String |
instancealias |
ADMIN_LISTENER_NAME, domain
Constructor and Description |
---|
EnableSecureAdminCommand() |
Modifier and Type | Method and Description |
---|---|
void |
run()
Performs the enable/disable logic for secure admin.
|
protected String |
transactionErrorMessageKey()
Returns the error key for finding a message describing an error
during the operation - either enable or disable.
|
protected boolean |
updateSecureAdminSettings(SecureAdmin secureAdmin_w)
Applies changes other than whether secure admin is enabled or disabled
to the secure-admin element.
|
execute
public void run() throws TransactionFailure, SecureAdminHelper.SecureAdminCommandException
SecureAdminCommand
This is separate from the execute method so it can be invoked during upgrade.
run
in class SecureAdminCommand
TransactionFailure
SecureAdminHelper.SecureAdminCommandException
protected boolean updateSecureAdminSettings(SecureAdmin secureAdmin_w)
SecureAdminCommand
This method is primarily for the enable processing to apply the admin and/or instance alias values, if specified on the enable-secure-admin command, to the secure-admin element.
protected String transactionErrorMessageKey()
SecureAdminCommand
Each concrete subclass overrides this to supply the relevant message key.
transactionErrorMessageKey
in class SecureAdminCommand
Copyright © 2019. All rights reserved.