Examples of InventoryManager


Examples of org.rhq.core.pc.inventory.InventoryManager

            doDeployment(deploymentOptions);
            ClusterInitService clusterInitService = new ClusterInitService();
            clusterInitService.waitForClusterToStart(new String [] {"127.0.0.2"}, new int[] {7400});

            InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
            InventoryReport inventoryReport = inventoryManager.executeServerScanImmediately();
            Resource newStorageNode = null;

            if (inventoryReport.getAddedRoots().isEmpty()) {
                // could be empty if the storage node is already in inventory from
                // a prior discovery scan.
                Resource platform = inventoryManager.getPlatform();
                newStorageNode = findCassandraNode(platform.getChildResources(), "127.0.0.2");
            } else {
                newStorageNode = findCassandraNode(inventoryReport.getAddedRoots(), "127.0.0.2");
            }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        assertNotNull(availability, "Unable to determine availability for " + storageNode);
        assertEquals(availability.getAvailabilityType(), AvailabilityType.DOWN, msg);
    }

    private Availability getAvailability() {
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        return new Availability(storageNode, inventoryManager.getCurrentAvailability(storageNode, false).forResource(storageNode.getId()));
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        return new Availability(storageNode, inventoryManager.getCurrentAvailability(storageNode, false).forResource(storageNode.getId()));
    }

    private void executeAvailabilityScan() {
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        inventoryManager.executeAvailabilityScanImmediately(false, true);
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

                tweakDefaultPluginConfig(defaultPluginConfig);
                resetConfigFiles(defaultPluginConfig, deleteRoot);
                deleteRoot = false;
            }

            InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
            System.out.println("Executing server discovery scan...");
            inventoryManager.executeServerScanImmediately();
            System.out.println("Executing service discovery scan...");
            inventoryManager.executeServiceScanImmediately();
        } catch (Exception e) {
            e.printStackTrace();
            fail("Failed to initialize the plugin container.", e);
        }
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

    protected final ResourceType getResourceType() {
        return getResourceType(getResourceTypeName(), getPluginName());
    }

    protected Set<Resource> getResources() {
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        ResourceType resourceType = getResourceType();
        Set<Resource> resources = inventoryManager.getResourcesWithType(resourceType);
        return resources;
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        System.out.println("---------- Finished " + getClass().getSimpleName() + ". testShutdownAndStartOperations...");
    }

    private void restartServerResourceComponent() throws PluginContainerException {
        InventoryManager inventoryManager = this.pluginContainer.getInventoryManager();
        inventoryManager.deactivateResource(getServerResource());
        ResourceContainer serverContainer = inventoryManager.getResourceContainer(getServerResource());
        inventoryManager.activateResource(getServerResource(), serverContainer, true);
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

        catch (PluginContainerException e)
        {
            fail();
        }

        InventoryManager inventoryManager = pc.getInventoryManager();
        assert inventoryManager.getResourceComponent(deleteMe) == null : "Resource component was not deleted from inventory manager";

        Resource deleteMe2 = findService(dsName, SERVER_NAME, platform);

        assert deleteMe2 == null : "found datasource that was supposed to be deleted";
    }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

    }

    @Override
    protected Set<Resource> getResources() {
        //let's pick the "another-crontab" file
        InventoryManager inventoryManager = PluginContainer.getInstance().getInventoryManager();
        ResourceType resourceType = getResourceType();
        Set<Resource> resources = inventoryManager.getResourcesWithType(resourceType);
       
        for(Resource res : resources) {
            if ("/etc/cron.d/another-crontab".equals(res.getResourceKey())) {
                return Collections.singleton(res);
            }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

import org.rhq.core.pluginapi.measurement.MeasurementFacet;

public class TestHelper {

  public static Set<Resource> getResources(ResourceType resourceType) {
    InventoryManager inventoryManager = PluginContainer.getInstance()
        .getInventoryManager();
    Set<Resource> resources = inventoryManager
        .getResourcesWithType(resourceType);
    return resources;
  }
View Full Code Here

Examples of org.rhq.core.pc.inventory.InventoryManager

    PluginMetadataManager pluginMetadataManager = PluginContainer
        .getInstance().getPluginManager().getMetadataManager();
    ResourceType appServerResourceType = pluginMetadataManager.getType(
        APPLICATION_SERVER_RESOURCE_NAME, PLUGIN_NAME);

    InventoryManager inventoryManager = PluginContainer.getInstance()
        .getInventoryManager();

    Set<Resource> appServers = inventoryManager
        .getResourcesWithType(appServerResourceType);

    if (appServers.size() != 1) {
      throw new IllegalStateException(
          "Expected to find exactly 1 AS5 server, but found "
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.