/** * @return the value as being stored in the database */ public String getObfuscatedStringValue() { return super.getStringValue(); }
public static List<String> getGlobList(PropertySimple list) { if (list != null && list.getStringValue() != null) { return Arrays.asList(list.getStringValue().split("\\s*\\|\\s*")); } else { return Collections.emptyList(); } }
public String getSimpleValue(String name, String defaultValue) { PropertySimple property = (PropertySimple) getMap().get(name); if ((property != null) && (property.getStringValue() != null)) { return property.getStringValue(); } else { return defaultValue; } }
public List<String> getValue() { List<String> list = new ArrayList<String>(); String stringValue = this.prop.getStringValue(); if (stringValue != null) { String[] lines = stringValue.split("\n+"); for (String line : lines) { String element = line.trim(); list.add(element); } } return list; }
private void initGlobs() { Configuration pluginConfig = this.resourceContext.getPluginConfiguration(); PropertySimple includes = pluginConfig.getSimple(INCLUDE_GLOBS_PROP); PropertySimple excludes = pluginConfig.getSimple(EXCLUDE_GLOBS_PROP); includeGlobs = new ArrayList<String>(); excludeGlobs = new ArrayList<String>(); includeGlobs.addAll(Arrays.asList(includes.getStringValue().split("\\s*\\|\\s*"))); if (excludes != null && excludes.getStringValue() != null) { excludeGlobs.addAll(Arrays.asList(excludes.getStringValue().split("\\s*\\|\\s*"))); } }
/** * @param original * @param keepId */ protected ObfuscatedPropertySimple(PropertySimple original, boolean keepId) { super(original, keepId); setValue(original.getStringValue()); }
@Override protected void appendToStringInternals(StringBuilder str) { super.appendToStringInternals(str); str.append(", value=").append(getStringValue()); str.append(", override=").append(getOverride()); } }
private String getAddress(PropertyList addressList) { List<String> list = new ArrayList<String>(addressList.getList().size()); for (Property property : addressList.getList()) { PropertySimple simple = (PropertySimple) property; list.add(simple.getStringValue()); } return list.get(0); }
private boolean isPropertyDefined(PropertyDefinition propDef, AbstractPropertyMap parentPropMap) { Property prop = parentPropMap.get(propDef.getName()); if (prop == null) { return false; } else { return (!(prop instanceof PropertySimple) || ((PropertySimple) prop).getStringValue() != null); } }
public void deleteResource() throws Exception { Configuration pluginConfiguration = getResourceContext().getPluginConfiguration(); String fileName = pluginConfiguration.getSimple(PROPERTY_FILENAME).getStringValue(); File file = new File(fileName); if (!file.exists()) { log.warn("Could not delete web application files (perhaps removed manually?). Proceeding with resource removal for: " + fileName); } else { deleteApp(pluginConfiguration, file, false, true); } }
private String replaceGlobalRequestProcessorNameProps(String property) { Configuration pluginConfiguration = getResourceContext().getPluginConfiguration(); String name = pluginConfiguration.getSimple(PLUGIN_CONFIG_NAME).getStringValue(); String result = property.replace("%name%", name); return result; }
public void applyConfiguration(Configuration configuration) { for(PropertySimple prop : configuration.getSimpleProperties().values()) { SystemSetting systemProp = SystemSetting.getByInternalName(prop.getName()); if (systemProp != null) { String value = prop.getStringValue(); put(systemProp, value); } } }
@NotNull public static UIInput createInputForSimpleProperty(PropertySimple propertySimple, ValueExpression valueExpression, boolean readOnly) { UIInput input = createInputForStringProperty(); input.setValueExpression("value", valueExpression); FacesComponentUtility.setReadonly(input, readOnly); addTitleAttribute(input, propertySimple.getStringValue()); return input; }
@Override public void start(ResourceContext<TomcatServerComponent<?>> context) { if (UNKNOWN.equals(context.getPluginConfiguration().getSimple(PLUGIN_CONFIG_HANDLER).getStringValue())) { throw new InvalidPluginConfigurationException( "The connector is not listening for requests on the configured port. This is most likely due to the configured port being in use at Tomcat startup. In some cases (AJP connectors) Tomcat will assign an open port. This happens most often when there are multiple Tomcat servers running on the same platform. Check your Tomcat configuration for conflicts: " + context.getResourceKey()); } super.start(context); }
private static void unmaskPropertySimple(PropertySimple propertySimple, AbstractPropertyMap unmaskedParentPropertyMap) { if (propertySimple.isMasked()) { PropertySimple unmaskedPropertySimple = unmaskedParentPropertyMap.getSimple(propertySimple.getName()); String unmaskedValue = (unmaskedPropertySimple != null) ? unmaskedPropertySimple.getStringValue() : null; propertySimple.setStringValue(unmaskedValue); } }
private static void prevalidatePropertyValue(UIInput propertyValueInput, PropertySimple propertySimple, PropertySimpleValueValidator validator) { FacesContext facesContext = FacesContextUtility.getFacesContext(); try { String value = (propertySimple != null) ? propertySimple.getStringValue() : null; validator.validate(facesContext, propertyValueInput, value); } catch (ValidatorException e) { // NOTE: It's vital to pass the client id, *not* the component id, to addMessage(). facesContext.addMessage(propertyValueInput.getClientId(facesContext), e.getFacesMessage()); } }
protected AugeasNode getExistingChildNodeForListMemberPropertyMap(AugeasNode parentNode, PropertyDefinitionList propDefList, PropertyMap propMap) { String mapKey = getListMemberMapKey(propDefList); if (mapKey != null) { String existingChildNodeName = propMap.getSimple(mapKey).getStringValue(); AugeasNode existingChildNode = new AugeasNode(parentNode, existingChildNodeName); return (this.augeas.exists(existingChildNode.getPath())) ? existingChildNode : null; } else { return null; } }
public void deleteResource() throws Exception { Configuration opConfig = new Configuration(); ResourceContext<TomcatUserDatabaseComponent> resourceContext = getResourceContext(); // We must strip the quotes off of name for the operation parameter PropertySimple nameProperty = resourceContext.getPluginConfiguration().getSimple(PLUGIN_CONFIG_NAME); String name = nameProperty.getStringValue(); nameProperty = new PropertySimple(CONFIG_USERNAME, name.substring(1, name.length() - 1)); opConfig.put(nameProperty); resourceContext.getParentResourceComponent().invokeOperation("removeUser", opConfig); resourceContext.getParentResourceComponent().save(); }
public void deleteResource() throws Exception { Configuration opConfig = new Configuration(); ResourceContext<TomcatUserDatabaseComponent> resourceContext = getResourceContext(); // We must strip the quotes off of name for the operation parameter PropertySimple nameProperty = resourceContext.getPluginConfiguration().getSimple(PLUGIN_CONFIG_NAME); String name = nameProperty.getStringValue(); nameProperty = new PropertySimple(CONFIG_GROUP_NAME, name.substring(1, name.length() - 1)); opConfig.put(nameProperty); resourceContext.getParentResourceComponent().invokeOperation("removeGroup", opConfig); resourceContext.getParentResourceComponent().save(); }
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()); } }