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.AbstractMessageHandlerMessage 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 protectedTablePullHandler(java.lang.String mtype)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static TablePullHandlercreateFormatTablePullHandler(java.lang.String mtype, uk.ac.starlink.table.StarTableWriter twriter)Returns a message handler for a given fixed table format.static TablePullHandlercreateGenericTablePullHandler(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.ResponsecreateResponse(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.StarTableWritergetTableWriter(org.astrogrid.samp.Message msg)Returns a table writer to use for the given message.org.astrogrid.samp.ResponseprocessCall(org.astrogrid.samp.client.HubConnection conn, java.lang.String senderId, org.astrogrid.samp.Message msg)
-
-
-
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:
createResponsein classorg.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:
processCallin classorg.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.IOExceptionReturns 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 Mtypetwriter- 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
-
-