Class RatsTextUpload

  • 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, RatInputUser, Serializable

    public class RatsTextUpload
    extends AbstractRESTPlugin
    implements RatInputUser
    Simple plugin for submitting text in plain-text format to RATS input.

    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected RatInput m_RatInput
      the rat input.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • Constructor Summary

      Constructors 
      Constructor Description
      RatsTextUpload()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      RatInput getRatInput()
      Returns the rat input in use.
      String globalInfo()
      Returns a string describing the object.
      void setRatInput​(RatInput value)
      Sets the rat input to use.
      void upload​(String content)
      For uploading text to be processed in a Rat actor.
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
      • Methods inherited from class adams.core.logging.LoggingObject

        configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
    • Field Detail

      • m_RatInput

        protected RatInput m_RatInput
        the rat input.
    • Constructor Detail

      • RatsTextUpload

        public RatsTextUpload()
    • 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
      • setRatInput

        public void setRatInput​(RatInput value)
        Sets the rat input to use.
        Specified by:
        setRatInput in interface RatInputUser
        Parameters:
        value - the rat input
      • getRatInput

        public RatInput getRatInput()
        Returns the rat input in use.
        Specified by:
        getRatInput in interface RatInputUser
        Returns:
        the rat input, null if none set
      • upload

        @POST
        @Path("/rats/text/upload")
        public void upload​(@FormParam("content")
                           String content)
        For uploading text to be processed in a Rat actor.
        Parameters:
        content - the text