@Override public void postConstruct() { Config config = configs.getConfigByName("server-config"); if (config != null) { SecurityService s = config.getSecurityService(); if (s != null) { try { ConfigSupport.apply(new AdminConsoleConfigCode(), s); } catch (TransactionFailure tf) { LogRecord lr = new LogRecord(Level.SEVERE, "Could not upgrade security service for admin console: " + tf); lr.setLoggerName(getClass().getName()); EarlyLogHandler.earlyMessages.add(lr); } } } }
static RefContainer chooseRefContainer( final Domain domain, final String target, final ConfigBeansUtilities configBeansUtilities) { Config config = domain.getConfigs().getConfigByName(target); if (config != null) { return config; } Server server = configBeansUtilities.getServerNamed(target); if (server != null) { return server; } Cluster cluster = domain.getClusterNamed(target); return cluster; } }
private boolean isOriginalAdminSecured() { /* * The Grizzly conversion has already occurred. So look for * * <server-config> * <network-config> * <protocols> * <protocol name="admin-listener"> * <ssl ...> * */ final Config serverConfig; final NetworkConfig nc; final Protocol p; final Ssl ssl ; if ((serverConfig = configs.getConfigByName(SecureAdminUpgradeHelper.DAS_CONFIG_NAME)) == null) { return false; } if ((nc = serverConfig.getNetworkConfig()) == null) { return false; } if ((p = nc.findProtocol(ADMIN_LISTENER_NAME)) == null) { return false; } if ((ssl = p.getSsl()) == null) { return false; } return true; }
private boolean isOriginalAdminSecured() { /* * The Grizzly conversion has already occurred. So look for * * <server-config> * <network-config> * <protocols> * <protocol name="admin-listener"> * <ssl ...> * */ final Config serverConfig; final NetworkConfig nc; final Protocol p; final Ssl ssl ; if ((serverConfig = configs.getConfigByName(DAS_CONFIG_NAME)) == null) { return false; } if ((nc = serverConfig.getNetworkConfig()) == null) { return false; } if ((p = nc.findProtocol(ADMIN_LISTENER_NAME)) == null) { return false; } if ((ssl = p.getSsl()) == null) { return false; } return true; }
private void prepareDASConfig() throws TransactionFailure, PropertyVetoException { final Config dasConfig = writableConfig(configs.getConfigByName(DAS_CONFIG_NAME)); final NetworkConfig nc = dasConfig.getNetworkConfig(); final NetworkListener nl_w = transaction().enroll(nc.getNetworkListener(SecureAdminCommand.ADMIN_LISTENER_NAME)); nl_w.setProtocol(SecureAdminCommand.ADMIN_LISTENER_NAME); }
if (configs == null || configs.getConfigByName(configRef) == null) { logger.warning(ConfigApiLoggerInfo.configRefNonexistent); return false;
private Config getConfigForServer( Server server ) { fineLog( "getConfigForServer: server {0}", server ) ; String configRef = server.getConfigRef() ; fineLog( "getConfigForServer: configRef {0}", configRef ) ; Configs configs = services.getService( Configs.class ) ; fineLog( "getConfigForServer: configs {0}", configs ) ; Config config = configs.getConfigByName(configRef) ; fineLog( "getConfigForServer: config {0}", config ) ; return config ; }
if (configs == null || configs.getConfigByName(configRef) == null) { logger.warning(localStrings.getLocalString("configref.nonexistent", "A configuration that doesn't exist cannot be referenced by a server."));
final ActionReport report = context.getActionReport(); String instanceConfig = child.getConfigRef(); final Config config = configs.getConfigByName(instanceConfig); Transaction t = Transaction.getTransaction(parent);
/** * Selects a config of interest from the domain, based on the target. * (Eliminates duplicated code formerly in Create, Delete, and ListAuthRealm). * * @param domain * @param target * @return */ static Config chooseConfig(final Domain domain, final String target) { Config config = null; Config tmp = null; try { tmp = domain.getConfigs().getConfigByName(target); } catch (Exception ex) { } if (tmp != null) { return tmp; } Server targetServer = domain.getServerNamed(target); if (targetServer != null) { config = domain.getConfigNamed(targetServer.getConfigRef()); } com.sun.enterprise.config.serverbeans.Cluster cluster = domain.getClusterNamed(target); if (cluster != null) { config = domain.getConfigNamed(cluster.getConfigRef()); } return config; }
Config config = domain.getConfigs().getConfigByName(target); if (config != null) { return config;
Config config = configs.getConfigByName(configName);
Config tmp = null; try { tmp = configs.getConfigByName(target); } catch (Exception ex) {
@Override public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); Config tmp = null; try { tmp = configs.getConfigByName(target); } catch (Exception ex) { } if (tmp != null) { config = tmp; } if (tmp == null) { Server targetServer = domain.getServerNamed(target); if (targetServer != null) { config = domain.getConfigNamed(targetServer.getConfigRef()); } com.sun.enterprise.config.serverbeans.Cluster cluster = domain.getClusterNamed(target); if (cluster != null) { config = domain.getConfigNamed(cluster.getConfigRef()); } } final SecurityService securityService = config.getSecurityService(); List<JaccProvider> jaccProviders = securityService.getJaccProvider(); JaccProvider jprov = null; for (JaccProvider jaccProv : jaccProviders) { ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(jaccProv.getName()); } report.setActionExitCode(ActionReport.ExitCode.SUCCESS); }
tmp = configs.getConfigByName(target); } catch (Exception ex) {
tmp = configs.getConfigByName(target); } catch (Exception ex) {
tmp = configs.getConfigByName(target); } catch (Exception ex) {
tmp = configs.getConfigByName(target); } catch (Exception ex) {
tmp = configs.getConfigByName(target); } catch (Exception ex) {
tmp = configs.getConfigByName(target); } catch (Exception ex) {