本文整理匯總了Java中org.pentaho.di.repository.Repository.loadJob方法的典型用法代碼示例。如果您正苦於以下問題:Java Repository.loadJob方法的具體用法?Java Repository.loadJob怎麽用?Java Repository.loadJob使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.pentaho.di.repository.Repository
的用法示例。
在下文中一共展示了Repository.loadJob方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getJobMeta
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
public JobMeta getJobMeta(Repository rep, VariableSpace space) throws KettleException {
try {
switch(specificationMethod) {
case FILENAME:
return new JobMeta((space != null ? space.environmentSubstitute(getFilename()) : getFilename()), rep, null);
case REPOSITORY_BY_NAME:
if (rep != null) {
String realDirectory = environmentSubstitute(getDirectory());
RepositoryDirectoryInterface repositoryDirectory = rep.loadRepositoryDirectoryTree().findDirectory(realDirectory);
if (repositoryDirectory==null) {
throw new KettleException("Unable to find repository directory ["+Const.NVL(realDirectory, "")+"]");
}
return rep.loadJob((space != null ? space.environmentSubstitute(getJobName()) : getJobName()), repositoryDirectory, null, null); // reads
} else {
throw new KettleException("Could not execute job specified in a repository since we're not connected to one");
}
case REPOSITORY_BY_REFERENCE:
if (rep != null) {
// Load the last version...
//
return rep.loadJob(jobObjectId, null);
} else {
throw new KettleException("Could not execute job specified in a repository since we're not connected to one");
}
default:
throw new KettleException("The specified object location specification method '"+specificationMethod+"' is not yet supported in this job entry.");
}
} catch (Exception e) {
throw new KettleException("Unexpected error during job metadata load", e);
}
}
示例2: loadJob
import org.pentaho.di.repository.Repository; //導入方法依賴的package包/類
/**
* loadTrans:加載作業. <br/>
* @author jingma
* @param jobname 作業名稱
* @param directory 作業路徑
* @param repository 資源庫
* @return 作業元數據
* @throws KettleException
* @since JDK 1.6
*/
public static JobMeta loadJob(String jobname, String directory,Repository repository) throws KettleException {
RepositoryDirectoryInterface dir = repository.findDirectory(directory);
return repository.loadJob(jobname,dir,null, null);
}