Package org.rhq.core.domain.resource

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


    }

    @Override
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void deleteResourceError(Subject user, int resourceErrorId) {
        ResourceError error = entityManager.find(ResourceError.class, resourceErrorId);

        if (error != null) {
            if (!authorizationManager.hasResourcePermission(user, Permission.MODIFY_RESOURCE, error.getResource()
                .getId())) {
                throw new PermissionException("Cannot delete Resource error [" + resourceErrorId + "]. User [" + user
                    + "] does not have permission to modify Resource [" + error.getResource().getName() + "].");
            }

            entityManager.remove(error);
        }
    }
View Full Code Here


     * @return response to the upgrade request detailing what has been accepted on the server side
     */
    private ResourceUpgradeResponse upgradeResource(Resource resource, ResourceUpgradeRequest upgradeRequest,
        boolean allowGenericPropertiesUpgrade) {
        if (upgradeRequest.getUpgradeErrorMessage() != null) {
            ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
                upgradeRequest.getUpgradeErrorMessage(), upgradeRequest.getUpgradeErrorStackTrace(),
                upgradeRequest.getTimestamp());
            resourceManager.addResourceError(error);
            return null;
        }
View Full Code Here

        return configuration;
    }

    private void handlePluginConfiguratonUpdateRemoteException(Resource resource, String summary, String detail) {
        resource.setConnected(false);
        ResourceError invalidPluginConfigError = new ResourceError(resource,
            ResourceErrorType.INVALID_PLUGIN_CONFIGURATION, summary, detail, Calendar.getInstance().getTimeInMillis());
        this.resourceManager.addResourceError(invalidPluginConfigError);
    }
View Full Code Here

     */
    public boolean handleInvalidPluginConfigurationResourceError(Resource resource, Throwable t) {
        resource.setConnected(false); // invalid plugin configuration infers the resource component is disconnected
        // Give the server-side an error message describing the connection failure that can be
        // displayed on the resource's Inventory page.
        ResourceError resourceError = new ResourceError(resource, ResourceErrorType.INVALID_PLUGIN_CONFIGURATION,
            t.getLocalizedMessage(), ThrowableUtil.getStackAsString(t), System.currentTimeMillis());
        return sendResourceErrorToServer(resourceError);
    }
View Full Code Here

                    log.debug("During an inventory sync, the server gave us Resource [" + unknownResource
                        + "] but its type is disabled in the agent; skipping it...");
                }
                // report this so that the user knows to uninventory the dead resource
                String msg = "This resource should be uninventoried.  The agent has disabled this resource's type.  The resource is no longer being managed.";
                ResourceError resourceError = new ResourceError(unknownResource, ResourceErrorType.DISABLED_TYPE, msg,
                    msg, System.currentTimeMillis());
                sendResourceErrorToServer(resourceError);
            }
        }
View Full Code Here

                    }
                    if (traceEnabled) {
                        LOG.trace("Current availability is " + current + " for " + resource);
                    }
                } catch (Throwable t) {
                    ResourceError resourceError = new ResourceError(resource, ResourceErrorType.AVAILABILITY_CHECK,
                        t.getLocalizedMessage(), ThrowableUtil.getStackAsString(t), System.currentTimeMillis());
                    this.inventoryManager.sendResourceErrorToServer(resourceError);
                    LOG.warn("Availability collection failed with exception on " + resource
                        + ", availability will be reported as " + DOWN.name() + ", reason=" + t.getMessage());
                    current = DOWN;
View Full Code Here

            @Override
            public Void answer(InvocationOnMock invocation) throws Throwable {
                synchronized (FakeServerInventory.this) {
                    throwIfFailing();

                    ResourceError error = (ResourceError) invocation.getArguments()[0];

                    Resource serverSideResource = resourceStore.get(error.getResource().getUuid());

                    if (serverSideResource != null) {
                        List<ResourceError> currentErrors = serverSideResource.getResourceErrors();
                        currentErrors.add(error);
                    }
View Full Code Here

                                resource.setPluginConfiguration(request.getNewPluginConfiguration());
                                resp.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
                            }

                            if (request.getUpgradeErrorMessage() != null) {
                                ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
                                    request.getUpgradeErrorMessage(), request.getUpgradeErrorStackTrace(),
                                    request.getTimestamp());
                                resource.getResourceErrors().add(error);
                            }
View Full Code Here

        return new CustomAction("setResourceError") {
            public Object invoke(Invocation invocation) throws Throwable {
                synchronized (FakeServerInventory.this) {
                    throwIfFailing();

                    ResourceError error = (ResourceError) invocation.getParameter(0);

                    Resource serverSideResource = resourceStore.get(error.getResource().getUuid());

                    if (serverSideResource != null) {
                        List<ResourceError> currentErrors = serverSideResource.getResourceErrors();
                        currentErrors.add(error);
                    }
View Full Code Here

                                resource.setPluginConfiguration(request.getNewPluginConfiguration());
                                resp.setUpgradedResourcePluginConfiguration(resource.getPluginConfiguration());
                            }

                            if (request.getUpgradeErrorMessage() != null) {
                                ResourceError error = new ResourceError(resource, ResourceErrorType.UPGRADE,
                                    request.getUpgradeErrorMessage(), request.getUpgradeErrorStackTrace(),
                                    request.getTimestamp());
                                resource.addResourceError(error);
                            }
View Full Code Here

TOP

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

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.