uk.ac.starlink.topcat.interop
Class TablePullHandler

java.lang.Object
  extended by org.astrogrid.samp.client.AbstractMessageHandler
      extended by 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
protected TablePullHandler(String mtype)
          Constructor.
 
Method Summary
static TablePullHandler createFormatTablePullHandler(String mtype, uk.ac.starlink.table.StarTableWriter twriter)
          Returns a message handler for a given fixed table format.
static TablePullHandler createGenericTablePullHandler(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(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.
 Map 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TablePullHandler

protected TablePullHandler(String mtype)
Constructor.

Parameters:
mtype - SAMP Mtype
Method Detail

createResponse

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.

Overrides:
createResponse in class org.astrogrid.samp.client.AbstractMessageHandler

processCall

public Map processCall(org.astrogrid.samp.client.HubConnection conn,
                       String senderId,
                       org.astrogrid.samp.Message msg)
                throws IOException
Specified by:
processCall in class org.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 Mtype
twriter - serializer defining table format
Returns:
new table pull handler

createGenericTablePullHandler

public static TablePullHandler createGenericTablePullHandler(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


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.