Package org.rhq.core.clientapi.agent.inventory

Examples of org.rhq.core.clientapi.agent.inventory.ResourceFactoryAgentService


            resourceName, resourceType.getName(), resourceType.getPlugin(), pluginConfiguration, resourceConfiguration,
            timeout);

        try {
            AgentClient agentClient = agentManager.getAgentClient(agent);
            ResourceFactoryAgentService resourceFactoryAgentService = agentClient.getResourceFactoryAgentService();
            resourceFactoryAgentService.createResource(request);

            return persistedHistory;
        } catch (Exception e) {
            LOG.error("Error while sending create resource request to agent service", e);
View Full Code Here


            newResourceName, newResourceType.getName(), newResourceType.getPlugin(), pluginConfiguration,
            packageDetails, timeout);

        try {
            AgentClient agentClient = agentManager.getAgentClient(agent);
            ResourceFactoryAgentService resourceFactoryAgentService = agentClient.getResourceFactoryAgentService();
            resourceFactoryAgentService.createResource(request);

            return persistedHistory;
        } catch (NoResultException nre) {
            return null;
            //eat the exception.  Some of the queries return no results if no package yet exists which is fine.
View Full Code Here

        // Package into transfer object
        DeleteResourceRequest request = new DeleteResourceRequest(persistedHistory.getId(), resourceId);

        try {
            AgentClient agentClient = agentManager.getAgentClient(agent);
            ResourceFactoryAgentService resourceFactoryAgentService = agentClient.getResourceFactoryAgentService();
            resourceFactoryAgentService.deleteResource(request);

            return persistedHistory;
        } catch (CannotConnectException e) {
            LOG.error("Error while sending delete resource request to agent service", e);
View Full Code Here

    private void createDatasource(String dsName, String min, String max)
            throws Exception
    {
        LOG.info("########################  Running testCreateService()");
        PluginContainer pc = PluginContainer.getInstance();
        ResourceFactoryAgentService resourceFactoryAgentService = pc.getResourceFactoryAgentService();

        Resource platform = discoverPlatform();
        // There should only be one server.
        Resource as5Server = findServer(SERVER_NAME, platform);
        ResourceType dsType =
                pc.getPluginManager().getMetadataManager().getType("Local Transaction", ResourceCategory.SERVICE);

        //Puts a String, Long String, Integer, Boolean, and Map into the DS config
        Configuration config = new Configuration();
        config.put(new PropertySimple("jndi-name", dsName));
        config.put(new PropertySimple("connection-url", "jdbc:hsqldb:."));
        config.put(new PropertySimple("user-name", "userJoe"));
        config.put(new PropertySimple("password", "password"));
        // Min and Max are not being put into the xml file.
        config.put(new PropertySimple("min-pool-size", min));
        config.put(new PropertySimple("max-pool-size", max));
        config.put(new PropertySimple("driver-class", "org.hsqldb.jdbcDriver"));
        config.put(new PropertySimple("share-prepared-statements", false));
        config.put(new PropertySimple("prepared-statement-cache-size", max));
        config.put(new PropertySimple("new-connection-sql", "Select count(*) from dual;"));

        PropertyMap connectionProperies = new PropertyMap("connectionProperties");
        PropertySimple simple1 = new PropertySimple("ConnProp1", "FirstValue");
        PropertySimple simple2 = new PropertySimple("ConnProp2", "SecondValue");
        connectionProperies.put(simple1);
        connectionProperies.put(simple2);
        config.put(connectionProperies);

        CreateResourceRequest request = new CreateResourceRequest(1, as5Server.getId(), "newResource", dsType.getName(), dsType.getPlugin(), null, config);

        resourceFactoryAgentService.executeCreateResourceImmediately(request);

        platform = discoverPlatform();

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

View Full Code Here

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

        assert deleteMe != null : "Could not find datasource to be deleted";

        PluginContainer pc = PluginContainer.getInstance();
        ResourceFactoryAgentService resourceFactoryAgentService = pc.getResourceFactoryAgentService();

        DeleteResourceRequest deleteRequest = new DeleteResourceRequest(1, deleteMe.getId());

        try
        {
            resourceFactoryAgentService.executeDeleteResourceImmediately(deleteRequest);
        }
        catch (PluginContainerException e)
        {
            fail();
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.clientapi.agent.inventory.ResourceFactoryAgentService

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.