当前位置: 首页>>代码示例>>Java>>正文


Java Job.getJobname方法代码示例

本文整理汇总了Java中org.pentaho.di.job.Job.getJobname方法的典型用法代码示例。如果您正苦于以下问题:Java Job.getJobname方法的具体用法?Java Job.getJobname怎么用?Java Job.getJobname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.job.Job的用法示例。


在下文中一共展示了Job.getJobname方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addFileToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
	{	
		try
		{
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getJobname(), toString());
			result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
	    
			if(log.isDebug())
			{
				log.logDebug(toString()," ------ ");
				log.logDebug(toString(),Messages.getString("JobMoveFiles.Log.FileAddedToResultFilesName",fileaddentry));
			}
			
		}catch (Exception e)
		{
			log.logError(Messages.getString("JobMoveFiles.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
		}

}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:20,代码来源:JobEntryMoveFiles.java

示例2: addFileToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,Result result,Job parentJob)
	{	
		try
		{
			ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getJobname(), toString());
			result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
	    
			if(log.isDebug())
			{
				logDebug(" ------ ");
				logDebug(BaseMessages.getString(PKG, "JobMoveFiles.Log.FileAddedToResultFilesName",fileaddentry));
			}
			
		}catch (Exception e)
		{
			log.logError(BaseMessages.getString(PKG, "JobMoveFiles.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
		}

}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:20,代码来源:JobEntryMoveFiles.java

示例3: addFilenameToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFilenameToResultFilenames(Result result, Job parentJob, String newfile) throws Exception
{
	if (addfiletoresult)
 	{
		// Add file to result files name
		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL , KettleVFS.getFileObject(newfile), parentJob.getJobname(), toString());
		result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
 	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:10,代码来源:JobEntryUnZip.java

示例4: addFileToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
{	
	try{
		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getJobname(), toString());
		result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
    
		if(log.isDebug()){
			log.logDebug(toString()," ------ ");
			log.logDebug(toString(),Messages.getString("JobEntryMSAccessBulkLoad.Log.FileAddedToResultFilesName",fileaddentry));
		}
	}catch (Exception e){
		log.logError(Messages.getString("JobEntryMSAccessBulkLoad.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
	}
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:15,代码来源:JobEntryMSAccessBulkLoad.java

示例5: addFileToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFileToResultFilenames(String fileaddentry,LogWriter log,Result result,Job parentJob)
{	
	try
	{
		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry), parentJob.getJobname(), toString());
		result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
		if(log.isDebug()) log.logDebug(toString(),Messages.getString("JobExportRepository.Log.FileAddedToResultFilesName",fileaddentry));
	}catch (Exception e)
	{
		log.logError(Messages.getString("JobExportRepository.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
	}
  }
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:13,代码来源:JobEntryExportRepository.java

示例6: addFilenameToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFilenameToResultFilenames(Result result, Job parentJob, String newfile) throws Exception
{
	if (addfiletoresult)
 	{
		// Add file to result files name
		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL , KettleVFS.getFileObject(newfile, this), parentJob.getJobname(), toString());
		result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
 	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:10,代码来源:JobEntryUnZip.java

示例7: addFileToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFileToResultFilenames(String fileaddentry, Result result,Job parentJob)
{	
	try{
		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getJobname(), toString());
		result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
    
		if(log.isDebug()){
			logDebug(" ------ ");
			logDebug(BaseMessages.getString(PKG, "JobEntryMSAccessBulkLoad.Log.FileAddedToResultFilesName",fileaddentry));
		}
	}catch (Exception e){
		log.logError(BaseMessages.getString(PKG, "JobEntryMSAccessBulkLoad.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
	}
  }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:15,代码来源:JobEntryMSAccessBulkLoad.java

示例8: addFileToResultFilenames

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private void addFileToResultFilenames(String fileaddentry, LogChannelInterface log, Result result, Job parentJob)
{	
	try
	{
		ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(fileaddentry, this), parentJob.getJobname(), toString());
		result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
		if(log.isDebug()) logDebug(BaseMessages.getString(PKG, "JobExportRepository.Log.FileAddedToResultFilesName",fileaddentry));
	}catch (Exception e)
	{
		log.logError(BaseMessages.getString(PKG, "JobExportRepository.Error.AddingToFilenameResult"),fileaddentry + ""+e.getMessage());
	}
  }
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:13,代码来源:JobEntryExportRepository.java

示例9: ProcessFile

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private boolean ProcessFile(FileObject sourcefile,String destinationFolder,LogWriter log,Result result,Job parentJob) 
{
	boolean retval=false;
	boolean filexists=false;
	try
	{
		// return destination short filename
		String shortfilename=getDestinationFilename(sourcefile.getName().getBaseName());
		// build full destination filename
		String destinationFilename=destinationFolder+Const.FILE_SEPARATOR+shortfilename;
		FileObject destinationfile=KettleVFS.getFileObject(destinationFilename);
		filexists=destinationfile.exists();
		if(filexists)
		{
			if(log.isDetailed())
				log.logDetailed(toString(),Messages.getString("JobEntryCopyMoveResultFilenames.Log.FileExists",destinationFilename));
		}
		if((!filexists)  || (filexists && isOverwriteFile()))
		{
			if(getAction().equals("copy"))
			{
				// Copy file
				FileUtil.copyContent(sourcefile, destinationfile);
				if(log.isDetailed()) 
					log.logDetailed(toString(),Messages.getString("JobEntryCopyMoveResultFilenames.log.CopiedFile",sourcefile.toString(),destinationFolder));
			}else{
				// Move file
				sourcefile.moveTo(destinationfile);	
				if(log.isDetailed()) 
					log.logDetailed(toString(),Messages.getString("JobEntryCopyMoveResultFilenames.log.MovedFile",sourcefile.toString(),destinationFolder));
			}
			
			if(isRemovedSourceFilename())
			{
				// Remove source file from result files list
				result.getResultFiles().remove(sourcefile.toString());
				if(log.isDetailed())
					log.logDetailed(toString(),Messages.getString("JobEntryCopyMoveResultFilenames.RemovedFileFromResult",sourcefile.toString()));
			}
			if(isAddDestinationFilename())
			{
				// Add destination filename to Resultfilenames ...
				ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(destinationfile.toString()), parentJob.getJobname(), toString());
				result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
				if(log.isDetailed())
					log.logDetailed(toString(),Messages.getString("JobEntryCopyMoveResultFilenames.AddedFileToResult",destinationfile.toString()));
			}
		}
		retval=true;
	}catch(Exception e)
	{
		log.logError(toString(), Messages.getString("JobEntryCopyMoveResultFilenames.Log.ErrorProcessing", e.toString()));
	}
	
	return retval;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:57,代码来源:JobEntryCopyMoveResultFilenames.java

示例10: processFile

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
private boolean processFile(FileObject sourcefile,String destinationFolder,Result result,Job parentJob) 
{
	boolean retval=false;
	boolean filexists=false;
	try
	{
		// return destination short filename
		String shortfilename=getDestinationFilename(sourcefile.getName().getBaseName());
		// build full destination filename
		String destinationFilename=destinationFolder+Const.FILE_SEPARATOR+shortfilename;
		FileObject destinationfile=KettleVFS.getFileObject(destinationFilename, this);
		filexists=destinationfile.exists();
		if(filexists)
		{
			if(log.isDetailed())
				logDetailed(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.Log.FileExists",destinationFilename));
		}
		if((!filexists)  || (filexists && isOverwriteFile()))
		{
			if(getAction().equals("copy"))
			{
				// Copy file
				FileUtil.copyContent(sourcefile, destinationfile);
				if(log.isDetailed()) 
					logDetailed(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.log.CopiedFile",sourcefile.toString(),destinationFolder));
			}else{
				// Move file
				sourcefile.moveTo(destinationfile);	
				if(log.isDetailed()) 
					logDetailed(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.log.MovedFile",sourcefile.toString(),destinationFolder));
			}
			
			if(isRemovedSourceFilename())
			{
				// Remove source file from result files list
				result.getResultFiles().remove(sourcefile.toString());
				if(log.isDetailed())
					logDetailed(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.RemovedFileFromResult",sourcefile.toString()));
			}
			if(isAddDestinationFilename())
			{
				// Add destination filename to Resultfilenames ...
				ResultFile resultFile = new ResultFile(ResultFile.FILE_TYPE_GENERAL, KettleVFS.getFileObject(destinationfile.toString(), this), parentJob.getJobname(), toString());
				result.getResultFiles().put(resultFile.getFile().toString(), resultFile);
				if(log.isDetailed())
					logDetailed(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.AddedFileToResult",destinationfile.toString()));
			}
		}
		retval=true;
	}catch(Exception e)
	{
		logError(BaseMessages.getString(PKG, "JobEntryCopyMoveResultFilenames.Log.ErrorProcessing", e.toString()));
	}
	
	return retval;
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:57,代码来源:JobEntryCopyMoveResultFilenames.java

示例11: getLogRecord

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
 * This method calculates all the values that are required
 * @param id the id to use or -1 if no id is needed
 * @param status the log status to use
 */
public RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent) {
	if (subject==null || subject instanceof Job) {
		Job job = (Job) subject;
		Result result = null;
		if (job!=null) result = job.getResult();
		
		RowMetaAndData row = new RowMetaAndData();
		
		for (LogTableField field : fields) {
			if (field.isEnabled()) {
				Object value = null;
				if (job!=null) {
					
					switch(ID.valueOf(field.getId())){
					case ID_JOB : value = new Long(job.getBatchId()); break;
					case CHANNEL_ID : value = job.getLogChannelId(); break;
					case JOBNAME : value = job.getJobname(); break;
					case STATUS : value = status.getStatus(); break;
					case LINES_READ : value = result==null ? null : new Long(result.getNrLinesRead()); break;
					case LINES_WRITTEN : value = result==null ? null : new Long(result.getNrLinesWritten()); break;
					case LINES_INPUT : value = result==null ? null : new Long(result.getNrLinesInput()); break;
					case LINES_OUTPUT : value = result==null ? null : new Long(result.getNrLinesOutput()); break;
					case LINES_UPDATED : value = result==null ? null : new Long(result.getNrLinesUpdated()); break;
					case LINES_REJECTED : value = result==null ? null : new Long(result.getNrLinesRejected()); break;
					case ERRORS: value = result==null ? null : new Long(result.getNrErrors()); break;
					case STARTDATE: value = job.getStartDate(); break;
					case LOGDATE: value = job.getLogDate(); break;
					case ENDDATE: value = job.getEndDate(); break;
					case DEPDATE: value = job.getDepDate(); break;
					case REPLAYDATE: value = job.getCurrentDate(); break;
                       case LOG_FIELD: 
                         value = getLogBuffer(job, job.getLogChannelId(), status, logSizeLimit);
                         break;
					}
				}

				row.addValue(field.getFieldName(), field.getDataType(), value);
				row.getRowMeta().getValueMeta(row.size()-1).setLength(field.getLength());
			}
		}
			
		return row;
	}
	else {
		return null;
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:53,代码来源:JobLogTable.java

示例12: getLogRecord

import org.pentaho.di.job.Job; //导入方法依赖的package包/类
/**
 * This method calculates all the values that are required
 * @param id the id to use or -1 if no id is needed
 * @param status the log status to use
 * @param subject the object to log
 * @param parent the parent to which the object belongs
 */
public RowMetaAndData getLogRecord(LogStatus status, Object subject, Object parent) {
	if (subject==null || subject instanceof JobEntryCopy) {
		
		JobEntryCopy jobEntryCopy = (JobEntryCopy) subject; 
		Job parentJob = (Job) parent;
		
		RowMetaAndData row = new RowMetaAndData();
		
		for (LogTableField field : fields) {
			if (field.isEnabled()) {
				Object value = null;
				if (subject!=null) {
					
					JobEntryInterface jobEntry = jobEntryCopy.getEntry();
					JobTracker jobTracker = parentJob.getJobTracker();
					JobTracker entryTracker = jobTracker.findJobTracker(jobEntryCopy);
					JobEntryResult jobEntryResult = null;
					if (entryTracker!=null)  {
						jobEntryResult = entryTracker.getJobEntryResult();
					}
					Result result = null;
					if (jobEntryResult!=null) {
						result = jobEntryResult.getResult();
					}
					
					switch(ID.valueOf(field.getId())){
					
					case ID_BATCH : value = new Long(parentJob.getBatchId()); break;
					case CHANNEL_ID : value = jobEntry.getLogChannel().getLogChannelId(); break;
					case LOG_DATE : value = new Date(); break;
					case JOBNAME : value = parentJob.getJobname(); break;
					case JOBENTRYNAME : value = jobEntry.getName(); break;
					case LINES_READ : value = new Long(result!=null ? result.getNrLinesRead() : 0); break;
					case LINES_WRITTEN : value = new Long(result!=null ? result.getNrLinesWritten() : 0); break;
					case LINES_UPDATED : value = new Long(result!=null ? result.getNrLinesUpdated() : 0); break;
					case LINES_INPUT : value = new Long(result!=null ? result.getNrLinesInput() : 0); break;
					case LINES_OUTPUT : value = new Long(result!=null ? result.getNrLinesOutput() : 0); break;
					case LINES_REJECTED : value = new Long(result!=null ? result.getNrLinesRejected() : 0); break;
					case ERRORS : value = new Long(result!=null ? result.getNrErrors() : 0); break;
					case RESULT : value = new Boolean(result!=null ? result.getResult() : false); break;
					case NR_RESULT_FILES : value = new Long(result!=null && result.getResultFiles()!=null ? result.getResultFiles().size() : 0); break;
					case NR_RESULT_ROWS : value = new Long(result!=null && result.getRows()!=null ? result.getRows().size() : 0); break;
					case LOG_FIELD : 
					    if (result!=null) {
						   value = result.getLogText();
					    } 
				        break;
					case COPY_NR : value = new Long(jobEntryCopy.getNr()); break;
					}
				}

				row.addValue(field.getFieldName(), field.getDataType(), value);
				row.getRowMeta().getValueMeta(row.size()-1).setLength(field.getLength());
			}
		}
			
		return row;
	}
	else {
		return null;
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:70,代码来源:JobEntryLogTable.java


注:本文中的org.pentaho.di.job.Job.getJobname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。