95e03c24a88b15073ce80d829e5bec9212e81d44
[jalview.git] / forester / java / src / org / forester / archaeopteryx / webservices / WebservicesManager.java
1 // $Id:
2 // forester -- software libraries and applications
3 // for evolutionary biology research and applications.
4 //
5 // Copyright (C) 2008-2010 Christian M. Zmasek
6 // Copyright (C) 2008-2010 Burnham Institute for Medical Research
7 //
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Lesser General Public
10 // License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
21 //
22 // Contact: phylosoft @ gmail . com
23 // WWW: www.phylosoft.org
24
25 package org.forester.archaeopteryx.webservices;
26
27 import java.util.ArrayList;
28 import java.util.List;
29
30 public final class WebservicesManager {
31
32     private static WebservicesManager               _instance;
33     private final List<PhylogeniesWebserviceClient> _clients;
34
35     private WebservicesManager() {
36         _clients = new ArrayList<PhylogeniesWebserviceClient>();
37         _clients.addAll( WebserviceUtil.createDefaultClients() );
38     }
39
40     @Override
41     public Object clone() throws CloneNotSupportedException {
42         throw new CloneNotSupportedException();
43     }
44
45     public PhylogeniesWebserviceClient getAvailablePhylogeniesWebserviceClient( final int i ) {
46         return getAvailablePhylogeniesWebserviceClients().get( i );
47     }
48
49     public List<PhylogeniesWebserviceClient> getAvailablePhylogeniesWebserviceClients() {
50         return _clients;
51     }
52
53     public static WebservicesManager getInstance() {
54         if ( _instance == null ) {
55             _instance = new WebservicesManager();
56         }
57         return _instance;
58     }
59
60     public enum WsPhylogenyFormat {
61         NH, NHX, NEXUS, TOL_XML_RESPONSE, PHYLOXML, NH_EXTRACT_TAXONOMY, PFAM
62     }
63 }