use of org.pentaho.di.core.exception.IdNotFoundException in project pentaho-kettle by pentaho.
the class JobMeta method lookupRepositoryReferences.
/**
* Look up the references after import
*
* @param repository the repository to reference.
*/
public void lookupRepositoryReferences(Repository repository) throws KettleException {
KettleException lastThrownException = null;
Map<String, RepositoryObjectType> notFoundedReferences = new HashMap<>();
for (JobEntryCopy copy : jobcopies) {
if (copy.getEntry().hasRepositoryReferences()) {
try {
copy.getEntry().lookupRepositoryReferences(repository);
} catch (IdNotFoundException e) {
lastThrownException = e;
String path = e.getPathToObject();
String name = e.getObjectName();
String key = StringUtils.isEmpty(path) || path.equals("null") ? name : path + "/" + name;
notFoundedReferences.put(key, e.getObjectType());
}
}
}
if (lastThrownException != null && !notFoundedReferences.isEmpty()) {
throw new LookupReferencesException(lastThrownException, notFoundedReferences);
}
}
Aggregations