Package uk.ac.starlink.topcat.interop
Class TablePullHandler
java.lang.Object
org.astrogrid.samp.client.AbstractMessageHandler
uk.ac.starlink.topcat.interop.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 -
Method Summary
Modifier and TypeMethodDescriptionstatic TablePullHandler
createFormatTablePullHandler
(String mtype, uk.ac.starlink.table.StarTableWriter twriter) Returns a message handler for a given fixed table format.static TablePullHandler
Returns a message handler where the table format is determined by a "format" parameter in the incoming message.protected org.astrogrid.samp.Response
createResponse
(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, String senderId, org.astrogrid.samp.Message msg) Methods inherited from class org.astrogrid.samp.client.AbstractMessageHandler
getSubscriptions, receiveCall, receiveNotification, setSubscriptions
-
Constructor Details
-
TablePullHandler
Constructor.- Parameters:
mtype
- SAMP Mtype
-
-
Method Details
-
createResponse
If it's a Response, use it as is, if not wrap it up as a success.- Overrides:
createResponse
in classorg.astrogrid.samp.client.AbstractMessageHandler
-
processCall
public org.astrogrid.samp.Response processCall(org.astrogrid.samp.client.HubConnection conn, String senderId, org.astrogrid.samp.Message msg) throws IOException - Specified by:
processCall
in classorg.astrogrid.samp.client.AbstractMessageHandler
- Throws:
IOException
-
getTableWriter
protected abstract uk.ac.starlink.table.StarTableWriter getTableWriter(org.astrogrid.samp.Message msg) throws IOException Returns a table writer to use for the given message.- Parameters:
msg
- message- Returns:
- table serializer
- Throws:
IOException
-
createFormatTablePullHandler
public static TablePullHandler createFormatTablePullHandler(String mtype, uk.ac.starlink.table.StarTableWriter twriter) Returns a message handler for a given fixed table format.- Parameters:
mtype
- SAMP Mtypetwriter
- serializer defining table format- Returns:
- new table pull handler
-
createGenericTablePullHandler
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
-