Examples of PluginKey


Examples of org.rhq.core.domain.plugin.PluginKey

                return selectedPluginNames;
            } else {
                ArrayList<String> enabledPlugins = new ArrayList<String>();
                ArrayList<String> failedPlugins = new ArrayList<String>();
                for (ServerPlugin pluginToEnable : pluginsToEnable) {
                    PluginKey key = PluginKey.createServerPluginKey(pluginToEnable.getType(), pluginToEnable.getName());
                    if (enabled.contains(key)) {
                        enabledPlugins.add(pluginToEnable.getDisplayName());
                    } else {
                        failedPlugins.add(pluginToEnable.getDisplayName());
                    }
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

    }

    public void testGetPlugins() throws Exception {
        ServerPlugin p1 = registerPlugin(1);
        ServerPlugin p2 = registerPlugin(2);
        PluginKey p1key = new PluginKey(p1);
        PluginKey p2key = new PluginKey(p2);
        List<PluginKey> pluginKeys = this.serverPluginsBean.getServerPluginKeysByEnabled(true);
        assert pluginKeys.contains(p1key) : pluginKeys;
        assert pluginKeys.contains(p2key) : pluginKeys;
        pluginKeys = this.serverPluginsBean.getServerPluginKeysByEnabled(false);
        assert !pluginKeys.contains(p1key) : pluginKeys;
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

        assert lastTimestamp == getConfigurationLastModifiedTimestamp(p2);
    }

    public void testUpdatePlugins() throws Exception {
        ServerPlugin p1 = registerPlugin(1);
        PluginKey p1key = new PluginKey(p1);

        p1 = this.serverPluginsBean.getServerPlugin(p1key);
        p1 = this.serverPluginsBean.getServerPluginRelationships(p1);

        ServerPlugin p1update = this.serverPluginsBean.updateServerPluginExceptContent(getOverlord(), p1);
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

    }

    public void testTryEnableServerPluginsWithMissingRequiredConfiguration() throws Exception {
        ServerPlugin p1 = registerPlugin(1, Configuration.builder().addSimple("foo", "bar").build());
        ServerPlugin p2 = registerPlugin(2);
        PluginKey p1key = new PluginKey(p1);
        PluginKey p2key = new PluginKey(p2);

        List<Integer> ids = new ArrayList<Integer>(2);
        ids.add(p1.getId());
        ids.add(p2.getId());
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

    }

    public void testDisableEnablePlugins() throws Exception {
        ServerPlugin p1 = registerPlugin(1);
        ServerPlugin p2 = registerPlugin(2);
        PluginKey p1key = new PluginKey(p1);
        PluginKey p2key = new PluginKey(p2);

        List<Integer> ids = new ArrayList<Integer>(2);
        ids.add(p1.getId());
        ids.add(p2.getId());
        List<PluginKey> disabled = this.serverPluginsBean.disableServerPlugins(getOverlord(), ids);
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

        int originalSize = this.serverPluginsBean.getAllServerPlugins().size();

        PluginStatusType status;

        PluginKey missingKey;
        missingKey = new PluginKey(PluginDeploymentType.SERVER,
            new ServerPluginType(GenericPluginDescriptorType.class).stringify(), TEST_PLUGIN_NAME_PREFIX + "1");
        status = this.serverPluginsBean.getServerPluginStatus(missingKey);
        assert status == null;
        missingKey = new PluginKey(PluginDeploymentType.SERVER,
            new ServerPluginType(GenericPluginDescriptorType.class).stringify(), TEST_PLUGIN_NAME_PREFIX + "2");
        status = this.serverPluginsBean.getServerPluginStatus(missingKey);
        assert status == null;

        ServerPlugin p1 = registerPlugin(1);
        ServerPlugin p2 = registerPlugin(2);
        PluginKey p1key = new PluginKey(p1);
        PluginKey p2key = new PluginKey(p2);

        status = this.serverPluginsBean.getServerPluginStatus(p1key);
        assert status == PluginStatusType.INSTALLED;
        status = this.serverPluginsBean.getServerPluginStatus(p2key);
        assert status == PluginStatusType.INSTALLED;
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

    public void testReRegisterPlugins() throws Exception {

        PluginStatusType status;

        PluginKey missingKey;
        missingKey = new PluginKey(PluginDeploymentType.SERVER,
            new ServerPluginType(GenericPluginDescriptorType.class).stringify(), TEST_PLUGIN_NAME_PREFIX + "1");
        status = this.serverPluginsBean.getServerPluginStatus(missingKey);
        assert status == null;
        missingKey = new PluginKey(PluginDeploymentType.SERVER,
            new ServerPluginType(GenericPluginDescriptorType.class).stringify(), TEST_PLUGIN_NAME_PREFIX + "2");
        status = this.serverPluginsBean.getServerPluginStatus(missingKey);
        assert status == null;

        ServerPlugin p1 = registerPlugin(1);
        ServerPlugin p2 = registerPlugin(2);
        PluginKey p1key = new PluginKey(p1);
        PluginKey p2key = new PluginKey(p2);

        status = this.serverPluginsBean.getServerPluginStatus(p1key);
        assert status == PluginStatusType.INSTALLED;
        status = this.serverPluginsBean.getServerPluginStatus(p2key);
        assert status == PluginStatusType.INSTALLED;
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

            if (configDef != null) {
                scheduledJobsConfig = configDef.getDefaultTemplate().createConfiguration();
            }

            File pluginFile = new File(pluginUrl.toURI());
            PluginKey pluginKey = PluginKey.createServerPluginKey(new ServerPluginType(pluginDescriptor).stringify(), pluginDescriptor.getName());
            ServerPlugin plugin =
                new ServerPlugin(0, pluginKey.getPluginName(), pluginFile.getName(),
                    pluginDescriptor.getDisplayName(), true, PluginStatusType.INSTALLED,
                    pluginDescriptor.getDescription(), "", MessageDigestGenerator.getDigestString(pluginFile),
                    pluginDescriptor.getVersion(), pluginDescriptor.getVersion(), pluginConfig,
                    scheduledJobsConfig, new ServerPluginType(pluginDescriptor).stringify(),
                    System.currentTimeMillis(), System.currentTimeMillis());
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

        // now see if any plugins changed state from enabled->disabled or vice versa
        // this also checks to see if the plugin configuration has changed since it was last loaded
        MasterServerPluginContainer master = LookupUtil.getServerPluginService().getMasterPluginContainer();
        if (master != null) {
            for (ServerPlugin installedPlugin : installedPlugins) {
                PluginKey key = PluginKey.createServerPluginKey(installedPlugin.getType(), installedPlugin.getName());
                AbstractTypeServerPluginContainer pc = master.getPluginContainerByPlugin(key);
                if (pc != null && pc.isPluginLoaded(key)) {
                    boolean needToReloadPlugin = false;
                    boolean currentlyEnabled = pc.isPluginEnabled(key);
                    if (installedPlugin.isEnabled() != currentlyEnabled) {
View Full Code Here

Examples of org.rhq.core.domain.plugin.PluginKey

            }

            ServerPluginManagerLocal serverPluginsManager = LookupUtil.getServerPluginManager();

            // see if this plugin has been deleted previously; if so, don't register and delete the file
            PluginKey newPluginKey = new PluginKey(plugin);
            PluginStatusType status = serverPluginsManager.getServerPluginStatus(newPluginKey);

            if (PluginStatusType.DELETED == status) {
                log.warn("Plugin file [" + pluginFile + "] has been detected but that plugin with name [" + pluginName
                    + "] was previously undeployed. Will not re-register that plugin and the file will be deleted.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.