Class DataExchange

  • All Implemented Interfaces:
    adams.core.AdditionalInformationHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SizeOfHandler, RESTPlugin, Serializable

    public class DataExchange
    extends AbstractRESTPlugin
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Constructor Detail

      • DataExchange

        public DataExchange()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.core.option.AbstractOptionHandler
      • reset

        protected void reset()
        Resets the scheme.
        Overrides:
        reset in class adams.core.option.AbstractOptionHandler
      • setAuthentication

        public void setAuthentication​(AbstractAuthentication value)
        Sets the authentication scheme.
        Parameters:
        value - the scheme
      • getAuthentication

        public AbstractAuthentication getAuthentication()
        Returns the authentication scheme.
        Returns:
        the scheme
      • authenticationTipText

        public String authenticationTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setBackend

        public void setBackend​(AbstractBackend value)
        Sets the backend scheme.
        Parameters:
        value - the scheme
      • getBackend

        public AbstractBackend getBackend()
        Returns the backend scheme.
        Returns:
        the scheme
      • backendTipText

        public String backendTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • handleError

        protected javax.ws.rs.core.Response handleError​(String msg)
        Logs the error and generates a JSON response with the error.
        Parameters:
        msg - the error message
        Returns:
        the generated JSON
      • upload

        @POST
        @Path("/upload")
        @Consumes("multipart/form-data")
        @Produces("application/json")
        public javax.ws.rs.core.Response upload​(org.apache.cxf.jaxrs.ext.multipart.MultipartBody body)
        Handles the upload of data.
        Parameters:
        body - the form data
        Returns:
        the generated JSON reply. Either contains an element "error" if failed or "token" with the generated that the data item can now be accessed with.
      • download

        @POST
        @Path("/download")
        @Consumes("multipart/form-data")
        @Produces("application/octet-stream")
        public javax.ws.rs.core.Response download​(org.apache.cxf.jaxrs.ext.multipart.MultipartBody body)
        Handles the download of data.
        Parameters:
        body - the form data
        Returns:
        the generated JSON reply. Returns the requested data.
      • remove

        @POST
        @Path("/remove")
        @Consumes("multipart/form-data")
        public javax.ws.rs.core.Response remove​(org.apache.cxf.jaxrs.ext.multipart.MultipartBody body)
        Handles the removal of data.
        Parameters:
        body - the form data
        Returns:
        the generated JSON reply.