Examples of ResourceOperationSchedule


Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

    }

    public void scheduleResourceOperation(int resourceId, String operationName, Configuration parameters,
        String description, int timeout) throws RuntimeException {
        try {
            ResourceOperationSchedule opSchedule = operationManager.scheduleResourceOperation(getSessionSubject(),
                resourceId, operationName, 0, 0, 0, 0, parameters, description);
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
    }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

    }

    public void scheduleResourceOperation(int resourceId, String operationName, Configuration parameters,
        String description, int timeout, String cronString) throws RuntimeException {
        try {
            ResourceOperationSchedule opSchedule = operationManager.scheduleResourceOperationUsingCron(
                getSessionSubject(), resourceId, operationName, cronString, timeout, parameters, description);
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
    }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

        }
    }

    public ResourceOperationSchedule getResourceOperationSchedule(int scheduleId) throws RuntimeException {
        try {
            ResourceOperationSchedule resourceOperationSchedule = operationManager.getResourceOperationSchedule(
                getSessionSubject(), scheduleId);
            return SerialUtility.prepare(resourceOperationSchedule, "getResourceOperationSchedule");
        } catch (Throwable t) {
            throw getExceptionToThrowToClient(t);
        }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

        }

        if (operation.isReadyToSubmit()) {

            // submit
            ResourceOperationSchedule sched = opsManager.scheduleResourceOperation(caller,operation.getResourceId(),operation.getName(),0,0,0,-1,
                    parameters,"Test");
            JobId jobId = new JobId(sched.getJobName(),sched.getJobGroup());
            UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
            uriBuilder.path("/operation/history/{id}");
            URI uri = uriBuilder.build(jobId);
            Link histLink = new Link("history",uri.toString());
            operation.addLink(histLink);
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

    public void setSelectedOperationSchedule(OperationSchedule selectedOperationSchedule) {
        this.selectedOperationSchedule = selectedOperationSchedule;
    }

    public String selectScheduleToView() {
        ResourceOperationSchedule operationSchedule = (ResourceOperationSchedule) FacesContextUtility.getRequest()
            .getAttribute("item");
        setSelectedOperationSchedule(operationSchedule);
        return "success";
    }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

        }

        SchedulerLocal scheduler = LookupUtil.getSchedulerBean();

        for (String jobIdString : selectedItems) {
            ResourceOperationSchedule resourceSchedule;
            try {
                resourceSchedule = manager.getResourceOperationSchedule(subject, jobIdString);
            } catch (SchedulerException se) {
                throw new IllegalStateException(se.getMessage(), se);
            }

            JobDetail jobDetail = scheduler.getJobDetail(resourceSchedule.getJobName(), resourceSchedule.getJobGroup());
            scheduleOperation(subject, resourceSchedule.getOperationName(), resourceSchedule.getParameters(),
                (SimpleTrigger) QuartzUtil.getFireOnceImmediateTrigger(jobDetail), resourceSchedule.getDescription());
        }

        return "viewOperationHistory";
    }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

     * currently call back into {@link StorageNodeOperationsHandlerBean#handleOperationUpdateIfNecessary(OperationHistory)}.
     * This runs the risk of locking if called inside an existing transaction.
     */
    private void scheduleOperation(Subject subject, StorageNode storageNode, Configuration parameters,
        String operation, int timeout) {
        ResourceOperationSchedule schedule = new ResourceOperationSchedule();
        schedule.setResource(storageNode.getResource());
        schedule.setJobTrigger(JobTrigger.createNowTrigger());
        schedule.setSubject(subject);
        schedule.setOperationName(operation);
        parameters.setSimpleValue(OperationDefinition.TIMEOUT_PARAM_NAME, Integer.toString(timeout));
        schedule.setParameters(parameters);

        operationManager.scheduleResourceOperation(subject, schedule);

    }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

        Configuration parameters, long operationQueryTimeout, int maxIterations) {

        //scheduling the operation
        long operationStartTime = System.currentTimeMillis();

        ResourceOperationSchedule newSchedule = new ResourceOperationSchedule();
        newSchedule.setJobTrigger(JobTrigger.createNowTrigger());
        newSchedule.setResource(storageNodeResource);
        newSchedule.setOperationName(operationToRun);
        newSchedule.setDescription("Run by StorageNodeManagerBean");
        newSchedule.setParameters(parameters);

        storageNodeManager.scheduleOperationInNewTransaction(subject, newSchedule);

        //waiting for the operation result then return it
        int iteration = 0;
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

            if (rs != null && rs.getEnabled().booleanValue()) {
                Configuration parameters = Configuration.builder().addSimple("retentionStrategy", rs.getRetention())
                    .addSimple("count", rs.getCount()).addSimple("deletionStrategy", rs.getDeletion())
                    .addSimple("location", rs.getLocation()).build();

                ResourceOperationSchedule schedule = operationManager.scheduleResourceOperationUsingCron(subject,
                    resource.getId(), "takeSnapshot",
                    rs.getSchedule(), 0, parameters, REGULAR_SNAPSHOTS_SCHEDULE_DESCRIPTION);
                if (log.isDebugEnabled()) {
                    log.debug("Created new " + schedule);
                }
View Full Code Here

Examples of org.rhq.core.domain.operation.bean.ResourceOperationSchedule

            // now create detail composites from the resource list
            List<ResourceOperationDetailsComposite> resourceComposites = new ArrayList<ResourceOperationDetailsComposite>();
            getUserWithSession(user, true); // refresh our session to reset the timeout clock
            for (Resource nextResourceToOperateOn : resourcesToOperateOn) {
                // create the non-quartz schedule entity for the given job execution context data
                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
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.