@Override public ObjectId getJobId( final String name, final RepositoryDirectoryInterface repositoryDirectory ) throws KettleException { try { return getObjectId( name, repositoryDirectory, RepositoryObjectType.JOB, false ); } catch ( Exception e ) { String path = repositoryDirectory != null ? repositoryDirectory.toString() : "null"; throw new IdNotFoundException( "Unable to get ID for job [" + name + "]", e, name, path, RepositoryObjectType.JOB ); } }
/** * 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 ); } }
@Override public ObjectId getTransformationID( String name, RepositoryDirectoryInterface repositoryDirectory ) throws KettleException { try { return getObjectId( name, repositoryDirectory, RepositoryObjectType.TRANSFORMATION, false ); } catch ( Exception e ) { String path = repositoryDirectory != null ? repositoryDirectory.toString() : "null"; throw new IdNotFoundException( "Unable to get ID for job [" + name + "]", e, name, path, RepositoryObjectType.TRANSFORMATION ); } }