Package org.kie.workbench.common.services.shared.rest

Examples of org.kie.workbench.common.services.shared.rest.JobResult


        jobs = Collections.synchronizedMap( cache );
    }

    public void onUpateJobStatus( final @Observes JobResult jobResult ) {
        String jobId = jobResult.getJobId();
        JobResult job = jobs.get( jobId );

        if ( job == null ) {
            //the job has gone probably because its done and has been removed.
            logger.info( "-----onUpateJobStatus--- , can not find jobId:" + jobId + ", the job has gone probably because its done and has been removed." );
            return;
View Full Code Here


    @Produces(MediaType.APPLICATION_JSON)
    @Path("/jobs/{jobId}")
    public JobResult getJobStatus( @PathParam("jobId") String jobId ) {
        logger.info( "-----getJobStatus--- , jobId:" + jobId );

        JobResult job = jobs.get( jobId );

        if ( job == null ) {
            //the job has gone probably because its done and has been removed.
            logger.info( "-----getJobStatus--- , can not find jobId:" + jobId + ", the job has gone probably because its done and has been removed." );
            job = new JobResult();
            job.setStatus( JobStatus.GONE );
            return job;
        }

        return job;
    }
View Full Code Here

    @Produces(MediaType.APPLICATION_JSON)
    @Path("/jobs/{jobId}")
    public JobResult removeJob( @PathParam("jobId") String jobId ) {
        logger.info( "-----removeJob--- , jobId:" + jobId );

        JobResult job = jobs.get( jobId );

        if ( job == null ) {
            //the job has gone probably because its done and has been removed.
            logger.info( "-----removeJob--- , can not find jobId:" + jobId + ", the job has gone probably because its done and has been removed." );
            job = new JobResult();
            job.setStatus( JobStatus.GONE );
            return job;
        }

        jobs.remove( jobId );
        job.setStatus( JobStatus.GONE );
        return job;
    }
View Full Code Here

        CreateOrCloneRepositoryRequest jobRequest = new CreateOrCloneRepositoryRequest();
        jobRequest.setStatus( JobStatus.ACCEPTED );
        jobRequest.setJobId( id );
        jobRequest.setRepository( repository );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        createOrCloneJobRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

        RemoveRepositoryRequest jobRequest = new RemoveRepositoryRequest();
        jobRequest.setStatus( JobStatus.ACCEPTED );
        jobRequest.setJobId( id );
        jobRequest.setRepositoryName( repositoryName );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        removeRepositoryRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

        jobRequest.setJobId( id );
        jobRequest.setRepositoryName( repositoryName );
        jobRequest.setProjectName( project.getName() );
        jobRequest.setDescription( project.getDescription() );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        createProjectRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

        jobRequest.setStatus( JobStatus.ACCEPTED );
        jobRequest.setJobId( id );
        jobRequest.setRepositoryName( repositoryName );
        jobRequest.setProjectName( projectName );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        compileProjectRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

        jobRequest.setStatus( JobStatus.ACCEPTED );
        jobRequest.setJobId( id );
        jobRequest.setRepositoryName( repositoryName );
        jobRequest.setProjectName( projectName );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        installProjectRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

        jobRequest.setJobId( id );
        jobRequest.setRepositoryName( repositoryName );
        jobRequest.setProjectName( projectName );
        jobRequest.setBuildConfig( mavenConfig );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        testProjectRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

        jobRequest.setStatus( JobStatus.ACCEPTED );
        jobRequest.setJobId( id );
        jobRequest.setRepositoryName( repositoryName );
        jobRequest.setProjectName( projectName );

        JobResult jobResult = new JobResult();
        jobResult.setJobId( id );
        jobResult.setStatus( JobStatus.ACCEPTED );
        jobs.put( id, jobResult );

        deployProjectRequestEvent.fire( jobRequest );

        return jobRequest;
View Full Code Here

TOP

Related Classes of org.kie.workbench.common.services.shared.rest.JobResult

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.