public void backupWorkspace(final String workspaceId,final String srcPath,final String srcAddress) throws ServerException {
  ReentrantLock lock=workspacesBackupLocks.get(workspaceId);
  if (lock != null) {
    if (lock.tryLock()) {
      try {
        if (workspacesBackupLocks.get(workspaceId) == null) {
          return;
        }
        backupWorkspace(workspaceId,srcPath,srcAddress,false);
      }
  finally {
        lock.unlock();
      }
    }
  }
 else {
    LOG.warn("Attempt to backup workspace {} after cleanup",workspaceId);
  }
}

public void backupWorkspace ( final String workspaceId , final String srcPath , final String srcAddress ) throws ServerException { ReentrantLock lock = workspacesBackupLocks . get ( workspaceId ) ; if ( lock != null ) { if ( lock . tryLock ( ) ) { try { if ( workspacesBackupLocks . get ( workspaceId ) == null ) { return ; } backupWorkspace ( workspaceId , srcPath , srcAddress , false ) ; } finally { lock . unlock ( ) ; } } } else { LOG . warn ( "Attempt to backup workspace {} after cleanup" , workspaceId ) ; } }
copies workspace files from machine ' s host to backup storage .
