use of com.sun.enterprise.security.admin.cli.SecureAdminCommand.ConfigLevelContext in project Payara by payara.
the class SecureAdminUpgradeHelper method ensureConfigReady.
private boolean ensureConfigReady(final Config c) throws TransactionFailure {
/*
* See if this config is already set up for secure admin.
*/
final NetworkConfig nc = c.getNetworkConfig();
if (nc == null) {
/*
* If there is no network config for this configuration then it is
* probably a test configuration of some sort. In any case, there
* is no lower-level network protocols to verify so declare this
* config to be OK.
*/
return true;
}
Protocol secAdminProtocol = nc.getProtocols().findProtocol(SecureAdminCommand.SEC_ADMIN_LISTENER_PROTOCOL_NAME);
if (secAdminProtocol != null) {
return true;
}
final EnableSecureAdminCommand enableCmd = new EnableSecureAdminCommand();
final Config c_w = transaction().enroll(c);
ConfigLevelContext configLevelContext = new ConfigLevelContext(topLevelContext(), c_w);
for (Iterator<Work<ConfigLevelContext>> it = enableCmd.perConfigSteps(); it.hasNext(); ) {
final Work<ConfigLevelContext> step = it.next();
if (!step.run(configLevelContext)) {
rollback();
return false;
}
}
return true;
}
Aggregations