本文整理汇总了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);
}