Skip to content
Snippets Groups Projects
Commit c61ac123 authored by Jan Kožusznik's avatar Jan Kožusznik
Browse files

show creation time

parent 02bc491a
No related branches found
No related tags found
No related merge requests found
......@@ -140,6 +140,10 @@ public class Job {
return jobInfo.getStartTime();
}
public Calendar getCreationTime() {
return jobInfo.getCreationTime();
}
public Calendar getEndTime() {
return jobInfo.getEndTime();
}
......
......@@ -3,6 +3,7 @@ package cz.it4i.fiji.haas;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Calendar;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;
......@@ -91,14 +92,19 @@ public class JobManager {
return job.needsDownload();
}
public String getCreationTime() {
return getStringFromTimeSafely(job.getCreationTime());
}
public String getStartTime() {
return job.getStartTime().getTime().toString();
return getStringFromTimeSafely(job.getStartTime());
}
public String getEndTime() {
return job.getEndTime() != null ? job.getEndTime().getTime().toString() : "N/A";
return getStringFromTimeSafely(job.getEndTime());
}
public void downloadData(Progress progress) {
job.download(progress);
fireValueChangedEvent();
......@@ -112,5 +118,10 @@ public class JobManager {
public JobInfo getValue() {
return this;
}
private String getStringFromTimeSafely(Calendar time) {
return time!= null ? time.getTime().toString() : "N/A";
}
}
}
......@@ -4,14 +4,15 @@
<?import javafx.scene.control.TableView?>
<?import javafx.scene.layout.BorderPane?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="730.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="cz.it4i.fiji.haas.ui.CheckStatusOfHaaSController">
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="912.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="cz.it4i.fiji.haas.ui.CheckStatusOfHaaSController">
<center>
<TableView fx:id="jobs" prefHeight="445.0" prefWidth="623.0" BorderPane.alignment="CENTER">
<TableView fx:id="jobs" prefHeight="400.0" prefWidth="675.0" BorderPane.alignment="CENTER">
<columns>
<TableColumn prefWidth="75.0" text="Job Id" />
<TableColumn prefWidth="192.0" text="Status" />
<TableColumn prefWidth="227.0" text="Start time" />
<TableColumn prefWidth="235.0" text="End Time" />
<TableColumn prefWidth="149.0" text="Status" />
<TableColumn prefWidth="230.0" text="Creation time" />
<TableColumn prefWidth="230.0" text="Start time" />
<TableColumn prefWidth="230.0" text="End Time" />
</columns>
</TableView>
</center>
......
......@@ -74,8 +74,9 @@ public class CheckStatusOfHaaSController {
private void initTable() {
setCellValueFactory(0, j -> j.getId().toString());
setCellValueFactory(1, j -> j.getState().toString() + (j.needsDownload() ? " - needs download" : ""));
setCellValueFactory(2, j -> j.getStartTime().toString());
setCellValueFactory(3, j -> j.getEndTime().toString());
setCellValueFactory(2, j -> j.getCreationTime().toString());
setCellValueFactory(3, j -> j.getStartTime().toString());
setCellValueFactory(4, j -> j.getEndTime().toString());
}
@SuppressWarnings("unchecked")
......
......@@ -6,6 +6,7 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.rmi.RemoteException;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
......@@ -206,6 +207,10 @@ public class HaaSClient {
public java.util.Calendar getEndTime() {
return info.getEndTime();
};
public Calendar getCreationTime() {
return info.getCreationTime();
};
};
} catch (RemoteException | ServiceException e) {
throw new HaaSClientException(e);
......
......@@ -13,4 +13,6 @@ public interface JobInfo {
Calendar getStartTime();
Calendar getEndTime();
Calendar getCreationTime();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment