Package org.rhq.core.pluginapi.inventory

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


            break;
        case piql:
            pid = getPidFromPiqlExpression(processComponentConfig, systemInfo);
            break;
        default:
            throw new InvalidPluginConfigurationException("Unknown type: " + processComponentConfig.getType());
        }

        if (processComponentConfig.isFullProcessTree()) {
            return new AggregateProcessInfo(pid);
        } else {
View Full Code Here


            pooledConnectionProvider = new PostgresPooledConnectionProvider(resourceContext.getPluginConfiguration());
        } catch (SQLException e) {
            if (e.getCause() instanceof SQLException) {
                SQLException cause = (SQLException) e.getCause();
                if ("28P01".equals(cause.getSQLState())) {
                    throw new InvalidPluginConfigurationException("Invalid password");
                }
            }
            throw new InvalidPluginConfigurationException("Cannot open database connection", e);
        }
        ProcessInfo processInfo = resourceContext.getNativeProcess();
        if (processInfo != null) {
            aggregateProcessInfo = processInfo.getAggregateProcessTree();
        } else {
View Full Code Here

            type = Type.valueOf(pluginConfig.getSimpleValue("type", "pidFile"));
            pidFile = pluginConfig.getSimpleValue("pidFile", null);
            piql = pluginConfig.getSimpleValue("piql", null);
            fullProcessTree = pluginConfig.getSimple("fullProcessTree").getBooleanValue();
        } catch (Exception e) {
            throw new InvalidPluginConfigurationException(e);
        }

        // validate the plugin config some more
        if (type == Type.pidFile && (pidFile == null || pidFile.length() == 0)) {
            throw new InvalidPluginConfigurationException("Missing pidfile");
        }
        if (type == Type.piql && (piql == null || piql.length() == 0)) {
            throw new InvalidPluginConfigurationException("Missing process query");
        }

        return new ProcessComponentConfig(type, pidFile, piql, fullProcessTree);
    }
View Full Code Here

            null);// this will never be null
        JBossInstallationInfo installInfo;
        try {
            installInfo = new JBossInstallationInfo(new File(jbossHomeDir));
        } catch (IOException e) {
            throw new InvalidPluginConfigurationException(e);
        }
        String version = installInfo.getVersion();
        if (version.startsWith("5") || version.startsWith("6")) {
            throw new InvalidPluginConfigurationException(
                "The specified server is JBoss AS 5.0 or later - only AS 3.2 or 4.x are valid for this Resource type.");
        }
        DiscoveredResourceDetails resourceDetails = createResourceDetails(discoveryContext, pluginConfiguration,
            processInfo, installInfo);
        return resourceDetails;
View Full Code Here

            DiscoveredResourceDetails details = createResourceDetails(resourceDiscoveryContext, pluginConfig, version,
                null);
            return details;
        } catch (Exception e) {
            LOG.warn("Could not connect to oracle with supplied configuration", e);
            throw new InvalidPluginConfigurationException("Unable to connect to Oracle", e);
        } finally {
            DatabasePluginUtil.safeClose(connection);
        }
    }
View Full Code Here

    public static Connection buildConnection(Configuration configuration, boolean logFailure) {
        String driverClass = configuration.getSimple(DRIVER_CONFIGURATION_PROPERTY).getStringValue();
        try {
            Class.forName(driverClass);
        } catch (ClassNotFoundException e) {
            throw new InvalidPluginConfigurationException("Specified JDBC driver class (" + driverClass
                + ") not found.");
        }

        String url = buildUrl(configuration);
View Full Code Here

                return file.isDirectory() && (pre42 || is42);
            }
        });

        if ((!deployDir.isDirectory()) || (null == jbossWebDirs)) {
            throw new InvalidPluginConfigurationException("Invalid deploy directory: " + deployDir.getAbsolutePath());
        }

        Set<DiscoveredResourceDetails> set = new HashSet<DiscoveredResourceDetails>();
        for (File jbossWebDir : jbossWebDirs) {
            String key = jbossWebDir.getName();
View Full Code Here

        String address = pluginConfiguration.getSimpleValue(PLUGIN_CONFIG_PROP_ADDRESS, null);
        String port = pluginConfiguration.getSimpleValue(PLUGIN_CONFIG_PROP_PORT, null);
        String clientJar = pluginConfiguration.getSimpleValue(PLUGIN_CONFIG_PROP_CLIENT_JAR, null);

        if (address == null) {
            throw new InvalidPluginConfigurationException("Byteman address was not specified");
        }

        if (port == null) {
            throw new InvalidPluginConfigurationException("Byteman port was not specified");
        }

        if (clientJar == null) {
            throw new InvalidPluginConfigurationException("Byteman client jar was not specified");
        }

        try {
            Integer.parseInt(port);
        } catch (NumberFormatException e) {
            throw new InvalidPluginConfigurationException("Port number was invalid: " + port, e);
        }

        File clientJarFile = new File(clientJar);
        if (!clientJarFile.isFile() || !clientJarFile.canRead()) {
            throw new InvalidPluginConfigurationException("Byteman client jar [" + clientJar + "] cannot be read");
        }

        // build the general information for the new resource
        String key = address + ':' + port;
        String name = DEFAULT_NAME;
View Full Code Here

    public List<URL> getAdditionalClasspathUrls(ResourceDiscoveryContext<BytemanAgentComponent> context,
        DiscoveredResourceDetails details) throws Exception {

        PropertySimple clientJarProperty = details.getPluginConfiguration().getSimple(PLUGIN_CONFIG_PROP_CLIENT_JAR);
        if (clientJarProperty == null || clientJarProperty.getStringValue() == null) {
            throw new InvalidPluginConfigurationException("Byteman client jar not specified in plugin configuration");
        }

        String clientJarString = clientJarProperty.getStringValue();
        File clientJarFile = new File(clientJarString);
        if (!clientJarFile.exists()) {
            throw new InvalidPluginConfigurationException("Byteman client jar [" + clientJarString + "] does not exist");
        }
        if (!clientJarFile.canRead()) {
            throw new InvalidPluginConfigurationException("Byteman client jar [" + clientJarString + "] is unreadable");
        }

        List<URL> list = new ArrayList<URL>(1);
        list.add(clientJarFile.toURI().toURL());
        return list;
View Full Code Here

        Connection connection = null;
        ResultSet resultSet = null;
        try {
            connection = getConnectionFromComponent(parentComponent);
            if (connection == null) {
                throw new InvalidPluginConfigurationException("cannot obtain connection from parent");
            }
            statement = connection.createStatement();
            resultSet = statement.executeQuery("SELECT * FROM " + table);

            Set<DiscoveredResourceDetails> found = new HashSet<DiscoveredResourceDetails>();
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.