Package org.rhq.core.pluginapi.inventory

Examples of org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException


  }

  protected void setOperationArguments(String name,
      Configuration configuration, Map<String, Object> argumentMap) {
    // moved this logic up to the associated implemented class
    throw new InvalidPluginConfigurationException(
        "Not implemented on component type " + this.getComponentType() //$NON-NLS-1$
            + " named " + this.name); //$NON-NLS-1$

  }
View Full Code Here


  }

  protected void setMetricArguments(String name, Configuration configuration,
      Map<String, Object> argumentMap) {
    // moved this logic up to the associated implemented class
    throw new InvalidPluginConfigurationException(
        "Not implemented on component type " + this.getComponentType() //$NON-NLS-1$
            + " named " + this.name); //$NON-NLS-1$

  }
View Full Code Here

     super.start(context);
     Configuration pluginConfig = context.getPluginConfiguration();

     this.configPath = getConfigurationPath();
     if (!this.configPath.exists()) {
       throw new InvalidPluginConfigurationException("Configuration path '" + configPath + "' does not exist.");
     }
     this.configSet = pluginConfig.getSimpleValue(CONFIGURATION_SET_CONFIG_PROP, this.configPath.getName());
   }
View Full Code Here

                String regEx = tokenizer.nextToken();
                try {
                    Pattern exclude = Pattern.compile(regEx);
                    excludes.add(exclude);
                } catch (PatternSyntaxException e) {
                    throw new InvalidPluginConfigurationException("'" + RESPONSE_TIME_URL_EXCLUDES_CONFIG_PROP
                        + "' connection property contains an invalid exclude expression: " + regEx, e);
                }
            }
        }
View Full Code Here

            while (tokenizer.hasMoreTokens()) {
                String value = tokenizer.nextToken();
                String delimiter = value.substring(0, 1); // first character is the delimiter (sed-style)
                String lastChar = value.substring(value.length() - 1);
                if (value.length() < 3 || !lastChar.equals(delimiter)) {
                    throw new InvalidPluginConfigurationException("'" + RESPONSE_TIME_URL_TRANSFORMS_CONFIG_PROP
                        + "' connection property contains an invalid transform expression [" + value + "]. "
                        + "A transform expressions should contain exactly three delimiters (the first character "
                        + "of the expression is the delimiter) and should also end with a delimiter. For example, "
                        + "|foo|bar|\" replaces \"foo\" with \"bar\".");
                }
                String[] tokens = value.substring(1, value.length() - 1).split(Pattern.quote(delimiter), -1);
                if (tokens.length != 2) {
                    throw new InvalidPluginConfigurationException("'" + RESPONSE_TIME_URL_TRANSFORMS_CONFIG_PROP
                        + "' connection property contains an invalid transform expression [" + value + "]. "
                        + "A transform expressions should contain exactly three delimiters (the first character "
                        + "of the expression is the delimiter). For example, \"|foo|bar|\" replaces \"foo\" with \"bar\".");
                }
                String regEx = tokens[0];
                String replacement = tokens[1];
                try {
                    Pattern pattern = Pattern.compile(regEx);
                    RegexSubstitution transform = new RegexSubstitution(pattern, replacement);
                    transforms.add(transform);
                } catch (PatternSyntaxException e) {
                    throw new InvalidPluginConfigurationException("'" + RESPONSE_TIME_URL_TRANSFORMS_CONFIG_PROP
                        + "' connection property contains an invalid transform expression [" + value + "]. "
                        + "Specifically, the regular expression portion [" + regEx + "] is not a valid regular expression.", e);
                }
            }
        }
View Full Code Here

                        log.debug("Resource has a bad config, waiting for this to go away: " + resource);
                    }
                    InventoryEventListener iel = new ResourceGotActivatedListener();
                    addInventoryEventListener(iel);

                    throw new InvalidPluginConfigurationException(message);
                }

                throw new PluginContainerException(message);
            }
View Full Code Here

            if (dateFormatString != null) {
                try {
                    DateFormat dateFormat = new SimpleDateFormat(dateFormatString); // TODO locale specific ?
                    processor.setDateFormat(dateFormat);
                } catch (IllegalArgumentException e) {
                    throw new InvalidPluginConfigurationException("Date format [" + dateFormatString
                        + "] is not a valid simple date format.");
                }
            }
            String includesPatternString = logEventSource.getSimpleValue(
                LogEventSourcePropertyNames.INCLUDES_PATTERN, null);
            if (includesPatternString != null) {
                try {
                    Pattern includesPattern = Pattern.compile(includesPatternString);
                    processor.setIncludesPattern(includesPattern);
                } catch (PatternSyntaxException e) {
                    throw new InvalidPluginConfigurationException("Includes pattern [" + includesPatternString
                        + "] is not a valid regular expression.");
                }
            }
            String minimumSeverityString = logEventSource.getSimpleValue(
                LogEventSourcePropertyNames.MINIMUM_SEVERITY, null);
View Full Code Here

        log.debug("resource will have detection mechanism of [" + detectionMechanism + "]");

        switch (detectionMechanism) {
        case INTERNAL:
            if (SystemInfoFactory.isNativeSystemInfoDisabled()) {
                throw new InvalidPluginConfigurationException(
                    "The native system is disabled - cannot use the internal detection mechanism");
            }
            if (!SystemInfoFactory.isNativeSystemInfoAvailable()) {
                throw new InvalidPluginConfigurationException(
                    "The native system is not available - cannot use the internal detection mechanism");
            }
            String version = LsofComponent.VERSION;
            details = new DiscoveredResourceDetails(discoveryContext.getResourceType(), "*lsof-internal*",
                DEFAULT_NAME, version, DEFAULT_DESCRIPTION, pluginConfig, null);
            break;
        case EXTERNAL:
            // do all that we can to make sure we have a valid full path to the executable
            PropertySimple executable = pluginConfig.getSimple(LsofComponent.PLUGINCONFIG_EXECUTABLE);
            executable.setStringValue(findExecutable(executable.getStringValue()));

            details = super.discoverResource(pluginConfig, discoveryContext);
            details.setResourceName(DEFAULT_NAME);
            break;
        default:
            throw new InvalidPluginConfigurationException("Unknown detection mechanism: " + detectionMechanism);
        }

        return details;
    }
View Full Code Here

        Configuration configuration = context.getPluginConfiguration();

        if (configuration.get(JBossCacheComponent.CACHE_SEARCH_STRING) != null)
            beanName = configuration.getSimple(JBossCacheComponent.CACHE_SEARCH_STRING).getStringValue();
        else
            throw new InvalidPluginConfigurationException("Invalid plugin configuration in JBossCache component.");

    }
View Full Code Here

                    long ms = Long.parseLong(value); // throws number format exception if not a number
                    log.info("The rogue discovery component was told to sleep: " + ms + "ms");
                    sleep(ms);
                    log.info("The rogue discovery component has finished its sleep of " + ms + "ms");
                } catch (Exception e) {
                    throw new InvalidPluginConfigurationException(
                        "The rogue discovery component was configured to throw this invalid config exception", e);
                }
            } else {
                log.info("The rogue discovery component was not configured to do anything bad - returning normally");
            }
View Full Code Here

TOP

Related Classes of org.rhq.core.pluginapi.inventory.InvalidPluginConfigurationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.