public void setIncludes(List<Filter> includesFilters) { configuration.remove(DriftConfigurationDefinition.PROP_INCLUDES); if (null != includesFilters) { for (Filter filter : includesFilters) { addInclude(filter); } } }
public void setExcludes(List<Filter> excludesFilters) { configuration.remove(DriftConfigurationDefinition.PROP_EXCLUDES); if (null != excludesFilters) { for (Filter filter : excludesFilters) { addExclude(filter); } } }
/** * Remove one property from the passed configuration. Returns the updated configuration * @param config configuration the property is on * @param propertyName name of the property to remove * @return the updated configuration */ protected Configuration cleanProperty(Configuration config, String propertyName) { Configuration ret = config; PropertySimple prop = config.getSimple(propertyName); if (prop != null) { config.remove(propertyName); ret = persistConfiguration(config); } return ret; }
public static void preProcessCreateChildConfiguration(Configuration configuration) { // Server is too stupid to accept all three any*address props for :add // [standalone@localhost:9999 interface=test] :add(any-address=true,any-ipv4-address=false,any-ipv6-address=false) // { // "outcome" => "failed", // "failure-description" => "JBAS014690: any-address is invalid", // "rolled-back" => true //} // So we need to filter the false ones for (String wildCard: wildCards) { PropertySimple ps = configuration.getSimple(wildCard); if (ps!=null && ps.getStringValue().equals("false")) configuration.remove(wildCard); } /* TODO revisit later BZ 825169 PropertySimple wildCardProp = configuration.getSimple(WILDCARD_IGNORE);//, "any-address"); String tmp = wildCardProp.getStringValue(); for (String wildCard : wildCards) { boolean val = wildCard.equals(tmp); PropertySimple prop = new PropertySimple(wildCard,val); configuration.put(prop); } */ } }
@Override @Lock(LockType.WRITE) public void unsetUserProperty(int subjectId, String propertyName) { load(subjectId); Configuration config = subjectPreferences.get(subjectId); if (config == null) { return; } Property property = config.remove(propertyName); // it's possible property was already removed, and thus this operation becomes a no-op to the backing store if (property != null && property.getId() != 0) { try { configurationManager.deleteProperties(new int[] { property.getId() }); } catch (Throwable t) { log.error("Could not remove " + property, t); } } }
/** * Set the value of a simple property to the specified value. If the property is not yet defined, it will be added. * * @param name the name of the simple property to be set * @param value the new value for the property * * @since 4.4 */ public void setSimpleValue(String name, String value) { PropertySimple property = getSimple(name); if (value == null) { if (property != null) { remove(name); } } else { if (property == null) { put(new PropertySimple(name, value)); } else { property.setStringValue(value); } } }
@Override public void updateResourceConfiguration(ConfigurationUpdateReport report) { Configuration config = report.getConfiguration(); ConfigurationDefinition configDef = context.getResourceType().getResourceConfigurationDefinition(); boolean processIdUuid = Boolean.valueOf(config.getSimpleValue("process-id-uuid")); if (processIdUuid == true) { //Do not even send the updates for [process-id-socket-binding] because the AS7 will //undefine it during the next reload/restart. //Also, sending null for [process-id-socket-binding] with [process-id-uuid] == true causes //a validation error on the server. configDef.getPropertyDefinitions().remove("process-id-socket-binding"); config.remove("process-id-socket-binding"); } ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef, getASConnection(), address); delegate.updateResourceConfiguration(report); } }
@Override public void updateResourceConfiguration(ConfigurationUpdateReport report) { Configuration config = report.getConfiguration(); ConfigurationDefinition configDef = context.getResourceType().getResourceConfigurationDefinition(); if (!(context.getParentResourceComponent() instanceof StandaloneASComponent)) { // TODO what about managed servers configDef.getPropertyDefinitions().remove("port-offset"); config.remove("port-offset"); } ConfigurationWriteDelegate delegate = new ConfigurationWriteDelegate(configDef, getASConnection(), address); delegate.updateResourceConfiguration(report); } }
report.getConfiguration().remove(TYPE_CONFIGURATION); templatedComponentUpdate = true; } else if (configDefCopy.getDefaultTemplate().getConfiguration().get(NAME_CONFIGURATION) != null) { report.getConfiguration().remove(NAME_CONFIGURATION); templatedComponentUpdate = true; if (!currentAttributeList.containsKey(name)) { propDefs.remove(propDef.getName()); report.getConfiguration().remove(propDef.getName()); } else { if ((null == current && isUndefined(update))) { propDefs.remove(propDef.getName()); report.getConfiguration().remove(propDef.getName());
if (timeoutProperty != null) { try { paramConfig.remove(timeoutProperty.getName()); // we have to remove it since ResourceComponents are not expecting it Long timeout = timeoutProperty.getLongValue(); if (timeout != null) {
@Override public CreateResourceReport createResource(CreateResourceReport report) { // We need to filter out the baseDefinition property and use its value as user selected resource name Configuration configuration = report.getResourceConfiguration(); PropertySimple baseDefinitionProp = configuration.getSimple(BASE_DEFINITION); if (baseDefinitionProp != null) { configuration.remove(BASE_DEFINITION); String baseDefinitionName = baseDefinitionProp.getStringValue(); report.setUserSpecifiedResourceName(baseDefinitionName); report = super.createResource(report); } else { report.setStatus(CreateResourceStatus.INVALID_CONFIGURATION); report.setErrorMessage("No base definition given that we can use"); } return report; }
name = report.getResourceConfiguration().getSimple("groupname").getStringValue(); newRoles = report.getResourceConfiguration().getSimple(TomcatGroupComponent.CONFIG_ROLES); report.getResourceConfiguration().remove(TomcatGroupComponent.CONFIG_ROLES); objectName = String.format("Users:type=Group,groupname=\"%s\",database=UserDatabase", name); operation = "createGroup"; newRoles = report.getResourceConfiguration().getSimple(TomcatUserComponent.CONFIG_ROLES); newGroups = report.getResourceConfiguration().getSimple(TomcatUserComponent.CONFIG_GROUPS); report.getResourceConfiguration().remove(TomcatUserComponent.CONFIG_ROLES); report.getResourceConfiguration().remove(TomcatUserComponent.CONFIG_GROUPS); objectName = String.format("Users:type=User,username=\"%s\",database=UserDatabase", name); operation = "createUser";
existConf.remove(name);
report.getConfiguration().remove(propDef.getName()); report.getConfiguration().remove(propDef.getName()); report.getConfiguration().remove(propDef.getName()); report.getConfiguration().remove(CONFIG_V5_KEEP_ALIVE_TIMEOUT); if (attribute == null) { log.debug("Removing " + key + " does correspond to an attribut"); report.getConfiguration().remove(key); continue; // skip unsupported attributes
newConfig.remove("__OOB");
PropertySimple currentAliases = reportConfiguration.getSimple(CONFIG_ALIASES); reportConfiguration.remove(CONFIG_ALIASES);
PropertySimple currentRoles = reportConfiguration.getSimple(CONFIG_ROLES); reportConfiguration.remove(CONFIG_ROLES);
config.remove(ENABLED_ATTRIBUTE);