Package org.rhq.core.domain.operation

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


        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


            @Context HttpHeaders httpHeaders) {

        MediaType mediaType = httpHeaders.getAcceptableMediaTypes().get(0);

        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()) {
View Full Code Here

    })
    public Response deleteOperationHistoryItem(@ApiParam("Name fo the submitted job") @PathParam("id") String jobName,
                                               @ApiParam("Validate if the job exists") @QueryParam("validate") @DefaultValue("false") boolean validate) {

        ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
        JobId filterJobId;
        try {
            filterJobId = new JobId(jobName);
        } catch (Exception e) {
            // jobName most likely did not match the expected format
            throw new BadArgumentException("jobName","Does not match the format for job history items");
        }
        criteria.addFilterJobId(filterJobId);
View Full Code Here

            }
        }

        String jobName = history.getJobName();
        String jobGroup = history.getJobGroup();
        JobId jobId = new JobId(jobName, jobGroup);
        hist.setJobId(jobId.toString());

        UriBuilder uriBuilder = uriInfo.getBaseUriBuilder();
        uriBuilder.path("/operation/history/{id}");
        URI url = uriBuilder.build(jobId);
        Link self = new Link("self",url.toString());
View Full Code Here

    @Override
    public ResourceOperationSchedule getResourceOperationSchedule(Subject subject, String jobId)
        throws SchedulerException {

        JobId jobIdObject = new JobId(jobId);
        JobDetail jobDetail = scheduler.getJobDetail(jobIdObject.getJobName(), jobIdObject.getJobGroup());
        ResourceOperationSchedule resourceOperationSchedule = getResourceOperationSchedule(subject, jobDetail);
        if (resourceOperationSchedule == null) {
            throw new SchedulerException("The job with ID [" + jobId + "] is no longer scheduled.");
        }
        return resourceOperationSchedule;
View Full Code Here

        return sched;
    }

    @Override
    public GroupOperationSchedule getGroupOperationSchedule(Subject subject, String jobId) throws SchedulerException {
        JobId jobIdObject = new JobId(jobId);
        JobDetail jobDetail = scheduler.getJobDetail(jobIdObject.getJobName(), jobIdObject.getJobGroup());
        GroupOperationSchedule groupOperationSchedule = getGroupOperationSchedule(subject, jobDetail);
        if (groupOperationSchedule == null) {
            throw new SchedulerException("The job with ID [" + jobId + "] is no longer scheduled.");
        }
        return groupOperationSchedule;
View Full Code Here

     * @return This returns all optional data and should be suitable for modification and subsequent update.
     */
    protected ResourceOperationHistory findOperationHistory(String name, String group,
        OperationManagerLocal operationManager, ResourceOperationSchedule schedule) {

        JobId jobId = new JobId(name, group);

        ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
        criteria.addFilterJobId(jobId);
        criteria.fetchOperationDefinition(true);
        criteria.fetchParameters(true);
View Full Code Here

        this.operationName = "(uninitialized)";
    }

    public OperationScheduleComposite(int id, String jobName, String jobGroup, String operationName, long operationNextFireTime) {
        this.id = id;
        this.jobId = new JobId(jobName, jobGroup);
        this.operationName = operationName;
        this.operationNextFireTime = operationNextFireTime;
    }
View Full Code Here

     *
     * @return job ID
     */
    @XmlElement
    public JobId getJobId() {
        return new JobId(this.jobName, this.jobGroup);
    }
View Full Code Here

  */
@Test
public class JobIdTest {

    public void testJobIdEquals() {
        JobId one;
        JobId two;

        one = new JobId("name", "group");
        assert one.equals(one);
        assert one.getJobName().equals("name");
        assert one.getJobGroup().equals("group");

        one = new JobId("name", "group");
        two = new JobId("name", "group");
        assert one != two;
        assert one.getJobName().equals(two.getJobName());
        assert one.getJobGroup().equals(two.getJobGroup());
        assert one.equals(two);
        assert one.hashCode() == two.hashCode();

        two = new JobId("nameX", "group");
        assert one != two;
        assert !one.equals(two);
        assert one.hashCode() != two.hashCode();

        two = new JobId("name", "groupX");
        assert one != two;
        assert !one.equals(two);
        assert one.hashCode() != two.hashCode();

        one = new JobId("nameX", "group");
        two = new JobId("name", "group");
        assert one != two;
        assert !one.equals(two);
        assert one.hashCode() != two.hashCode();

        one = new JobId("name", "groupX");
        assert one != two;
        assert !one.equals(two);
        assert one.hashCode() != two.hashCode();

        // cannot compare JobId with a HistoryJobId
        one = new HistoryJobId("name", "group", 1);
        two = new JobId("name", "group");
        assert one != two;
        assert !one.equals(two);
        assert one.hashCode() != two.hashCode();

        one = new JobId("name", "group");
        two = new HistoryJobId("name", "group", 1);
        assert one != two;
        assert !one.equals(two);
        assert one.hashCode() != two.hashCode();
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.operation.JobId

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.