JAL-3690 patch out need for java.time in j2s (see https://github.com/BobHanson/java2s...
[jalview.git] / src / jalview / ws / api / JobId.java
1 package jalview.ws.api;
2
3 import java.util.Date;
4
5 public class JobId
6 {
7   // TODO: JobId could include sequenceI anonymisation stuff
8   // TODO: getProgress() -> input stream to log file for job.
9   private String serviceType;
10
11   private String serviceImpl;
12
13   private String jobId;
14   // TODO: java2script instant
15   private String creationTime=null;
16
17   public JobId(String serviceType, String serviceImpl, String id)
18   {
19     this.serviceType = serviceType;
20     this.serviceImpl = serviceImpl;
21     jobId = id;
22     /*
23      * @j2sIgnore
24      */
25     {
26 //      creationTime = Date.from(Instant.now()).toString();
27     }
28     if (creationTime==null)
29     {
30       creationTime = new Date().toString(); // j2s only
31     }
32   }
33
34   @Override
35   public String toString()
36   {
37     return "" + serviceType + ":" + serviceImpl + ":" + jobId + "\nCreated "
38             + creationTime;
39   }
40   /**
41    * a stringified version of the Job Id that can be saved in project.
42    */
43   public String getURI()
44   {
45     return jobId;
46   }
47
48   public String getServiceType()
49   {
50     return serviceType;
51   }
52
53   public String getServiceImpl()
54   {
55     return serviceImpl;
56   }
57
58   public String getJobId()
59   {
60     return jobId;
61   }
62
63   public String getCreationTime()
64   {
65     return creationTime;
66   }
67 }