@Override public boolean add(Property e) { put(e); return true; //we always allow adding an element even if it is already present }
/** * Use this method if an operation returned a simple string result. This is a convenience method that places the * given result string in the {@link #getComplexResults()} object under the name * {@link #SIMPLE_OPERATION_RESULT_NAME}. * * @param simpleResult a simple string result */ public void setSimpleResult(String simpleResult) { complexResults.put(new PropertySimple(SIMPLE_OPERATION_RESULT_NAME, simpleResult)); }
private void createDeepCopyOfProperties(Configuration copy, boolean keepId) { for (Property property : this.properties.values()) { copy.put(property.deepCopy(keepId)); } }
private void announceStorageNode(Subject subject, StorageNode newStorageNode, StorageNode clusterNode, PropertyList addresses) { if (log.isInfoEnabled()) { log.info("Announcing " + newStorageNode + " to cluster node " + clusterNode); } Configuration parameters = new Configuration(); parameters.put(addresses); scheduleOperation(subject, clusterNode, parameters, "announce"); }
@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; } }
private void prepareConfigForMergeIntoStructured(Configuration config, Configuration latestStructured) { config.getAllProperties().clear(); for (Property property : latestStructured.getProperties()) { config.put(property); } }
private void prepareNodeForBootstrap(Subject subject, StorageNode storageNode, PropertyList addresses) { if (log.isInfoEnabled()) { log.info("Preparing to bootstrap " + storageNode + " into cluster..."); } StorageClusterSettings clusterSettings = storageClusterSettingsManager.getClusterSettings(subject); Configuration parameters = new Configuration(); parameters.put(new PropertySimple("cqlPort", clusterSettings.getCqlPort())); parameters.put(new PropertySimple("gossipPort", clusterSettings.getGossipPort())); parameters.put(addresses); scheduleOperation(subject, storageNode, parameters, "prepareForBootstrap"); }
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 unannounceStorageNode(Subject subject, StorageNode clusterNode, PropertyList addresses) { Configuration parameters = new Configuration(); parameters.put(addresses); scheduleOperation(subject, clusterNode, parameters, "unannounce"); }
private void initInterval(DriftDescriptor descriptor, DriftDefinitionTemplate template) { Configuration config = template.getConfiguration(); if (descriptor.getInterval() == null) { config.put(new PropertySimple(DriftConfigurationDefinition.PROP_INTERVAL, String .valueOf(DriftConfigurationDefinition.DEFAULT_INTERVAL))); } else { config.put(new PropertySimple(DriftConfigurationDefinition.PROP_INTERVAL, descriptor.getInterval())); } }
public Configuration loadResourceConfiguration(AugeasNode startNode, ConfigurationDefinition resourceConfigDef) throws AugeasRhqException { Configuration resourceConfig = new Configuration(); Collection<PropertyDefinition> propDefs = resourceConfigDef.getPropertyDefinitions().values(); for (PropertyDefinition propDef : propDefs) { resourceConfig.put(loadProperty(propDef, startNode)); } return resourceConfig; }
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; }
public Configuration toConfiguration() { Configuration ret = new Configuration(); for(Map.Entry<SystemSetting, String> e : entrySet()) { ret.put(new PropertySimple(e.getKey().getInternalName(), e.getValue())); } return ret; }
@Override public Configuration loadResourceConfiguration() throws Exception { Configuration config = super.loadResourceConfiguration(); if (!(context.getParentResourceComponent() instanceof StandaloneASComponent)) { config.put(new PropertySimple("port-offset",null)); } return config; }
public void setStartScriptEnv(Map<String, String> startScriptEnv) { PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_ENV_PROP); if (prop == null) { prop = new PropertySimple(START_SCRIPT_ENV_PROP, null); this.pluginConfig.put(prop); } try { new MapPropertySimpleWrapper(prop).setValue(startScriptEnv); } catch (IllegalArgumentException e) { setPropertyError(startScriptEnv, prop); } }
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 initName(DriftDescriptor descriptor, DriftDefinitionTemplate template) { template.setName(descriptor.getName()); template.getConfiguration().put( new PropertySimple(DriftConfigurationDefinition.PROP_NAME, descriptor.getName())); }
private void initDescription(DriftDescriptor descriptor, DriftDefinitionTemplate template) { template.setDescription(descriptor.getDescription()); template.getConfiguration().put( new PropertySimple(DriftConfigurationDefinition.PROP_DESCRIPTION, descriptor.getDescription())); }
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(); }
public static void updateValuesToConfiguration(StorageNodeConfigurationComposite storageNodeConfigurationComposite, Configuration storageNodeConfiguration) { storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_JMX_PORT_PROPERTY, Integer.toString(storageNodeConfigurationComposite.getJmxPort())); storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_HEAP_MAX_PROPERTY, storageNodeConfigurationComposite.getHeapSize()); storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_HEAP_MIN_PROPERTY, storageNodeConfigurationComposite.getHeapSize()); storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_HEAP_NEW_PROPERTY, storageNodeConfigurationComposite.getHeapNewSize()); storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_THREAD_STACK_PROPERTY, storageNodeConfigurationComposite.getThreadStackSize()); storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_SAVED_CACHES_PROPERTY, storageNodeConfigurationComposite.getSavedCachesLocation()); storageNodeConfiguration.setSimpleValue(RHQ_STORAGE_COMMIT_LOG_PROPERTY, storageNodeConfigurationComposite.getCommitLogLocation()); storageNodeConfiguration.put(getAllDataFileLocationsProperties(storageNodeConfigurationComposite.getDataLocations())); }