JAL-3878 Add jpred operation and worker to the services.
[jalview.git] / src / jalview / ws2 / operations / JPredOperation.java
1 package jalview.ws2.operations;
2
3 import java.io.IOException;
4
5 import jalview.datamodel.AlignmentI;
6 import jalview.io.JPredFile;
7 import jalview.ws2.WSJob;
8 import jalview.ws2.WebServiceI;
9 import jalview.ws2.gui.JPredMenuBuilder;
10 import jalview.ws2.gui.MenuEntryProviderI;
11
12 public class JPredOperation extends AbstractOperation
13 {
14   public static interface PredictionResultSupplier
15   {
16     public AlignmentI getAlignment(WSJob job) throws IOException;
17     
18     public JPredFile getPrediction(WSJob job) throws IOException;
19   }
20   
21   PredictionResultSupplier predictionSupplier;
22   
23   public JPredOperation(WebServiceI service, String typeName,
24       PredictionResultSupplier predictionSupplier)
25   {
26     super(service, typeName);
27     this.predictionSupplier = predictionSupplier;
28   }
29   
30   @Override
31   public MenuEntryProviderI getMenuBuilder()
32   {
33     return new JPredMenuBuilder(this);
34   }
35 }