Class TablePullHandler

  • All Implemented Interfaces:
    org.astrogrid.samp.client.MessageHandler

    public abstract class TablePullHandler
    extends org.astrogrid.samp.client.AbstractMessageHandler
    Message handler for table pull messages. These return a reponse giving the URL of a table held by topcat.
    Since:
    28 Feb 2014
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected TablePullHandler​(java.lang.String mtype)
      Constructor.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static TablePullHandler createFormatTablePullHandler​(java.lang.String mtype, uk.ac.starlink.table.StarTableWriter twriter)
      Returns a message handler for a given fixed table format.
      static TablePullHandler createGenericTablePullHandler​(java.lang.String mtype)
      Returns a message handler where the table format is determined by a "format" parameter in the incoming message.
      protected org.astrogrid.samp.Response createResponse​(java.util.Map processOutput)
      If it's a Response, use it as is, if not wrap it up as a success.
      protected abstract uk.ac.starlink.table.StarTableWriter getTableWriter​(org.astrogrid.samp.Message msg)
      Returns a table writer to use for the given message.
      org.astrogrid.samp.Response processCall​(org.astrogrid.samp.client.HubConnection conn, java.lang.String senderId, org.astrogrid.samp.Message msg)  
      • Methods inherited from class org.astrogrid.samp.client.AbstractMessageHandler

        getSubscriptions, receiveCall, receiveNotification, setSubscriptions
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TablePullHandler

        protected TablePullHandler​(java.lang.String mtype)
        Constructor.
        Parameters:
        mtype - SAMP Mtype
    • Method Detail

      • createResponse

        protected org.astrogrid.samp.Response createResponse​(java.util.Map processOutput)
        If it's a Response, use it as is, if not wrap it up as a success.
        Overrides:
        createResponse in class org.astrogrid.samp.client.AbstractMessageHandler
      • processCall

        public org.astrogrid.samp.Response processCall​(org.astrogrid.samp.client.HubConnection conn,
                                                       java.lang.String senderId,
                                                       org.astrogrid.samp.Message msg)
                                                throws java.io.IOException
        Specified by:
        processCall in class org.astrogrid.samp.client.AbstractMessageHandler
        Throws:
        java.io.IOException
      • getTableWriter

        protected abstract uk.ac.starlink.table.StarTableWriter getTableWriter​(org.astrogrid.samp.Message msg)
                                                                        throws java.io.IOException
        Returns a table writer to use for the given message.
        Parameters:
        msg - message
        Returns:
        table serializer
        Throws:
        java.io.IOException
      • createFormatTablePullHandler

        public static TablePullHandler createFormatTablePullHandler​(java.lang.String mtype,
                                                                    uk.ac.starlink.table.StarTableWriter twriter)
        Returns a message handler for a given fixed table format.
        Parameters:
        mtype - SAMP Mtype
        twriter - serializer defining table format
        Returns:
        new table pull handler
      • createGenericTablePullHandler

        public static TablePullHandler createGenericTablePullHandler​(java.lang.String mtype)
        Returns a message handler where the table format is determined by a "format" parameter in the incoming message.
        Parameters:
        mtype - SAMP Mtype
        Returns:
        new table pull handler