if ( jer != null ) { messageText.append( " : " ); if ( jer.getJobEntryName() != null ) { messageText.append( " : " ); messageText.append( jer.getJobEntryName() ); if ( jer.getResult() != null ) { messageText.append( " : " ); messageText.append( "[" + jer.getResult().toString() + "]" ); if ( jer.getReason() != null ) { messageText.append( " : " ); messageText.append( jer.getReason() ); if ( jer.getComment() != null ) { messageText.append( " : " ); messageText.append( jer.getComment() ); if ( jer.getLogDate() != null ) { messageText.append( " (" ); messageText.append( XMLHandler.date2string( jer.getLogDate() ) ); messageText.append( ')' );
@Override public int compare( JobEntryResult one, JobEntryResult two ) { if ( one == null && two != null ) { return -1; } if ( one != null && two == null ) { return 1; } if ( one == null && two == null ) { return 0; } if ( one.getJobEntryName() == null && two.getJobEntryName() != null ) { return -1; } if ( one.getJobEntryName() != null && two.getJobEntryName() == null ) { return 1; } if ( one.getJobEntryName() == null && two.getJobEntryName() == null ) { return 0; } int cmp = one.getJobEntryName().compareTo( two.getJobEntryName() ); if ( cmp != 0 ) { return cmp; } return Integer.valueOf( one.getJobEntryNr() ).compareTo( Integer.valueOf( two.getJobEntryNr() ) ); }
@Override public int compareTo( JobEntryResult two ) { return compare( this, two ); }
@Override public Exception call() throws Exception { Exception exception = null; try { for ( int i = 0; i < cycles; i++ ) { int id = idGenerator.getAndIncrement(); JobEntryResult result = new JobEntryResult(); result.setJobEntryName( String.format( resultNameTemplate, id ) ); result.setJobEntryNr( id ); JobTracker child = new JobTracker( mockJobMeta( "child-" + id ), result ); tracker.addJobTracker( child ); } } catch ( Exception e ) { exception = e; } return exception; } }
private void emergencyWriteJobTracker( Result res ) { JobEntryResult jerFinalResult = new JobEntryResult( res, this.getLogChannelId(), BaseMessages.getString( PKG, "Job.Comment.JobFinished" ), null, null, 0, null ); JobTracker finalTrack = new JobTracker( this.getJobMeta(), jerFinalResult ); // jobTracker is up to date too. this.jobTracker.addJobTracker( finalTrack ); }
Result result = jobEntryResult.getResult(); int iconX = ( x + iconsize ) - ( MINI_ICON_SIZE / 2 ); int iconY = y - ( MINI_ICON_SIZE / 2 ); if ( jobEntryResult.isCheckpoint() ) { gc.drawImage( EImage.CHECKPOINT, iconX, iconY, magnification ); areaOwners.add( new AreaOwner( AreaType.JOB_ENTRY_RESULT_CHECKPOINT, iconX, iconY, MINI_ICON_SIZE,
JobEntryResult jobEntryResult = (JobEntryResult) areaOwner.getOwner(); jobEntryCopy = (JobEntryCopy) areaOwner.getParent(); Result result = jobEntryResult.getResult(); tip.append( "'" ).append( jobEntryCopy.getName() ).append( "' " ); if ( result.getResult() ) {
new JobEntryResult( null, null, BaseMessages.getString( PKG, "Job.Comment.JobStarted" ), reason, jobEntryCopy .getName(), jobEntryCopy.getNr(), environmentSubstitute( jobEntryCopy.getEntry().getFilename() ) ); jobTracker.addJobTracker( new JobTracker( jobMeta, jerBefore ) ); new JobEntryResult( newResult, cloneJei.getLogChannel().getLogChannelId(), BaseMessages.getString( PKG, "Job.Comment.JobFinished" ), null, jobEntryCopy.getName(), jobEntryCopy.getNr(), environmentSubstitute( jobEntryCopy.getEntry().getFilename() ) );
result = jobEntryResult.getResult();
JobEntryResult result = jobTracker.getJobEntryResult(); if ( result != null ) { String jobEntryName = result.getJobEntryName(); if ( !Utils.isEmpty( jobEntryName ) ) { treeItem.setText( 0, jobEntryName ); treeItem.setText( 4, Const.NVL( result.getJobEntryFilename(), "" ) ); } else { treeItem.setText( 0, BaseMessages.getString( PKG, "JobLog.Tree.JobPrefix2" ) + jobTracker.getJobName() ); String comment = result.getComment(); if ( comment != null ) { treeItem.setText( 1, comment ); Result res = result.getResult(); if ( res != null ) { treeItem.setText( 2, res.getResult() String reason = result.getReason(); if ( reason != null ) { treeItem.setText( 3, reason ); Date logDate = result.getLogDate(); if ( logDate != null ) { treeItem.setText( 6, new SimpleDateFormat( "yyyy/MM/dd HH:mm:ss" ).format( logDate ) );
private JobEntryResult findJobEntryResult( JobEntryCopy jobEntryCopy ) { if ( jobEntryResults == null ) { return null; } Iterator<JobEntryResult> iterator = jobEntryResults.iterator(); while ( iterator.hasNext() ) { JobEntryResult jobEntryResult = iterator.next(); if ( jobEntryResult.getJobEntryName().equals( jobEntryCopy.getName() ) && jobEntryResult.getJobEntryNr() == jobEntryCopy.getNr() ) { return jobEntryResult; } } return null; }
new JobEntryResult( null, null, BaseMessages.getString( PKG, "Job.Comment.JobStarted" ), BaseMessages .getString( PKG, "Job.Reason.Started" ), null, 0, null ); jobTracker.addJobTracker( new JobTracker( jobMeta, jerStart ) ); new JobEntryResult( res, jes.getLogChannelId(), BaseMessages.getString( PKG, "Job.Comment.JobFinished" ), BaseMessages.getString( PKG, "Job.Reason.Finished" ), null, 0, null ); } else { res = execute( 0, res, startpoint, null, BaseMessages.getString( PKG, "Job.Reason.Started" ) ); jerEnd = new JobEntryResult( res, startpoint.getEntry().getLogChannel().getLogChannelId(), BaseMessages.getString( PKG, "Job.Comment.JobFinished" ), BaseMessages.getString( PKG, "Job.Reason.Finished" ), null, 0, null );
/** * Finds the JobTracker for the job entry specified. Use this to * * @param jobEntryCopy * The entry to search the job tracker for * @return The JobTracker of null if none could be found... */ public JobTracker findJobTracker( JobEntryCopy jobEntryCopy ) { if ( jobEntryCopy.getName() == null ) { return null; } lock.readLock().lock(); try { ListIterator<JobTracker> it = jobTrackers.listIterator( jobTrackers.size() ); while ( it.hasPrevious() ) { JobTracker tracker = it.previous(); JobEntryResult result = tracker.getJobEntryResult(); if ( result != null ) { if ( jobEntryCopy.getName().equals( result.getJobEntryName() ) && jobEntryCopy.getNr() == result.getJobEntryNr() ) { return tracker; } } } } finally { lock.readLock().unlock(); } return null; }
private static JobTracker createTracker( String jobEntryName, int jobEntryNr ) { JobMeta jobMeta = mock( JobMeta.class ); JobTracker jobTracker = new JobTracker( jobMeta ); if ( jobEntryName != null ) { JobEntryResult result = mock( JobEntryResult.class ); when( result.getJobEntryName() ).thenReturn( jobEntryName ); when( result.getJobEntryNr() ).thenReturn( jobEntryNr ); jobTracker.setJobEntryResult( result ); } return jobTracker; }