JobManager { @POST @Path( "reserveId" ) @Produces( APPLICATION_JSON ) public Response reserveId() { final IPentahoSession session = PentahoSessionHolder.getSession(); final IJobIdGenerator iJobIdGenerator = PentahoSystem.get( IJobIdGenerator.class ); if ( session != null && iJobIdGenerator != null ) { final UUID reservedId = iJobIdGenerator.generateId( session ); return getJson( Collections.singletonMap( "reservedId", reservedId.toString() ) ); } else { return get404(); } } JobManager();  JobManager( final boolean isSupportAsync, final long pollingIntervalMilliseconds,
                     final long dialogThresholdMillisecond );  JobManager( final boolean isSupportAsync, final long pollingIntervalMilliseconds,
                     final long dialogThresholdMillisecond, final boolean promptForLocation ); @GET @Path( "config" ) @Produces( APPLICATION_JSON ) Response getConfig(); @GET @Path( "{job_id}/content" ) Response getPDFContent( @PathParam( "job_id" ) final String job_id ); @SuppressWarnings( "unchecked" ) @POST @Path( "{job_id}/content" ) Response getContent( @PathParam( "job_id" ) final String jobId ); @GET @Path( "{job_id}/status" ) @Produces( APPLICATION_JSON ) Response getStatus( @PathParam( "job_id" ) final String jobId ); @SuppressWarnings( "unchecked" ) @GET @Path( "{job_id}/cancel" ) Response cancel( @PathParam( "job_id" ) final String jobId ); @GET @Path( "{job_id}/requestPage/{page}" ) @Produces( TEXT_PLAIN ) Response requestPage( @PathParam( "job_id" ) final String jobId, @PathParam( "page" ) final int page ); @GET @Path( "{job_id}/schedule" ) @Produces( TEXT_PLAIN ) Response schedule( @PathParam( "job_id" ) final String jobId, @DefaultValue( "true" )
                            @QueryParam( "confirm" ) final boolean confirm ); @POST @Path( "{job_id}/schedule" ) @Produces( APPLICATION_JSON ) Response confirmSchedule( @PathParam( "job_id" ) final String jobId,
                                   @DefaultValue( "true" )
                                   @QueryParam( "confirm" ) final boolean confirm,
                                   @DefaultValue( "false" )
                                   @QueryParam( "recalculateFinished" ) final boolean recalculateFinished,
                                   @QueryParam( "folderId" ) final String folderId,
                                   @QueryParam( "newName" ) final String newName ); ExecutionContext getContext( final String jobId ); @POST @Path( "reserveId" ) @Produces( APPLICATION_JSON ) Response reserveId();  }
@Test public void testReserveId() throws Exception { setSession(); final JobManager jobManager = new JobManager( false, 1000, 1000 ); final Response response = jobManager.reserveId(); assertEquals( 200, response.getStatus() ); final ObjectMapper mapper = new ObjectMapper(); final JsonNode jsonNode = mapper.readTree( (String) response.getEntity() ); assertNotNull( jsonNode ); assertNotNull( jsonNode.get( "reservedId" ).asText() ); }