Package org.rhq.core.domain.resource

Examples of org.rhq.core.domain.resource.ImportResourceResponse


    }

    @Override
    public ImportResourceResponse manuallyAddResource(ImportResourceRequest request) throws RuntimeException {
        try {
            ImportResourceResponse result = discoveryBoss.manuallyAddResource(getSessionSubject(), request);
            return SerialUtility.prepare(result, "ResourceService.manuallyAddResource");
        } catch (Throwable t) {
            if (t instanceof CannotConnectToAgentException) {
                throw (CannotConnectToAgentException) t;
            }
View Full Code Here


        }

        Resource resource = resourceManager.getResourceById(subject, mergeResourceResponse.getResourceId());
        boolean resourceAlreadyExisted = mergeResourceResponse.resourceAlreadyExisted();

        return new ImportResourceResponse(resource, resourceAlreadyExisted);
    }
View Full Code Here

        lookupConfiguration();
        return OUTCOME_SUCCESS;
    }

    public String addResource() {
        ImportResourceResponse response = null;
        ImportResourceRequest request = new ImportResourceRequest(getType().getId(), EnterpriseFacesContextUtility
            .getResource().getId(), getConfiguration());
        try {
            response = discoveryBoss.manuallyAddResource(EnterpriseFacesContextUtility.getSubject(), request);
        } catch (InvalidPluginConfigurationClientException e) {
            FacesContextUtility
                .addMessage(
                    FacesMessage.SEVERITY_ERROR,
                    "The Agent was unable to connect to the "
                        + getType()
                        + " managed resource using the supplied connection properties. Please check that the connection properties are correct and that the managed resource on the agent machine is online. ",
                    e);
        } catch (PluginContainerException e) {
            FacesContextUtility
                .addMessage(FacesMessage.SEVERITY_FATAL, "An unexpected error occurred in the Agent.", e);
        } catch (RuntimeException e) {
            FacesContextUtility.addMessage(FacesMessage.SEVERITY_FATAL, "Unable to connect to the Agent.", e);
        }

        String outcome;
        if (response == null) {
            outcome = OUTCOME_FAILURE;
        } else {
            Resource resource = LookupUtil.getResourceManager().getResourceById(
                EnterpriseFacesContextUtility.getSubject(), response.getResource().getId());
            if (response.isResourceAlreadyExisted()) {
                FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, "A " + getType().getName()
                    + " with the specified connection properties was already in inventory.");
            } else {
                FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "A " + getType().getName()
                    + " has been added to inventory with the name '" + resource.getName() + "'.");
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.ImportResourceResponse

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.