public static PropertySimple getGlobList(String name, List<String> simples) { StringBuilder bld = new StringBuilder(); if (simples != null) { for (String s : simples) { bld.append(s).append("|"); } } if (bld.length() > 0) { bld.deleteCharAt(bld.length() - 1); } return new PropertySimple(name, bld); }
private void setNameProperty(String name) { if (name == null) { throw new IllegalArgumentException("name is null"); } configuration.put(new PropertySimple(DriftConfigurationDefinition.PROP_NAME, name)); }
private void addAttributeToPropertyMap(String attributeName, PropertyMap propertyMap, Map<String, String> queryCacheAttributes) { propertyMap.put(new PropertySimple(attributeName, queryCacheAttributes.get(attributeName))); } }
protected void tweakDefaultPluginConfig(Configuration defaultPluginConfig) { PropertySimple rootPathProp = new PropertySimple(AugeasConfigurationComponent.AUGEAS_ROOT_PATH_PROP, AUGEAS_ROOT); defaultPluginConfig.put(rootPathProp); }
@Override public Configuration loadResourceConfiguration() throws Exception { Configuration configuration = super.loadResourceConfiguration(); // We need to sneak the baseDefinition back in, otherwise the UI will complain String baseDefinitionName = path.substring(path.lastIndexOf('=') + 1); PropertySimple propertySimple = new PropertySimple(BASE_DEFINITION, baseDefinitionName); configuration.put(propertySimple); return configuration; } }
protected static void includeOOBMessages(Result res, Configuration configuration) { if (res.isReloadRequired()) { PropertySimple oobMessage = new PropertySimple("__OOB", "The server needs a reload for the latest changes to come effective."); configuration.put(oobMessage); } if (res.isRestartRequired()) { PropertySimple oobMessage = new PropertySimple("__OOB", "The server needs a restart for the latest changes to come effective."); configuration.put(oobMessage); } }
private void initEnabled(DriftDefinitionTemplate template) { template.getConfiguration() .put( new PropertySimple(DriftConfigurationDefinition.PROP_ENABLED, DriftConfigurationDefinition.DEFAULT_ENABLED)); }
public Property createPropertySimple(PropertyDefinitionSimple propDefSimple, AugeasNode node) throws AugeasRhqException { Object value; value = node.getValue(); return new PropertySimple(propDefSimple.getName(), value); }
/** * Adds a simple property. The name of the property is the member name defined by this list. * @param value the value of the simple property * @return continue with the definition */ public This addSimple(Object value) { list.add(new PropertySimple(list.memberPropertyName, value)); return castThis(); }
/** * Adds a number of simple properties. The names of the properties are the member name defined by this list. * @param values the values of the simple properties * @return continue with the definition */ public This addSimples(Object... values) { for(Object v : values) { list.add(new PropertySimple(list.memberPropertyName, v)); } return castThis(); }
public static Configuration translateParametersToConfig(ClassPool cp, ConfigurationDefinition parametersConfigurationDefinition, Object[] args) throws NotFoundException { LinkedHashMap<String, CtClass> translateParameters = translateParameters(cp, parametersConfigurationDefinition); Configuration config = new Configuration(); int index = 0; for (String key : translateParameters.keySet()) { config.put(new PropertySimple(key, args[index++])); } return config; }
/** * Adds a simple property. * @param name the name of the simple property * @param value the value of the simple property * @return continue with the definition */ public This addSimple(String name, Object value) { getMap().put(new PropertySimple(name, value)); return castThis(); }
public void setStartScript(File startScript) { PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_PROP); if (prop == null) { prop = new PropertySimple(START_SCRIPT_PROP, null); this.pluginConfig.put(prop); } prop.setValue(startScript); }
@Override public Configuration loadResourceConfiguration() throws Exception { Configuration config = super.loadResourceConfiguration(); if (!(context.getParentResourceComponent() instanceof StandaloneASComponent)) { config.put(new PropertySimple("port-offset",null)); } return config; }
@Override protected void fillPropertyMap(PropertyMap map) { super.fillPropertyMap(map); PropertySimple valueContextProp = new PropertySimple(BUNDLE_DEST_BASE_DIR_VALUE_CONTEXT_NAME, getValueContext().name()); PropertySimple valueNameProp = new PropertySimple(BUNDLE_DEST_BASE_DIR_VALUE_NAME_NAME, getValueName()); map.put(valueContextProp); map.put(valueNameProp); }
private void initBasedir(DriftDescriptor descriptor, DriftDefinitionTemplate template) { Basedir basedir = descriptor.getBasedir(); String valueContext = basedir.getValueContext(); String valueName = basedir.getValueName(); PropertyMap basedirMap = new PropertyMap(DriftConfigurationDefinition.PROP_BASEDIR); basedirMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUECONTEXT, valueContext)); basedirMap.put(new PropertySimple(DriftConfigurationDefinition.PROP_BASEDIR_VALUENAME, valueName)); template.getConfiguration().put(basedirMap); }
public void setStartScriptArgs(List<String> startScriptArgs) { PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_ARGS_PROP); if (prop == null) { prop = new PropertySimple(START_SCRIPT_ARGS_PROP, null); this.pluginConfig.put(prop); } try { new ArgsPropertySimpleWrapper(prop).setValue(startScriptArgs); } catch (IllegalArgumentException e) { setPropertyError(startScriptArgs, prop); } }
private void initDescription(DriftDescriptor descriptor, DriftDefinitionTemplate template) { template.setDescription(descriptor.getDescription()); template.getConfiguration().put( new PropertySimple(DriftConfigurationDefinition.PROP_DESCRIPTION, descriptor.getDescription())); }
private static void adaptPropertySimple(PropertySimple source, PropertySimple target, PropertyDefinitionSimple definition, Object parent, boolean adaptReadonlyProperties) { if (adaptReadonlyProperties || !definition.isReadOnly()) { if (target == null) { target = new PropertySimple(); target.setName(definition.getName()); add(parent, target); } target.setStringValue(source.getStringValue()); } }
public void deleteResource() throws Exception { Configuration opConfig = new Configuration(); ResourceContext<TomcatUserDatabaseComponent> resourceContext = getResourceContext(); PropertySimple nameProperty = resourceContext.getPluginConfiguration().getSimple(PLUGIN_CONFIG_NAME); String name = nameProperty.getStringValue(); nameProperty = new PropertySimple(CONFIG_ROLE_NAME, name); opConfig.put(nameProperty); resourceContext.getParentResourceComponent().invokeOperation("removeRole", opConfig); resourceContext.getParentResourceComponent().save(); }