header updated
[jalview.git] / src / jalview / ws / WSClient.java
1 /*
2  * Jalview - A Sequence Alignment Editor and Viewer
3  * Copyright (C) 2006 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
18  */
19 package jalview.ws;
20
21 import jalview.gui.*;
22 import ext.vamsas.ServiceHandle;
23
24 public class WSClient
25 {
26   /**
27    * MsaWSClient
28    *
29    * @param msa SequenceI[]
30    */
31   protected String WebServiceName;
32   protected String WebServiceJobTitle;
33   protected String WebServiceReference;
34   protected String WsURL;
35   protected WebserviceInfo wsInfo;
36   int jobsRunning = 0;
37   /**
38    * mappings between abstract interface names and menu entries
39    */
40   protected java.util.Hashtable ServiceActions;
41   {
42       ServiceActions = new java.util.Hashtable();
43       ServiceActions.put("MsaWS", "Multiple Sequence Alignment");
44       ServiceActions.put("SecStrPred", "Secondary Structure Prediction");
45   };
46   public WSClient()
47   {
48   }
49
50   protected WebserviceInfo setWebService(ServiceHandle sh)
51   {
52     WebServiceName = sh.getName();
53     if (ServiceActions.containsKey(sh.getAbstractName()))
54     {
55       WebServiceJobTitle = sh.getName(); // TODO: control sh.Name specification properly
56       // add this for short names. +(String) ServiceActions.get(sh.getAbstractName());
57     }
58     else
59     {
60       WebServiceJobTitle = sh.getAbstractName()+" using "+sh.getName();
61
62     }
63     WebServiceReference = sh.getDescription();
64     WsURL = sh.getEndpointURL();
65     WebserviceInfo wsInfo = new WebserviceInfo(WebServiceJobTitle,
66                                                WebServiceReference);
67
68     return wsInfo;
69   }
70 }