basic VamsasSession gui bits.
[jalview.git] / src / jalview / io / VamsasClient.java
1 /**
2  * 
3  */
4 package jalview.io;
5
6 import jalview.bin.Cache;
7 import jalview.gui.Desktop;
8
9 import org.vamsas.client.UserHandle;
10 import org.vamsas.client.simpleclient.FileWatcher;
11 import org.vamsas.client.simpleclient.VamsasArchive;
12 import org.vamsas.client.simpleclient.VamsasFile;
13 import org.vamsas.test.simpleclient.ArchiveClient;
14
15 /**
16  * @author jimp
17  *
18  */
19 public class VamsasClient extends ArchiveClient {
20         Desktop us;
21         public VamsasClient(Desktop jdesktop,
22                         String sessionPath) {
23                 super("Jalview User", "Dundee", // new org.vamsas.client.ClientHandle("jalview","2.7"),
24                                 sessionPath);
25                 us=jdesktop;
26         }
27         public void initial_update() {
28                 Cache.log.info("Jalview loading the Vamsas Session.");
29                 // load in the vamsas archive for the first time
30                 
31                 // VamsasArchive doc = new VamsasArchive();
32         }
33         public void get_update(VamsasArchive doc) {
34                 Cache.log.info("Jalview updating from Vamsas Session.");
35         }
36         public void push_update() {
37                 // collect all uncached alignments and put them into the vamsas dataset.
38                 // store them.
39                 Cache.log.info("Jalview updating the Vamsas Session.");
40         }
41         public void end_session() {
42                 // stop any update/watcher thread.
43                 Cache.log.info("Jalview disconnecting from the Vamsas Session.");
44         }
45         protected class VamsasClientWatcher extends Thread implements Runnable {
46                 /* (non-Javadoc)
47                  * @see java.lang.Thread#run()
48                  */
49                 VamsasClient client=null;
50                 VamsasClientWatcher(VamsasClient client) {
51                         this.client = client;
52                 }
53                 public void run() {
54                         VamsasArchive docio = client.watch(0);
55                         client.get_update(docio);
56                 }
57                 
58         }
59         /**
60          * @param args
61          */
62         public static void main(String[] args) {
63                 // TODO Auto-generated method stub
64
65         }
66
67 }