/* * TaskInspector.java */ package org.ngbw.utils; import java.io.IOException; import java.sql.SQLException; import org.ngbw.sdk.database.ConnectionManager; import org.ngbw.sdk.database.DriverConnectionSource; import org.ngbw.sdk.database.RunningTask; /** * * @author * */ public class RunningTaskInspector { public static void inspect(long id) throws IOException, SQLException { RunningTask inspected = new RunningTask(id); if (inspected == null) { System.err.println("Couldn't find a running task with that id"); return; } inspect(inspected); } public static void inspect(RunningTask inspected) throws IOException, SQLException { System.out.println("JobHandle: " + inspected.getJobhandle()); System.out.println("WorkingDir: " + inspected.getWorkspace()); System.out.println("OutputDesc: " + inspected.getOutputDesc()); } public static void main(String[] args) { try { if (args.length != 1) throw new Exception("usage: RunningTask id "); ConnectionManager.setConnectionSource(new DriverConnectionSource()); long id; try { id = Long.parseLong(args[0]); inspect(id); } catch (NumberFormatException formatErr) { System.err.println("Couldn't parse that id"); System.exit(0); } } catch (Exception err) { err.printStackTrace(System.err); System.exit(-1); } } }