Package org.rhq.core.domain.resource

Examples of org.rhq.core.domain.resource.ResourceCategory


            }
            totalCount++;
            if (resource.getResourceType() == null) {
                return;
            }
            ResourceCategory category = resource.getResourceType().getCategory();
            switch (category) {
            case PLATFORM:
                platformCount++;
                break;
            case SERVER:
View Full Code Here


        HLayout hLayout = new HLayout();
        VLayout horizontalSpacer = new VLayout();
        horizontalSpacer.setWidth(140);
        hLayout.addMember(horizontalSpacer);
        ResourceCategory resourceCategory = this.groupComposite.getResourceGroup().getResourceType().getCategory();
        String memberIcon = ImageManager.getResourceIcon(resourceCategory);
        HoverCustomizer nameHoverCustomizer = new HoverCustomizer() {
            public String hoverHTML(Object value, ListGridRecord listGridRecord, int rowNum, int colNum) {
                return AncestryUtil.getAncestryHoverHTML(listGridRecord, 0);
            }
View Full Code Here

        // available resources are all resources in the system that are not associated with the user and are not pending
        log.debug("determine if user wants to filter available resources");
        Integer typeIdFilter = ((addForm.getType() == null) || (addForm.getType() == DEFAULT_RESOURCE_TYPE)) ? null
            : addForm.getType();
        ResourceCategory categoryFilter = (addForm.getCategory() != null) ? ResourceCategory.valueOf(addForm
            .getCategory().toUpperCase()) : ResourceCategory.PLATFORM;

        int[] excludeIds = StringUtility.getIntArray(pendingResourceList);
        PageList<Resource> availableResources = null;
View Full Code Here

        if ((hubForm.getResourceCategory() == null) || hubForm.getResourceCategory().equals("")) {
            hubForm.setResourceCategory(DEFAULT_RESOURCE_CATEGORY);
        }

        ResourceCategory resourceCategory = ResourceCategory.valueOf(hubForm.getResourceCategory());
        String pluginName = ALL_PLUGINS;
        if ((hubForm.getPlugin() != null) && !hubForm.getPlugin().trim().equals("")) {
            pluginName = decode(hubForm.getPlugin());
        }
        PageList<ResourceComposite> resources = LookupUtil.getResourceManager().findResourceComposites(subject,
View Full Code Here

        if (resourceGroup.getGroupCategory() == GroupCategory.COMPATIBLE) {
            ResourceType compatibleTypeFilter = resourceGroup.getResourceType();
            availableResources = resourceManager.findAvailableResourcesForResourceGroup(user, groupId,
                compatibleTypeFilter, null, nameFilter, pendingResourceIds, pcAvail);
        } else if (resourceGroup.getGroupCategory() == GroupCategory.MIXED) {
            ResourceCategory resourceCategory = getResourceCategory(addForm.getFilterBy());
            availableResources = resourceManager.findAvailableResourcesForResourceGroup(user, groupId, null,
                resourceCategory, nameFilter, pendingResourceIds, pcAvail);
            addForm.setAvailResourceTypes(buildResourceTypes());
        } else {
            throw new IllegalArgumentException("AddGroupResourcesFormPrepareAction " + "does not support '"
View Full Code Here

        Resource resource = RequestUtils.getResource(request);

        if (resource != null) {
            // this is an alert against a single resource
            ResourceType resourceType = resource.getResourceType();
            ResourceCategory resourceCategory = resourceType.getCategory();
            String categoryName = resourceCategory.name().toLowerCase();

            titleName = StringUtil.replace(titleName, "platform", categoryName);
        } else if (RequestUtils.getResourceGroupIfExists(request) != null) {
            // we don't have different titles for groups
            titleName = StringUtil.replace(titleName, "platform", "group");
View Full Code Here

        } else {
            // template alert definition
            type = RequestUtils.getResourceType(request);
        }

        ResourceCategory category = type.getCategory();

        titleName = StringUtil.replace(titleName, "platform", category.toString().toLowerCase());

        portal.setName(titleName);

        // if there's an alert definition available, set our second
        // title parameter to its name
View Full Code Here

        // Find resources specified by category and potentially type.
        // Collect query params and replace invalid ones with defaults.
        String groupName = getGroupName(request, hubForm);
        String resourceTypeName = HubConstants.ALL_RESOURCE_TYPES;
        ResourceCategory resourceCategory = null;
        if (hubForm.getResourceType() != null) {
            /* resourceCategory and resourceType are mutually exclusive
             *
             * the user will either: 1) filter on a single type, 2) filter on a category (a.k.a "ALL ( Platforms | Server
             * | Service ) Types") 3) or neither, meaning "All Groups" if the form's resourceType is null
View Full Code Here

                .getResourceTypesForCompatibleGroups(subject, pluginName);
            Set<String> platformTypes = new TreeSet<String>();
            Set<String> serverTypes = new TreeSet<String>();
            Set<String> serviceTypes = new TreeSet<String>();
            for (ResourceType type : allResourceTypes) {
                ResourceCategory category = type.getCategory();
                if (category == ResourceCategory.PLATFORM) {
                    platformTypes.add(type.getName());
                } else if (category == ResourceCategory.SERVER) {
                    serverTypes.add(type.getName());
                } else if (category == ResourceCategory.SERVICE) {
                    serviceTypes.add(type.getName());
                } else {
                    throw new IllegalArgumentException("Unsupported ResourceCategory '" + category.name()
                        + "' in GroupHubPortalAction.initGroupTypesPulldownMenu");
                }
            }

            addResourceTypeMenuItems(hubForm, platformTypes, RequestUtils.message(request, ALL_PLATFORMS_KEY), "-1");
View Full Code Here

    private void generatePlatformsReport() throws Exception {
        Subject user = getOverlord();
        ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();

        ResourceCategory category = ResourceCategory.PLATFORM;
        int committed = resourceManager.getResourceCountByCategory(user, category, InventoryStatus.COMMITTED);
        int ignored = resourceManager.getResourceCountByCategory(user, category, InventoryStatus.IGNORED);
        int deleted = resourceManager.getResourceCountByCategory(user, category, InventoryStatus.DELETED);
        int uninventoried = resourceManager.getResourceCountByCategory(user, category, InventoryStatus.UNINVENTORIED);
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.ResourceCategory

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.