Package org.rhq.enterprise.server.resource

Examples of org.rhq.enterprise.server.resource.ResourceManagerLocal


    Map<Integer, Resource> loadResourceMap(final Subject subject, Integer[] resourceIds) {
        ResourceCriteria criteria = new ResourceCriteria();
        criteria.addFilterIds(resourceIds);

        final ResourceManagerLocal resourceMgr = getResourceManager();
        //Use CriteriaQuery to automatically chunk/page through criteria query results
        CriteriaQueryExecutor<Resource, ResourceCriteria> queryExecutor = new CriteriaQueryExecutor<Resource, ResourceCriteria>() {
            @Override
            public PageList<Resource> execute(ResourceCriteria criteria) {
                return resourceMgr.findResourcesByCriteria(subject, criteria);
            }
        };

        CriteriaQuery<Resource, ResourceCriteria> resources = new CriteriaQuery<Resource, ResourceCriteria>(criteria,
            queryExecutor);
View Full Code Here


    public void testPurgeWhenDeleting() throws Throwable {
        addDataToBePurged();
        try {
            Subject overlord = LookupUtil.getSubjectManager().getOverlord();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();

            List<Integer> deletedIds = resourceManager.uninventoryResource(overlord, newResource.getId());
            resourceManager.uninventoryResourceAsyncWork(overlord, newResource.getId());

            assertEquals("didn't delete resource: " + deletedIds, 1, deletedIds.size());
            assertEquals("what was deleted? : " + deletedIds, newResource.getId(), deletedIds.get(0).intValue());

            // I don't have the resource anymore so I can't use makeSureDataIsPurged to test
View Full Code Here

            ResourceType doomedResourceType = doomedResource.getResourceType();
            Agent doomedAgent = doomedResource.getAgent();

            // delete the resource itself
            Subject overlord = LookupUtil.getSubjectManager().getOverlord();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
            List<Integer> deletedIds = resourceManager.uninventoryResource(overlord, doomedResource.getId());
            for (Integer deletedResourceId : deletedIds) {
                resourceManager.uninventoryResourceAsyncWork(overlord, deletedResourceId);
            }

            // delete the agent and the type
            getTransactionManager().begin();
View Full Code Here

    }

    private String replaceResourceToken(Token token, Resource resource) {

        ResourceManagerLocal mgr = LookupUtil.getResourceManager();
        Subject overlord = LookupUtil.getSubjectManager().getOverlord();
        Resource parent;
        Resource platform = mgr.getPlaformOfResource(overlord, resource.getId());
        if (platform == null)
            platform = resource;

        switch (token) {
        case RESOURCE_ID:
            return String.valueOf(resource.getId());
        case RESOURCE_NAME:
            return resource.getName();
        case RESOURCE_PARENT_ID:
            parent = mgr.getParentResource(resource.getId());
            if (parent == null)
                return "0";
            else
                return String.valueOf(parent.getId());
        case RESOURCE_PARENT_NAME:
            parent = mgr.getParentResource(resource.getId());
            if (parent == null)
                return "N/A";
            else
                return parent.getName();
        case RESOURCE_TYPE_ID:
View Full Code Here

            displayLastCompleted = operationPreferences.useLastCompleted;
            displayNextScheduled = operationPreferences.useNextScheduled;

            OperationManagerLocal manager = LookupUtil.getOperationManager();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
           
            if (operationPreferences.useLastCompleted) {
                PageControl pageControl = new PageControl(0, operationPreferences.lastCompleted);
                pageControl.initDefaultOrderingField("ro.createdTime", PageOrdering.DESC);
                PageList<ResourceOperationLastCompletedComposite> lastCompletedResourceOps =
View Full Code Here

        Map<DisambiguationReport<Resource>, List<DisambiguationReport<Resource>>> queuedResources = new HashMap<DisambiguationReport<Resource>, List<DisambiguationReport<Resource>>>();

        try {
            DiscoveryBossLocal discoveryBoss = LookupUtil.getDiscoveryBoss();
            ResourceManagerLocal resourceManager = LookupUtil.getResourceManager();
           
            WebUser user = SessionUtils.getWebUser(request.getSession());
            if (user == null) {
                // session timed out, return prematurely
                return null;
View Full Code Here

TOP

Related Classes of org.rhq.enterprise.server.resource.ResourceManagerLocal

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.