JAL-3878 Add jpred operation and worker to the services.
[jalview.git] / src / jalview / ws2 / operations / AbstractOperation.java
1 package jalview.ws2.operations;
2
3 import jalview.ws.params.ParamDatastoreI;
4 import jalview.ws2.WebServiceI;
5
6 /**
7  * Common base for all operation classes which provides boilerplate
8  * implementation for common {@link Operation} methods.
9  * 
10  * @author mmwarowny
11  *
12  */
13 public abstract class AbstractOperation implements Operation
14 {
15
16   protected final WebServiceI service;
17
18   protected final String typeName;
19
20   protected boolean interactive = false;
21
22   protected boolean protOperation = true;
23
24   protected boolean nucOperation = true;
25
26   protected boolean alignmentAnalysis = false;
27
28   AbstractOperation(WebServiceI service, String typeName)
29   {
30     this.service = service;
31     this.typeName = typeName;
32   }
33
34   @Override
35   public WebServiceI getWebService()
36   {
37     return service;
38   }
39
40   @Override
41   public String getName()
42   {
43     return service.getName();
44   }
45
46   @Override
47   public String getDescription()
48   {
49     return service.getDescription();
50   }
51
52   @Override
53   public String getTypeName()
54   {
55     return typeName;
56   }
57
58   @Override
59   public String getHostName()
60   {
61     return service.getHostName();
62   }
63
64   @Override
65   public boolean hasParameters()
66   {
67     return service.hasParameters();
68   }
69
70   @Override
71   public ParamDatastoreI getParamStore()
72   {
73     return service.getParamStore();
74   }
75
76   @Override
77   public int getMinSequences()
78   {
79     return 1;
80   }
81
82   @Override
83   public int getMaxSequences()
84   {
85     return Integer.MAX_VALUE;
86   }
87
88   @Override
89   public boolean canSubmitGaps()
90   {
91     return false;
92   }
93
94   @Override
95   public boolean isProteinOperation()
96   {
97     return protOperation;
98   }
99
100   public void setProteinOperation(boolean value)
101   {
102     protOperation = value;
103   }
104
105   @Override
106   public boolean isNucleotideOperation()
107   {
108     return nucOperation;
109   }
110
111   public void setNucleotideOperation(boolean value)
112   {
113     nucOperation = value;
114   }
115
116   @Override
117   public boolean isInteractive()
118   {
119     return interactive;
120   }
121
122   public void setInteractive(boolean value)
123   {
124     interactive = value;
125   }
126
127   @Override
128   public boolean isAlignmentAnalysis()
129   {
130     return alignmentAnalysis;
131   }
132
133   public void setAlignmentAnalysis(boolean value)
134   {
135     alignmentAnalysis = value;
136   }
137
138   @Override
139   public boolean getFilterNonStandardSymbols()
140   {
141     return false;
142   }
143
144   @Override
145   public boolean getNeedsAlignedSequences()
146   {
147     return false;
148   }
149
150 }