/** * Gets the simple string result that was stored in this object. * * @return the simple string result * * @see #OperationResult(String) * @see #setSimpleResult(String) */ public String getSimpleResult() { return complexResults.getSimpleValue(SIMPLE_OPERATION_RESULT_NAME, null); }
/** * Gets the value of the simple property with the specified name. If the property is not defined, null will be * returned. * * @param name the name of the simple property * @return the value of the simple property with the specified name, or null if the property is not defined * * @since 4.4 */ public String getSimpleValue(String name) { return getSimpleValue(name, null); }
private static String getRequiredPropertyValue(Configuration config, String propName) { String propValue = config.getSimpleValue(propName, null); if (propValue == null) { // Something's not right - neither autodiscovery, nor the config edit GUI, should ever allow this. throw new IllegalStateException("Required property '" + propName + "' is not set."); } return propValue; }
public Integer getNativePort() { String stringValue = this.pluginConfig.getSimpleValue(Property.NATIVE_PORT); return (stringValue != null) ? Integer.valueOf(stringValue) : null; }
@Nullable public File getStartScript() { String startScript = this.pluginConfig.getSimpleValue(START_SCRIPT_PROP); return (startScript != null) ? new File(startScript) : null; }
public File getHomeDir() { String stringValue = this.pluginConfig.getSimpleValue(Property.HOME_DIR); return (stringValue != null && !stringValue.isEmpty()) ? new File(stringValue) : null; }
protected String transformBeanName(String beanTemplate) { Matcher m = TEMPLATE_PATTERN.matcher(beanTemplate); while (m.find()) { String propName = m.group(1); String replacementValue = resourceContext.getPluginConfiguration().getSimpleValue(propName, null); beanTemplate = beanTemplate.replaceAll("%" + propName + "%", replacementValue); m = TEMPLATE_PATTERN.matcher(beanTemplate); } return beanTemplate; }
public String getServiceName() { Configuration pluginConfig = this.resourceContext.getPluginConfiguration(); String servicename = pluginConfig.getSimpleValue(TomcatServerComponent.PLUGIN_CONFIG_SERVICE_NAME, null); return servicename; }
public File getCatalinaHome() { Configuration pluginConfig = this.resourceContext.getPluginConfiguration(); return new File(pluginConfig.getSimpleValue(TomcatServerComponent.PLUGIN_CONFIG_CATALINA_HOME_PATH, "")); }
@Nullable private String getWebModuleMBeanName() { Configuration pluginConfig = getResourceContext().getPluginConfiguration(); String name = pluginConfig.getSimpleValue(PROPERTY_NAME, null); String webModuleMBeanName = "Catalina:j2eeType=WebModule,J2EEApplication=none,J2EEServer=none,name=" + name; return webModuleMBeanName; }
void addAdditionalToOp(Operation op, Configuration parameters, String parameterName, boolean optional) { String value = parameters.getSimpleValue(parameterName, null); if (value == null) { if (!optional) { throw new IllegalArgumentException("Required parameter [" + parameterName + "] for operation [" + op.getName() + "] is not defined."); } } else { op.addAdditionalProperty(parameterName, value); } }
private Set<Integer> getGroupIdsForFavorites() { Configuration conf = caller.getUserConfiguration(); if (conf==null) { return new HashSet<Integer>(); } String favsString = conf.getSimpleValue(GROUP_HEALTH_GROUPS, ""); Set<Integer> favIds = getIdsFromFavString(favsString); return favIds; }
void addAdditionalToOp(Operation op, Configuration parameters, String parameterName, boolean optional) { String value = parameters.getSimpleValue(parameterName, null); if (value == null) { if (!optional) { throw new IllegalArgumentException("Required parameter [" + parameterName + "] for operation [" + op.getName() + "] is not defined."); } } else { op.addAdditionalProperty(parameterName, value); } }
public File getCatalinaBase() { Configuration pluginConfig = this.resourceContext.getPluginConfiguration(); String base = pluginConfig.getSimpleValue(TomcatServerComponent.PLUGIN_CONFIG_CATALINA_BASE_PATH, null); return (null != base) ? new File(base) : getCatalinaHome(); }
public File getStartScriptPath() { Configuration pluginConfig = this.resourceContext.getPluginConfiguration(); String script = pluginConfig.getSimpleValue(TomcatServerComponent.PLUGIN_CONFIG_START_SCRIPT, ""); File scriptFile = resolvePathRelativeToHomeDir(script); return scriptFile; }
private DriftHandlingMode getDriftHandlingModeProperty() { return DriftHandlingMode.valueOf(configuration.getSimpleValue( DriftConfigurationDefinition.PROP_DRIFT_HANDLING_MODE, DriftConfigurationDefinition.DEFAULT_DRIFT_HANDLING_MODE.name())); }
@Override public void start(ResourceContext context) throws Exception { Configuration pluginConfig = context.getPluginConfiguration(); String connectionType = pluginConfig.getSimpleValue(JMXDiscoveryComponent.CONNECTION_TYPE, ""); if (!connectionType.equals(JMXDiscoveryComponent.PARENT_TYPE)) { throw new InvalidPluginConfigurationException("The only legal connection type for embedded JVM Resources is \"" + JMXDiscoveryComponent.PARENT_TYPE + "\"."); } super.start(context); }
ConfigurationUpdateHelper(Configuration configuration) { this.configuration = configuration; hasDiscoveryGroupName = isNotBlank(this.configuration.getSimpleValue(DISCOVERY_GROUP_NAME)); hasConnector = isConnectorPropertyDefined(); hasNoneOfTheAlternatives = hasDiscoveryGroupName == hasConnector && hasConnector == false; errorMessage = getBeginningOfErrorMessage() + (hasNoneOfTheAlternatives ? " You provided none." : " You provided both."); }
@Override @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public StorageNode createStorageNode(Resource resource, StorageClusterSettings clusterSettings) { Configuration pluginConfig = resource.getPluginConfiguration(); StorageNode storageNode = new StorageNode(); storageNode.setAddress(pluginConfig.getSimpleValue(RHQ_STORAGE_ADDRESS_PROPERTY)); storageNode.setCqlPort(clusterSettings.getCqlPort()); storageNode.setResource(resource); storageNode.setOperationMode(OperationMode.INSTALLED); storageNode.setVersion(this.getClass().getPackage().getImplementationVersion()); entityManager.persist(storageNode); return storageNode; }
private List<EmsBean> getVHosts() { EmsConnection emsConnection = getEmsConnection(); String query = QUERY_TEMPLATE_HOST; query = query.replace("%PATH%", getResourceContext().getPluginConfiguration().getSimpleValue(PROPERTY_CONTEXT_ROOT, "")); ObjectNameQueryUtility queryUtil = new ObjectNameQueryUtility(query); List<EmsBean> mBeans = emsConnection.queryBeans(queryUtil.getTranslatedQuery()); return mBeans; }