Examples of ResourceOperationHistory


Examples of org.rhq.core.domain.operation.ResourceOperationHistory

        ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
        JobId jobId = new JobId(jobName);
        criteria.addFilterJobId(jobId);

        ResourceOperationHistory history ;//= opsManager.getOperationHistoryByJobId(caller,jobName);
        List<ResourceOperationHistory> list = opsManager.findResourceOperationHistoriesByCriteria(caller,criteria);
        if (list==null || list.isEmpty()) {
            log.info("No history with id " + jobId + " found");
            throw new StuffNotFoundException("OperationHistory with id " + jobId);
        }

        history = list.get(0);
        OperationHistoryRest hist = historyToHistoryRest(history, uriInfo);
        Response.ResponseBuilder builder;
        if (mediaType.equals(MediaType.TEXT_HTML_TYPE)) {
            builder = Response.ok(renderTemplate("operationHistory.ftl",hist));
        } else {
            builder = Response.ok(hist);
        }
        if (history.getStatus()== OperationRequestStatus.SUCCESS) {
            // add a long time cache header
            CacheControl cc = new CacheControl();
            cc.setMaxAge(1200);
            builder.cacheControl(cc);
        }
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

        criteria.clearPaging();//disable paging as the code assumes all the results will be returned.

        List<ResourceOperationHistory> list = opsManager.findResourceOperationHistoriesByCriteria(caller,criteria);
        if ((list != null && !list.isEmpty())) {

            ResourceOperationHistory history = list.get(0);
            opsManager.deleteOperationHistory(caller,history.getId(),false);
        }
        else {
            if (validate) {
                throw new StuffNotFoundException("Job with id " + jobName);
            }
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

    public void handleOperationUpdateIfNecessary(OperationHistory operationHistory) {
        if (!(operationHistory instanceof ResourceOperationHistory)) {
            return;
        }

        ResourceOperationHistory resourceOperationHistory = (ResourceOperationHistory) operationHistory;
        if (!isStorageNodeOperation(resourceOperationHistory)) {
            return;
        }

        if (resourceOperationHistory.getOperationDefinition().getName().equals("announce")) {
            try {
                storageNodeOperationsHandler.handleAnnounce(resourceOperationHistory);
            } catch (Exception e) {
                String msg = "Aborting storage node deployment due to unexpected error while announcing cluster nodes.";
                logError(resourceOperationHistory, msg, e);
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

                ResourceOperationSchedule resourceSchedule = createScheduleForResource(schedule, jobDetail.getGroup(),
                    user, nextResourceToOperateOn);

                // create the resource-level history entity for the newly created non-quartz schedule entity
                // this method also does the persisting
                ResourceOperationHistory resourceHistory = createOperationHistory(resourceSchedule.getJobName(),
                    resourceSchedule.getJobGroup(), resourceSchedule, groupHistory, operationManager);

                // add all three elements to the composite, which will be iterated over below for the bulk of the work
                resourceComposites.add(new ResourceOperationDetailsComposite(nextResourceToOperateOn, resourceHistory,
                    resourceSchedule));
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

        // Add the id of the entity bean, so we can easily map the Quartz job to the associated entity bean.
        jobDataMap.put(OperationJob.DATAMAP_INT_ENTITY_ID, String.valueOf(schedule.getId()));

        // Create an IN_PROGRESS item
        // - we need a copy of parameters to avoid constraint violations upon delete
        ResourceOperationHistory history;
        history = new ResourceOperationHistory(uniqueJobId, jobGroupName, subject.getName(), opDef,
            (parameters == null ? null : parameters.deepCopy(false)), schedule.getResource(), null);

        updateOperationHistory(subject, history);

        // Now actually schedule it.
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

        if (history.getParameters() != null) {
            history.getParameters().getId(); // eagerly load it
        }

        if (history instanceof ResourceOperationHistory) {
            ResourceOperationHistory resourceHistory = (ResourceOperationHistory) history;
            if (resourceHistory.getResults() != null) {
                resourceHistory.getResults().getId(); // eagerly load it
            }
        }

        ensureViewPermission(subject, history);
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

        List<ResourceOperationHistory> list = query.getResultList();

        // don't bother checking permission if there is nothing to see (we wouldn't have the group even if we wanted to)
        // if there is at least one history - get its group and make sure the user has permissions to see
        if ((list != null) && (list.size() > 0)) {
            ResourceOperationHistory resourceHistory = list.get(0);
            ensureViewPermission(subject, resourceHistory);
        }

        PageList<ResourceOperationHistory> pageList;
        pageList = new PageList<ResourceOperationHistory>(list, (int) totalCount, pc);
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

        List<ResourceOperationHistory> list = query.getResultList();

        // don't bother checking permission if there is nothing to see (we wouldn't have the group even if we wanted to)
        // if there is at least one history - get its group and make sure the user has permissions to see
        if ((list != null) && (list.size() > 0)) {
            ResourceOperationHistory resourceHistory = list.get(0);
            ensureViewPermission(subject, resourceHistory);
        }

        PageList<ResourceOperationHistory> pageList;
        pageList = new PageList<ResourceOperationHistory>(list, (int) totalCount, pc);
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

    public ResourceOperationHistory getLatestCompletedResourceOperation(Subject subject, int resourceId) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Getting latest completed operation for resource [" + resourceId + "]");
        }

        ResourceOperationHistory result;

        // get the latest operation known to the server (i.e. persisted in the DB)
        try {
            Query query = entityManager
                .createNamedQuery(ResourceOperationHistory.QUERY_FIND_LATEST_COMPLETED_OPERATION);
View Full Code Here

Examples of org.rhq.core.domain.operation.ResourceOperationHistory

    public ResourceOperationHistory getOldestInProgressResourceOperation(Subject subject, int resourceId) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Getting oldest in-progress operation for resource [" + resourceId + "]");
        }

        ResourceOperationHistory result;

        // get the latest operation known to the server (i.e. persisted in the DB)
        try {
            Query query = entityManager
                .createNamedQuery(ResourceOperationHistory.QUERY_FIND_OLDEST_INPROGRESS_OPERATION);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.