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

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


        } catch (Exception e) {
            LOG.error("Error while sending create resource request to agent service", e);

            // Submit the error as a failure response
            String errorMessage = ThrowableUtil.getAllMessages(e);
            CreateResourceResponse response = new CreateResourceResponse(persistedHistory.getId(), null, null,
                CreateResourceStatus.FAILURE, errorMessage, resourceConfiguration);
            resourceFactoryManager.completeCreateResource(response);

            throw new RuntimeException("Error while sending create resource request to agent service", e);
        }
View Full Code Here


        } catch (CannotConnectException e) {
            LOG.error("Error while sending create resource request to agent service", e);

            // Submit the error as a failure response
            String errorMessage = ThrowableUtil.getAllMessages(e);
            CreateResourceResponse response = new CreateResourceResponse(persistedHistory.getId(), null, null,
                CreateResourceStatus.FAILURE, errorMessage, null);
            resourceFactoryManager.completeCreateResource(response);

            throw new CannotConnectToAgentException("Error while sending create resource request to agent service", e);
        } catch (Exception e) {
            LOG.error("Error while sending create resource request to agent service", e);

            // Submit the error as a failure response
            String errorMessage = ThrowableUtil.getAllMessages(e);
            CreateResourceResponse response = new CreateResourceResponse(persistedHistory.getId(), null, null,
                CreateResourceStatus.FAILURE, errorMessage, null);
            resourceFactoryManager.completeCreateResource(response);

            throw new RuntimeException("Error while sending create resource request to agent service", e);
        }
View Full Code Here

            .getTimeout());

        CreateResourceRunner runner = new CreateResourceRunner(this, request.getParentResourceId(), facet, request
            .getRequestId(), report, configuration.isInsideAgent());

        CreateResourceResponse response;
        try {
            response = (CreateResourceResponse) executor.submit((Callable) runner).get();
        } catch (Exception e) {
            throw new PluginContainerException("Error during create resource callable", e);
        }
View Full Code Here

            status = CreateResourceStatus.FAILURE;
            errorMessage = ThrowableUtil.getStackAsString(t);
        }

        // Send results back to the server
        CreateResourceResponse response =
            new CreateResourceResponse(requestId, resourceName, resourceKey, status, errorMessage, configuration);

        LOG.info("Sending create response to server: " + response);
        ResourceFactoryServerService serverService = resourceFactoryManager.getServerService();
        if (serverService != null) {
            try {
View Full Code Here

        }

        // ResourceFactoryAgentService Implementation  --------------------------------------------

        public void createResource(CreateResourceRequest request) throws PluginContainerException {
            CreateResourceResponse response = null;

            switch (createReturnStatus) {
            case SUCCESS: {
                response = new CreateResourceResponse(request.getRequestId(), "mockResourceName", "mockResourceKey",
                    CreateResourceStatus.SUCCESS, null, request.getResourceConfiguration());
                break;
            }

            case FAILURE: {
                response = new CreateResourceResponse(request.getRequestId(), null, null, CreateResourceStatus.FAILURE,
                    "errorMessage", request.getResourceConfiguration());
                break;
            }
            }
View Full Code Here

        createRequest.setPluginName(PLUGIN_NAME);
        createRequest.setResourceConfiguration(resourceConfig);
        createRequest.setResourceName(getTestDatasourceName());
        createRequest.setResourceTypeName(datasourceResourceType.getName());

        CreateResourceResponse createResourceResponse = pluginContainer.getResourceFactoryManager()
            .executeCreateResourceImmediately(createRequest);
        assertEquals(createResourceResponse.getStatus(), SUCCESS, createResourceResponse.getErrorMessage());

        Set<Resource> datasourceResources = pluginContainer.getInventoryManager().getResourcesWithType(
            datasourceResourceType);
        datasourceTestResource = null;
        for (Resource datasourceResource : datasourceResources) {
            if (datasourceResource.getResourceKey().equals(createResourceResponse.getResourceKey())) {
                datasourceTestResource = datasourceResource;
                break;
            }
        }
        assertNotNull(datasourceTestResource, getTestDatasourceName() + " was not discovered");
View Full Code Here

        request.setPluginName(PLUGIN_NAME);
        request.setResourceConfiguration(createResConfig);
        request.setResourceName(TEST_DOMAIN);
        request.setResourceTypeName(SECURITY_DOMAIN_RESOURCE_TYPE);

        CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
            request);

        assert response.getStatus() == CreateResourceStatus.SUCCESS : "The Security Domain creation failed with an error mesasge: "
            + response.getErrorMessage();
    }
View Full Code Here

        request.setResourceConfiguration(createResConfig);
        request.setResourceName("Test - notUsed.");

        request.setResourceTypeName(AUTH_CLASSIC_RESOURCE_TYPE);

        CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
            request);

        assert response.getStatus() == CreateResourceStatus.SUCCESS : "The 'Authentication (Classic)' node creation failed with an error mesasge: "
            + response.getErrorMessage();
    }
View Full Code Here

        request.setPluginName(PLUGIN_NAME);
        request.setResourceConfiguration(deploymentConfig);
        request.setResourceName(packageDetails.getName());
        request.setResourceTypeName("Deployment");

        CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
            request);

        assertEquals(response.getStatus(), CreateResourceStatus.SUCCESS,
            "The deployment failed with an error mesasge: " + response.getErrorMessage());

        deployment = waitForResourceByTypeAndKey(platform, standaloneServer, new ResourceType("Deployment",
            PLUGIN_NAME, ResourceCategory.SERVICE, null), "deployment=" + packageDetails.getName());
        // these tests depend on the deployment children to be in inventory, make sure they are
        waitForAsyncDiscoveryToStabilize(deployment, 5000L, 10);
View Full Code Here

        request.setPluginName(PLUGIN_NAME);
        request.setResourceConfiguration(deploymentConfig);
        request.setResourceName(TestDeployments.DEPLOYMENT_1.getResourceKey());
        request.setResourceTypeName("Deployment");

        CreateResourceResponse response = pluginContainer.getResourceFactoryManager().executeCreateResourceImmediately(
            request);

        assert response.getStatus() == CreateResourceStatus.SUCCESS : "The deployment failed with an error mesasge: "
            + response.getErrorMessage();

        Resource deployment = waitForResourceByTypeAndKey(platform, serverResource, new ResourceType("Deployment",
            PLUGIN_NAME, ResourceCategory.SERVICE, null), "deployment=" + TestDeployments.DEPLOYMENT_1.getResourceKey());
        // these tests may depend on the deployment children to be in inventory, make sure they are
        waitForAsyncDiscoveryToStabilize(deployment, 5000L, 10);
View Full Code Here

TOP

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

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.