@Override public Object run(Configs c) throws PropertyVetoException, TransactionFailure { List<Config> configList = c.getConfig(); configList.remove(config); return null; } }, configs);
@Override public Object run(Configs c) throws PropertyVetoException, TransactionFailure { List<Config> configList = c.getConfig(); configList.remove(config); return null; } }, configs);
public static Config getConfigByName(Configs target, String name) { for (Config c : target.getConfig()) { if (c.getName().equals(name)) { return c; } } return null; } }
public void postConstruct() { for (Config config : configs.getConfig()) { doUpgrade(config); } }
public static Config getConfigByName(Configs target, String name) { for (Config c : target.getConfig()) { if (c.getName().equals(name)) { return c; } } return null; } }
public static Config getConfigNamed(Domain d, String name) { if (d.getConfigs() == null || name == null) throw new IllegalArgumentException ("no <config> element"); List<Config> configs = d.getConfigs().getConfig(); for (Config c : configs) { if (name.equals(c.getName().trim())) { return c; } } return null; }
public static Config getConfigNamed(Domain d, String name) { if (d.getConfigs() == null || name == null) throw new IllegalArgumentException ("no <config> element"); List<Config> configs = d.getConfigs().getConfig(); for (Config c : configs) { if (name.equals(c.getName().trim())) { return c; } } return null; }
private void ensureNonDASConfigsHaveAdminNetworkListener() throws TransactionFailure, PropertyVetoException { for (Config c : configs.getConfig()) { if (c.getName().equals(DAS_CONFIG_NAME)) { continue; } ensureConfigReady(c, SecureAdminCommand.PORT_UNIF_PROTOCOL_NAME); } }
/** * Report the JavaConfig beans for each config. <p> Lets the caller command * prepare access checks for security authorization. * * @return */ public Collection<JavaConfig> getJavaConfigs() { final Collection<JavaConfig> result = new ArrayList<JavaConfig>(); for (Config c : configs.getConfig()) { if (c.getJavaConfig() != null) { result.add(c.getJavaConfig()); } } return result; }
private void upgradeGroupManagementServiceElements() throws TransactionFailure { List<Config> lconfigs = configs.getConfig(); for (Config c : lconfigs) { LogRecord lr = new LogRecord(Level.FINE, "Upgrade config " + c.getName()); lr.setLoggerName(getClass().getName()); EarlyLogHandler.earlyMessages.add(lr); ConfigSupport.apply(new GroupManagementServiceConfigCode(), c); } }
final protected void ensureNonDASConfigsReady() throws TransactionFailure { for (Config c : domain.getConfigs().getConfig()) { if ( ! c.getName().equals(SecureAdminCommand.DAS_CONFIG_NAME)) { if (!ensureConfigReady(c)) { break; } } } }
private List<SystemProperty> getConfigSystemProperties() { try { String configName = server.getConfigRef(); Configs configs = domain.getConfigs(); List<Config> configsList = configs.getConfig(); Config config = null; for (Config c : configsList) { if (c.getName().equals(configName)) { config = c; break; } } return (List<SystemProperty>) (config != null ? config.getSystemProperty() : Collections.emptyList()); } catch (Exception e) { //possible NPE if domain.xml has issues! return Collections.emptyList(); } }
public Object run(Configs configs) throws PropertyVetoException, TransactionFailure { Config defaultConfig = configs.createChild(Config.class); defaultConfig.setName(DEFAULT_CONFIG); Dom.unwrap(defaultConfig).addDefaultChildren(); configs.getConfig().add(defaultConfig); return defaultConfig; } }
public Object run(Configs configs) throws PropertyVetoException, TransactionFailure { Config defaultConfig = configs.createChild(Config.class); defaultConfig.setName(DEFAULT_CONFIG); Dom.unwrap(defaultConfig).addDefaultChildren(); configs.getConfig().add(defaultConfig); return defaultConfig; } }
public void postConstruct() { for (Config config : configs.getConfig()) { EjbContainer container = config.getExtensionByType(EjbContainer.class); if (container != null && container.getEjbTimerService() != null) { doUpgrade(container.getEjbTimerService()); } } }
public void postConstruct() { for (Config config : configs.getConfig()) { EjbContainer container = config.getEjbContainer(); if (container != null && container.getEjbTimerService() != null) { doUpgrade(container.getEjbTimerService()); } } }
public static Config getConfig(Server server) { try { if (server == null) return null; Dom serverDom = Dom.unwrap(server); Configs configs = serverDom.getHabitat().getService(Configs.class); String configName = getReference(server); Config theConfig = null; for (Config config : configs.getConfig()) { if (configName.equals(config.getName())) { return config; } } } catch (Exception e) { // drop through... } return null; }
public boolean resourceExists(String jndiName, String target) { boolean exists = false; if(target.equals(DOMAIN)){ //if target is "domain", as long as the resource is present in "resources" section, //it is valid. exists = true; }else if(ConfigBeansUtilities.getServerNamed(target) != null){ Server server = configBeanUtilities.getServerNamed(target); exists = server.isResourceRefExists(jndiName); }else if (domain.getClusterNamed(target) != null){ Cluster cluster = domain.getClusterNamed(target); exists = cluster.isResourceRefExists(jndiName); }else{ //if target is "CONFIG", as long as the resource is present in "resources" section, //it is valid. for(Config config : domain.getConfigs().getConfig()){ if(config.getName().equals(target)){ exists = true; break; } } } return exists; }
/** * Executes the command with the command parameters passed as Properties * where the keys are the paramter names and the values the parameter values * * @param context information */ public void execute(AdminCommandContext context) { final ActionReport report = context.getActionReport(); List <Config> configList = configs.getConfig(); Config config = configList.get(0); SecurityService securityService = config.getSecurityService(); for (AuthRealm realm : securityService.getAuthRealm()) { ActionReport.MessagePart part = report.getTopMessagePart().addChild(); part.setMessage(realm.getName()); } } }
private void configure(StringBuilder sb) throws TransactionFailure, PropertyVetoException { Server s = ConfigBeansUtilities.getServerNamed(ADMIN_SERVER); String ac = s.getConfigRef(); Config asc = null; //admin server config, that needs the configuration for (Config cfg : allConfigs.getConfig()) { if (cfg.getName().equals(ac)) { asc = cfg; break; } } //following things should happen transactionally - TODO replace SingleConfigCode by ConfigCode ... //createBackupRealm(sb, getAdminRealm(asc.getSecurityService()), getNewRealmName(asc.getSecurityService())); deleteRealm(asc.getSecurityService(), sb); createRealm(asc.getSecurityService(), sb); configureAdminService(asc.getAdminService()); //configure(asc.getSecurityService(), asc.getAdminService(), sb); }