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

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


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

            // Submit the error as a failure response
            String errorMessage = ThrowableUtil.getAllMessages(e);
            DeleteResourceResponse response = new DeleteResourceResponse(persistedHistory.getId(),
                DeleteResourceStatus.FAILURE, errorMessage);
            resourceFactoryManager.completeDeleteResourceRequest(response);

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

            // Submit the error as a failure response
            String errorMessage = ThrowableUtil.getAllMessages(e);
            DeleteResourceResponse response = new DeleteResourceResponse(persistedHistory.getId(),
                DeleteResourceStatus.FAILURE, errorMessage);
            resourceFactoryManager.completeDeleteResourceRequest(response);

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


        } catch (Throwable t) {
            errorMessage = ThrowableUtil.getStackAsString(t);
            status = DeleteResourceStatus.FAILURE;
        }

        DeleteResourceResponse response = new DeleteResourceResponse(requestId, status, errorMessage);

        ResourceFactoryServerService serverService = resourceFactoryManager.getServerService();
        if (serverService != null) {
            try {
                serverService.completeDeleteResourceRequest(response);
View Full Code Here

        int resourceId = request.getResourceId();
        DeleteResourceFacet facet = getDeleteResourceFacet(resourceId);

        DeleteResourceRunner runner = new DeleteResourceRunner(this, facet, request.getRequestId(), resourceId);

        DeleteResourceResponse response;

        try {
            response = (DeleteResourceResponse) executor.submit((Callable) runner).get();
        } catch (Exception e) {
            throw new PluginContainerException("Error occurred in delete resource thread", e);
View Full Code Here

            ResourceFactoryManagerBeanTest.this.resourceFactoryManager.completeCreateResource(response);
        }

        public void deleteResource(DeleteResourceRequest request) throws PluginContainerException {
            DeleteResourceResponse response = null;

            switch (deleteReturnStatus) {
            case SUCCESS: {
                response = new DeleteResourceResponse(request.getRequestId(), deleteReturnStatus, null);
                break;
            }

            case FAILURE: {
                response = new DeleteResourceResponse(request.getRequestId(), deleteReturnStatus, "errorMessage");
                break;
            }
            }

            ResourceFactoryManagerBeanTest.this.resourceFactoryManager.completeDeleteResourceRequest(response);
View Full Code Here

        DeleteResourceRequest request = new DeleteResourceRequest();
        if (found != null) {
            request.setResourceId(found.getId());
        }
        DeleteResourceResponse response = pluginContainer.getResourceFactoryManager().executeDeleteResourceImmediately(
            request);

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

     *         etc)
     */
    public String removeResourceAction(@NotNull Resource resource)
    {
        log.debug("Removing Resource " + resource + "...");
        DeleteResourceResponse deleteResourceResponse = resourceManager.removeResource(resource);
        switch (deleteResourceResponse.getStatus())
        {
            case SUCCESS:
                facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO, "resource.status.remove.success",
                        resource.getResourceType().getName(), resource.getName());
                return FacesOutcomes.SUCCESS;
            default:
                String details = (deleteResourceResponse.getErrorMessage() != null) ?
                        deleteResourceResponse.getErrorMessage() : "Check server log for more details.";
                facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_ERROR, "resource.status.remove.failure",
                        resource.getResourceType().getName(), resource.getName(), details);
                return FacesOutcomes.FAILURE;
        }
    }
View Full Code Here

        return configuration;
    }

    public DeleteResourceResponse removeResource(Resource resource)
    {
        DeleteResourceResponse response;
        try
        {
            DeleteResourceRequest deleteRequest = new DeleteResourceRequest(1, resource.getId());
            response = getResourceFactoryService().executeDeleteResourceImmediately(deleteRequest);
            if (response.getStatus() == DeleteResourceStatus.SUCCESS)
            {
                discoverServicesSync();
            }
        }
        catch (PluginContainerException e)
View Full Code Here

TOP

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

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.