Class ExperimentControllerServiceClient

java.lang.Object
uk.ac.gda.ui.tool.rest.ExperimentControllerServiceClient

@Service public class ExperimentControllerServiceClient extends Object
Provides to the GDA client access a ExperimentController service

client.experiment.service.endpoint is the property which configures the URL endpoint to the service. The default value is http://127.0.0.1:8888/experiment

  • Constructor Details

    • ExperimentControllerServiceClient

      public ExperimentControllerServiceClient()
  • Method Details

    • startExperiment

      public URL startExperiment(String experimentName) throws GDAClientRestException
      Starts a new named experiment
      Parameters:
      experimentName - A user-friendly identifier for the experiment
      Returns:
      the experiment file URL; created at the end of the experiment (stopExperiment() // * @throws ExperimentControllerException // * if methods fails to create the experiment location
      Throws:
      GDAClientRestException
    • getExperimentName

      public String getExperimentName()
      Returns the experiment name, or null if no experiment is running
    • stopExperiment

      public void stopExperiment() throws GDAClientRestException
      Closes the active experiment. Closes also any open multipart acquisition. // * @throws ExperimentControllerException // * if methods fails or isExperimentInProgress() returns false
      Throws:
      GDAClientRestException
    • isExperimentInProgress

      public boolean isExperimentInProgress()
      Returns the state of the experiment
      Returns:
      true if the experiment is in progress, otherwise false
    • prepareAcquisition

      public URL prepareAcquisition(String acquisitionName) throws GDAClientRestException
      Creates a new location within the experiment structure.
      Parameters:
      acquisitionName - A user-friendly identifier for the acquisition
      Returns:
      The URL for the acquisition file // * @throws ExperimentControllerException // * if methods fails to create the acquisition location
      Throws:
      GDAClientRestException
    • startMultipartAcquisition

      public URL startMultipartAcquisition(String acquisitionName) throws GDAClientRestException
      Prepares the controller for an acquisition composed of multiple parts. Each part should then be given a URL by calling prepareAcquisition(String), and the overall acquisition should be ended with stopMultipartAcquisition()
      Parameters:
      acquisitionName - A user-friendly identifier for the acquisition
      Returns:
      the URL of the acquisition file, created when the multipart acquisition is stopped // * @throws ExperimentControllerException
      Throws:
      GDAClientRestException
    • stopMultipartAcquisition

      public void stopMultipartAcquisition() throws GDAClientRestException
      Closes the current multipart acquisition is complete. // * @throws ExperimentControllerException // * if no open multipart acquisition exists
      Throws:
      GDAClientRestException