public void backupWorkspaceAndCleanup(final String workspaceId,final String srcPath,final String srcAddress) throws ServerException {
  ReentrantLock lock=workspacesBackupLocks.get(workspaceId);
  if (lock != null) {
    lock.lock();
    try {
      if (workspacesBackupLocks.get(workspaceId) == null) {
        LOG.error("Backup with cleanup of the workspace {} was invoked several times simultaneously",workspaceId);
        return;
      }
      backupWorkspace(workspaceId,srcPath,srcAddress,true);
    }
  finally {
      workspacesBackupLocks.remove(workspaceId);
      lock.unlock();
    }
  }
 else {
    LOG.warn("Attempt to backup workspace {} after cleanup",workspaceId);
  }
}

public void backupWorkspaceAndCleanup ( final String workspaceId , final String srcPath , final String srcAddress ) throws ServerException { ReentrantLock lock = workspacesBackupLocks . get ( workspaceId ) ; if ( lock != null ) { lock . lock ( ) ; try { if ( workspacesBackupLocks . get ( workspaceId ) == null ) { LOG . error ( "Backup with cleanup of the workspace {} was invoked several times simultaneously" , workspaceId ) ; return ; } backupWorkspace ( workspaceId , srcPath , srcAddress , true ) ; } finally { workspacesBackupLocks . remove ( workspaceId ) ; lock . unlock ( ) ; } } else { LOG . warn ( "Attempt to backup workspace {} after cleanup" , workspaceId ) ; } }
copies workspace files from machine ' s host to backup storage and remove all files from the source .
