Package org.rhq.core.clientapi.descriptor.plugin

Examples of org.rhq.core.clientapi.descriptor.plugin.ServerDescriptor


            // using Embedded extension model - the defined type is actually a copy of another plugin's server type
            LOG.debug("Parsing embedded server type {" + pluginDescriptor.getName() + "}"
                    + serverDescriptor.getName() + ", which extends server type {" + sourcePlugin + "}" + sourceServer + "...");

            Map<String, ServerDescriptor> pluginServerDescriptors = getPluginServerDescriptors(sourcePlugin);
            ServerDescriptor sourceServerDescriptor = pluginServerDescriptors.get(sourceServer);

            if (sourceServerDescriptor == null) {
                LOG.warn("There is no server type named [" + sourceServer + "] from a plugin named [" + sourcePlugin
                        + "]. This is probably because that plugin is missing. Resource Type [{"
                        + pluginDescriptor.getName() + "}" + serverDescriptor.getName() + "] will be ignored.");
                return null;
            }

            serverResourceType = new ResourceType(serverDescriptor.getName(), pluginDescriptor.getName(),
                ResourceCategory.SERVER, parentServerType);

            // Let the plugin writer override these, or if not, parseResourceDescriptor() will pick up the source type's
            // values.
            serverResourceType.setDescription(serverDescriptor.getDescription());
            serverResourceType.setSubCategory(serverDescriptor.getSubCategory());

            serverResourceType.setCreationDataType(convertCreationDataType(serverDescriptor.getCreationDataType()));
            serverResourceType
                .setCreateDeletePolicy(convertCreateDeletePolicy(serverDescriptor.getCreateDeletePolicy()));
            serverResourceType.setSingleton(serverDescriptor.isSingleton());

            String discoveryClass;
            String componentClass;

            if (serverDescriptor.getDiscovery() != null) {
                discoveryClass = getFullyQualifiedComponentClassName(pluginDescriptor.getPackage(), serverDescriptor
                    .getDiscovery());
            } else {
                discoveryClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin),
                    sourceServerDescriptor.getDiscovery());
            }

            if (serverDescriptor.getClazz() != null) {
                componentClass = getFullyQualifiedComponentClassName(pluginDescriptor.getPackage(), serverDescriptor
                    .getClazz());
            } else {
                componentClass = getFullyQualifiedComponentClassName(getPluginPackage(sourcePlugin),
                    sourceServerDescriptor.getClazz());
            }

            parseResourceDescriptor(sourceServerDescriptor, serverResourceType, discoveryClass, componentClass,
                sourcePlugin);
            // The above incorporates children from the source descriptor. The following incorporates
View Full Code Here


            // using Embedded extension model - the defined type is actually a copy of another plugin's server type
            log.debug("Parsing embedded server type {" + pluginDescriptor.getName() + "}"
                    + serverDescriptor.getName() + ", which extends server type {" + sourcePlugin + "}" + sourceServer + "...");

            Map<String, ServerDescriptor> pluginServerDescriptors = getPluginServerDescriptors(sourcePlugin);
            ServerDescriptor sourceServerDescriptor = pluginServerDescriptors.get(sourceServer);

            if (sourceServerDescriptor == null) {
                log.warn("There is no server type named [" + sourceServer + "] from a plugin named [" + sourcePlugin
                        + "]. This is probably because that plugin is missing. Resource Type [{"
                        + pluginDescriptor.getName() + "}" + serverDescriptor.getName() + "] will be ignored.");
View Full Code Here

    }

    protected ConfigurationDefinition loadServerDescriptor(String serverName) throws InvalidPluginDescriptorException {
        List<ServerDescriptor> servers = pluginDescriptor.getServers();

        ServerDescriptor serverDescriptor = findServer(serverName, servers);
        assert serverDescriptor != null : "Server descriptor for server [" + serverName
            + "] not found in test plugin descriptor";

        return ConfigurationMetadataParser.parse("null", serverDescriptor.getResourceConfiguration());
    }
View Full Code Here


     private ConfigurationDefinition loadDescriptor(String serverName) throws InvalidPluginDescriptorException {
         List<ServerDescriptor> servers = pluginDescriptor.getServers();

         ServerDescriptor serverDescriptor = findServer(serverName, servers);
         assert serverDescriptor != null : "Server descriptor not found in test plugin descriptor";

         return ConfigurationMetadataParser.parse("null", serverDescriptor.getResourceConfiguration());
     }
View Full Code Here

     }

     @Test
     public void parseNestedSubCategories() {
         List<ServerDescriptor> servers = pluginDescriptor.getServers();
         ServerDescriptor server2 = servers.get(1);
         assert server2.getName().equals("testServer2");
         ResourceDescriptor.Subcategories subCategoriesDescriptor = server2.getSubcategories();
         assert subCategoriesDescriptor == null : "Unexpected subcategories element: " + server2.getName();
         assert server2.getSubCategory().equals("applications");

         List<ServiceDescriptor> services = pluginDescriptor.getServices();
         ServiceDescriptor service1 = services.get(0);
         assert service1.getName().equals("testService");
         assert service1.getSubCategory().equals("applications");
View Full Code Here

    }

    @Test
    public void parseValidDescriptor() throws Exception {
        List<ServerDescriptor> servers = pluginDescriptor.getServers();
        ServerDescriptor server0 = servers.get(0);
        List<ContentDescriptor> contentDescriptors = server0.getContent();

        assert contentDescriptors != null : "No content descriptors in server: " + server0.getName();

        PackageType packageType;

        packageType = ContentMetadataParser.parseContentDescriptor(contentDescriptors.get(0));
View Full Code Here

    }

    private ConfigurationDefinition loadDescriptor(String serverName) throws InvalidPluginDescriptorException {
        List<ServerDescriptor> servers = pluginDescriptor.getServers();

        ServerDescriptor serverDescriptor = findServer(serverName, servers);
        assert serverDescriptor != null : "Server descriptor not found in test plugin descriptor";

        return ConfigurationMetadataParser.parse("null", serverDescriptor.getResourceConfiguration());
    }
View Full Code Here

    }

    @Test
    public void parseSingleSubCategory() {
        List<ServerDescriptor> servers = pluginDescriptor.getServers();
        ServerDescriptor server0 = servers.get(0);
        ResourceDescriptor.Subcategories subCategoriesDescriptor = server0.getSubcategories();
        assert subCategoriesDescriptor != null : "No subcategories element: " + server0.getName();

        List<SubCategoryDescriptor> subCategoryDescriptors = subCategoriesDescriptor.getSubcategory();

        assert subCategoryDescriptors != null : "No subcategory elements: " + server0.getName();
        assert !subCategoryDescriptors.isEmpty() : "No subcategory elements: " + server0.getName();
    }
View Full Code Here

    }

    @Test
    public void parseNestedSubCategories() {
        List<ServerDescriptor> servers = pluginDescriptor.getServers();
        ServerDescriptor server1 = servers.get(1);
        ResourceDescriptor.Subcategories subCategoriesDescriptor = server1.getSubcategories();
        assert subCategoriesDescriptor != null : "No subcategories element: " + server1.getName();

        List<SubCategoryDescriptor> subCategoryDescriptors = subCategoriesDescriptor.getSubcategory();

        assert subCategoryDescriptors != null : "No subcategory elements: " + server1.getName();
        assert !subCategoryDescriptors.isEmpty() : "No subcategory elements: " + server1.getName();
    }
View Full Code Here

    }

    protected ConfigurationDefinition loadDescriptor(String serverName) throws InvalidPluginDescriptorException {
        List<ServerDescriptor> servers = pluginDescriptor.getServers();

        ServerDescriptor serverDescriptor = findServer(serverName, servers);
        assert serverDescriptor != null : "Server descriptor not found in test plugin descriptor";

        return ConfigurationMetadataParser.parse("null", serverDescriptor.getResourceConfiguration());
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.descriptor.plugin.ServerDescriptor

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.