Class SecureAdminCommand
- All Implemented Interfaces:
org.glassfish.api.admin.AdminCommand
- Direct Known Subclasses:
DisableSecureAdminCommand
,EnableSecureAdminCommand
This class, and the concrete subclasses EnableSecureAdminCommand and DisableSecureAdminComment, define what must be done in terms of steps. Each step has enable work and disable work. This class builds arrays of steps, one array which operates at the domain level and one which operates at the config level. The enable work of these steps is run in order through the array to fully enable secure admin, and the disable work of these steps are run in REVERSE order to fully disable secure admin.
I have defined the steps and their enable and disable work here, together in some inner classes, rather than separately in the EnableSecureAdminCommand and DisableSecureAdminCommand classes to try to keep common details together. The concrete subclasses can override a few methods, in particular overriding methods which return an Iterator over the steps to be performed. This way we have a single array of all the steps, with each class returning a forward-running or reverse-running iterator over those steps.
- Author:
- Tim Quinn
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected com.sun.enterprise.config.serverbeans.Domain
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
execute
(org.glassfish.api.admin.AdminCommandContext context) Executes the particular xxx-secure-admin command (enable or disable).void
run()
Performs the enable/disable logic for secure admin.protected abstract String
Returns the error key for finding a message describing an error during the operation - either enable or disable.
-
Field Details
-
ADMIN_LISTENER_NAME
- See Also:
-
domain
@Inject protected com.sun.enterprise.config.serverbeans.Domain domain
-
-
Constructor Details
-
SecureAdminCommand
public SecureAdminCommand()
-
-
Method Details
-
transactionErrorMessageKey
Returns the error key for finding a message describing an error during the operation - either enable or disable.Each concrete subclass overrides this to supply the relevant message key.
- Returns:
- the message key corresponding to the error message to display
-
run
public void run() throws org.jvnet.hk2.config.TransactionFailure, com.sun.enterprise.config.serverbeans.SecureAdminHelper.SecureAdminCommandExceptionPerforms the enable/disable logic for secure admin.This is separate from the execute method so it can be invoked during upgrade.
- Throws:
org.jvnet.hk2.config.TransactionFailure
com.sun.enterprise.config.serverbeans.SecureAdminHelper.SecureAdminCommandException
-
execute
public void execute(org.glassfish.api.admin.AdminCommandContext context) Executes the particular xxx-secure-admin command (enable or disable).- Specified by:
execute
in interfaceorg.glassfish.api.admin.AdminCommand
- Parameters:
context
-
-