@GET @Path( "/jobs" ) @Produces( { MediaType.APPLICATION_JSON } ) public List<CarteObjectEntry> getJobs() { List<CarteObjectEntry> jobEntries = CarteSingleton.getInstance().getJobMap().getJobObjects(); return jobEntries; }
@GET @Path( "/jobs/detailed" ) @Produces( { MediaType.APPLICATION_JSON } ) public List<JobStatus> getJobsDetails() { List<CarteObjectEntry> jobEntries = CarteSingleton.getInstance().getJobMap().getJobObjects(); List<JobStatus> details = new ArrayList<JobStatus>(); JobResource jobRes = new JobResource(); for ( CarteObjectEntry entry : jobEntries ) { details.add( jobRes.getJobStatus( entry.getId() ) ); } return details; }
public static CarteObjectEntry getCarteObjectEntry( String id ) { List<CarteObjectEntry> transList = CarteSingleton.getInstance().getTransformationMap().getTransformationObjects(); for ( CarteObjectEntry entry : transList ) { if ( entry.getId().equals( id ) ) { return entry; } } List<CarteObjectEntry> jobList = CarteSingleton.getInstance().getJobMap().getJobObjects(); for ( CarteObjectEntry entry : jobList ) { if ( entry.getId().equals( id ) ) { return entry; } } return null; }
@Override public Object doCall() throws Exception { while ( condition.get() ) { int i = random.nextInt( INITIAL_JOB_MAP_SIZE ); CarteObjectEntry entry = jobMap.getJobObjects().get( i ); if ( entry == null ) { throw new IllegalStateException( String.format( "Returned CarteObjectEntry must not be null. EntryId = %d", i ) ); } final String jobName = JOB_NAME_STRING + i; Job job = jobMap.getJob( entry.getName() ); if ( job == null ) { throw new IllegalStateException( String.format( "Returned job must not be null. Job name = %s", jobName ) ); } JobConfiguration jobConfiguration = jobMap.getConfiguration( entry.getName() ); if ( jobConfiguration == null ) { throw new IllegalStateException( String.format( "Returned jobConfiguration must not be null. Job name = %s", jobName ) ); } } return null; } }
List<CarteObjectEntry> jobEntries = getJobMap().getJobObjects();
for ( CarteObjectEntry entry : jobMap.getJobObjects() ) { Job job = jobMap.getJob( entry );