--- /dev/null
+package jalview.ws2.actions.alignment;
+
+import java.util.List;
+import java.util.Objects;
+
+import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.params.ArgumentI;
+import jalview.ws2.actions.BaseAction;
+import jalview.ws2.actions.api.TaskEventListener;
+import jalview.ws2.actions.api.TaskI;
+import jalview.ws2.api.Credentials;
+import jalview.ws2.client.api.AlignmentWebServiceClientI;
+
+/**
+ * Implementation of the {@link BaseAction} that runs alignment services. This
+ * type of action requires {@link AlignmentWebServiceClientI} to retrieve
+ * alignment result from the server.
+ *
+ * @author mmwarowny
+ *
+ */
+public class AlignmentAction extends BaseAction<AlignmentResult>
+{
+ /**
+ * A builder for AlignemntActions. Adds {@code client} and {@code submitGaps}
+ * parameters to the base builder.
+ *
+ * @author mmwarowny
+ */
+ public static class Builder extends BaseAction.Builder
+ {
+ protected AlignmentWebServiceClientI client;
+
+ protected boolean submitGaps = false;
+
+ public Builder(AlignmentWebServiceClientI client, String name)
+ {
+ super(name);
+ Objects.requireNonNull(client);
+ this.client = client;
+ }
+
+ public void submitGaps(boolean val)
+ {
+ submitGaps = val;
+ }
+
+ public AlignmentAction build()
+ {
+ return new AlignmentAction(this);
+ }
+ }
+
+ public static Builder newBuilder(AlignmentWebServiceClientI client, String name)
+ {
+ return new Builder(client, name);
+ }
+
+ protected final boolean submitGaps;
+
+ protected final AlignmentWebServiceClientI client;
+
+ public AlignmentAction(Builder builder)
+ {
+ super(builder);
+ submitGaps = builder.submitGaps;
+ client = builder.client;
+ }
+
+ @Override
+ public TaskI<AlignmentResult> perform(AlignmentViewport viewport,
+ List<ArgumentI> args, Credentials credentials,
+ TaskEventListener<AlignmentResult> handler)
+ {
+
+ }
+
+ /**
+ * Returns if the action is active for the given viewport.
+ * Alignment services are non-interactive, so the action is never active.
+ */
+ @Override
+ public boolean isActive(AlignmentViewport viewport)
+ {
+ return false;
+ }
+
+}
--- /dev/null
+package jalview.ws2.actions.alignment;
+
+import java.io.IOException;
+
+import jalview.datamodel.AlignmentI;
+
+import jalview.ws2.api.WebServiceJob;
+import jalview.ws2.client.api.AlignmentWebServiceClientI;
+import jalview.ws2.client.api.WebServiceClientI;
+
+/**
+ * An interface for providing alignment results to the alignment services. Web
+ * service clients that want to support alignment actions must implement this
+ * interface in addition to {@link WebServiceClientI}.
+ *
+ * @author mmwarowny
+ *
+ * @see AlignmentWebServiceClientI
+ */
+public interface AlignmentProviderI
+{
+ /**
+ * Get the alignment result for the job from the server.
+ *
+ * @param job
+ * web service job
+ * @return alignment result
+ * @throws IOException
+ * server communication error
+ */
+ public AlignmentI getAlignemnt(WebServiceJob job) throws IOException;
+}