public StringObjectId( ObjectId objectId ) { if ( objectId instanceof StringObjectId ) { this.id = ( (StringObjectId) objectId ).id; } else { this.id = objectId.getId(); } }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } ObjectId objectId = (ObjectId) obj; return id.equalsIgnoreCase( objectId.getId() ); }
@Override public void deleteClusterSchema( ObjectId id_cluster ) throws KettleException { // ID and filename are the same deleteFile( id_cluster.getId() ); }
public LongObjectId( ObjectId objectId ) { if ( objectId == null ) { this.id = -1L; // backward compatible } else { if ( objectId instanceof LongObjectId ) { this.id = ( (LongObjectId) objectId ).longValue(); } else { this.id = Long.valueOf( objectId.getId() ); } } }
private ObjectRevision getObjectRevision( final ObjectId elementId, final String versionId ) { readWriteLock.readLock().lock(); ObjectRevision result; try { result = createObjectRevision( pur.getVersionSummary( elementId.getId(), versionId ) ); } finally { readWriteLock.readLock().unlock(); } return result; }
protected void permanentlyDeleteSharedObject( final ObjectId id ) throws KettleException { try { readWriteLock.writeLock().lock(); try { pur.deleteFile( id.getId(), true, null ); } finally { readWriteLock.writeLock().unlock(); } } catch ( Exception e ) { throw new KettleException( "Unable to delete object with id [" + id + "]", e ); } }
@Override public void undeleteObject( final RepositoryElementMetaInterface element ) throws KettleException { readWriteLock.writeLock().lock(); try { pur.undeleteFile( element.getObjectId().getId(), null ); } finally { readWriteLock.writeLock().unlock(); } rootRef.clearRef(); }
@Override public void restoreJob( ObjectId id_job, String revision, String versionComment ) throws KettleException { unifiedRepository.restoreFileAtVersion( id_job.getId(), revision, versionComment ); rootRef.clearRef(); }
@Override public void restoreTransformation( ObjectId id_transformation, String revision, String versionComment ) throws KettleException { unifiedRepository.restoreFileAtVersion( id_transformation.getId(), revision, versionComment ); rootRef.clearRef(); }
public String getId() { if ( obj != null && obj.getObjectId() != null ) { return obj.getObjectId().getId(); } else { return null; } }
@Override public void deleteVersion( RepositoryElementInterface element, String versionId ) throws KettleException { String fileId = element.getObjectId().getId(); deleteVersion( fileId, versionId ); }
@Override public void undelete( final List<ObjectId> ids ) throws KettleException { for ( ObjectId id : ids ) { pur.undeleteFile( id.getId(), null ); } rootRef.clearRef(); }
@Override public void deleteVersionsBeforeDate( RepositoryElementInterface element, Date beforeDate ) throws KettleException { try { Serializable fileId = element.getObjectId().getId(); deleteVersionsBeforeDate( fileId, beforeDate ); } catch ( Exception e ) { processDeleteException( e ); } }
protected RepositoryLock getLockById( final ObjectId id ) throws KettleException { try { RepositoryFile file = pur.getFileById( id.getId() ); return getLock( file ); } catch ( Exception e ) { throw new KettleException( "Unable to get lock for object with id [" + id + "]", e ); } }
public RowMetaAndData getParameterMetaData( ObjectId... ids ) throws KettleException { RowMetaInterface parameterMeta = new RowMeta(); Object[] parameterData = new Object[ ids.length ]; for ( int i = 0; i < ids.length; i++ ) { parameterMeta.addValueMeta( new ValueMetaInteger( "id" + ( i + 1 ) ) ); parameterData[ i ] = Long.valueOf( ids[ i ].getId() ); } return new RowMetaAndData( parameterMeta, parameterData ); }
private boolean isJobOpened( String id, String path, String name ) { List<JobMeta> openedJobFiles = getSpoon().delegates.jobs.getJobList(); for ( JobMeta j : openedJobFiles ) { if ( j.getObjectId() != null && id.equals( j.getObjectId().getId() ) || ( path.equals( j.getRepositoryDirectory().getPath() ) && name.equals( j.getName() ) ) ) { return true; } } return false; }
private boolean isTransOpened( String id, String path, String name ) { List<TransMeta> openedTransFiles = getSpoon().delegates.trans.getTransformationList(); for ( TransMeta t : openedTransFiles ) { if ( t.getObjectId() != null && id.equals( t.getObjectId().getId() ) || ( path.equals( t.getRepositoryDirectory().getPath() ) && name.equals( t.getName() ) ) ) { return true; } } return false; }
public void saveDatabaseMetaJobEntryAttribute( ObjectId idJob, ObjectId idJobentry, int nr, String nameCode, String code, DatabaseMeta database ) throws KettleException { if ( database != null && database.getObjectId() != null ) { DataNodeRef ref = new DataNodeRef( database.getObjectId().getId() ); node.setProperty( code + PROP_CODE_NR_SEPARATOR + nr, ref ); } }