JAL-3878 Move listeners list from the WebServiceDiscoverer interface.
[jalview.git] / src / jalview / ws2 / operations / Operation.java
1 package jalview.ws2.operations;
2
3 import jalview.ws.params.ParamDatastoreI;
4 import jalview.ws2.WebServiceI;
5 import jalview.ws2.gui.MenuEntryProviderI;
6
7 /**
8  * Operation represents an action which can be performed with a (web)service or
9  * calculator. Examples of operations are multiple sequence alignment or
10  * sequence annotation. There should be one Operation implementation for each
11  * operation that Jalview can perform on sequences or alignments. The concrete
12  * implementations may be further parameterized to alter the functionality (e.g.
13  * making the operation interactive) or restrict input data (e.g. limit to
14  * proteins only).
15  * 
16  * @author mmwarowny
17  *
18  */
19 public interface Operation
20 {
21   /**
22    * Get the web service instance used to communicate with the web client.
23    * 
24    * @return web service client instance
25    */
26   public WebServiceI getWebService();
27
28   /**
29    * Get the name of the operation. Typically fetched from the server.
30    * 
31    * @return operation name
32    */
33   public String getName();
34
35   /**
36    * Get the description of the operation. Typically fetched from the server.
37    * 
38    * @return operation description
39    */
40   public String getDescription();
41
42   /**
43    * Get the name of the category that the operation falls into. Used to group
44    * the operations under the web services menu.
45    * 
46    * @return category name
47    */
48   public String getTypeName();
49
50   /**
51    * Get the hostname/url of the server which this operation is delegated to.
52    * Typically fetched from the accompanying web service instance.
53    * 
54    * @return server url
55    */
56   public String getHostName();
57
58   /**
59    * Check if the operation has user-customizable input parameters.
60    * 
61    * @return if has parameters
62    */
63   public boolean hasParameters();
64
65   /**
66    * Returns parameter datastore for this operations containing input parameters
67    * and available presets.
68    * 
69    * @return parameter datastore of the operation
70    */
71   public ParamDatastoreI getParamStore();
72
73   /**
74    * @return minimum accepted number of sequences
75    */
76   public int getMinSequences();
77
78   /**
79    * @return maximum accepted number of sequences
80    */
81   public int getMaxSequences();
82
83   /**
84    * @return whether gaps should be included
85    */
86   public boolean canSubmitGaps();
87
88   /**
89    * @return whether works with protein sequences
90    */
91   public boolean isProteinOperation();
92
93   /**
94    * @return whether works with nucleotide sequences
95    */
96   public boolean isNucleotideOperation();
97
98   /**
99    * @return whether should be run interactively
100    */
101   public boolean isInteractive();
102
103   /**
104    * Get the menu builder for this operation which will be used to construct the
105    * web services menu. The builder will be given the parent menu entry which it
106    * should attach menu items to and the current align frame.
107    * 
108    * @return menu entry builder instance
109    */
110   public MenuEntryProviderI getMenuBuilder();
111
112   /**
113    * @return whether this operation is alignment analysis
114    */
115   public boolean isAlignmentAnalysis();
116
117   /**
118    * @return whether non-standatds symbols should be filtered out
119    */
120   public boolean getFilterNonStandardSymbols();
121
122   /**
123    * @return whether it needs aligned sequences
124    */
125   public boolean getNeedsAlignedSequences();
126
127 }