uk.ac.starlink.topcat
Class TopcatSender

java.lang.Object
  extended by uk.ac.starlink.topcat.TopcatSender

public abstract class TopcatSender
extends Object

Object capable of sending a table location to a running TOPCAT instance.

Since:
2 Aug 2011
Author:
Mark Taylor

Field Summary
static String TOPCAT_LOAD_MTYPE
           
 
Constructor Summary
TopcatSender(org.astrogrid.samp.client.HubConnection connection, String topcatId)
          Constructor.
 
Method Summary
 void close()
          Unregisters the client associated with this sender.
static TopcatSender createSender(org.astrogrid.samp.client.ClientProfile profile)
          Attempts to create and return a TopcatSender for a given profile.
protected abstract  org.astrogrid.samp.Message createSendMessage(String uloc, String format)
          Returns a Message that can be sent to TOPCAT to receive a table.
 org.astrogrid.samp.Response sendTable(String location, String format)
          Instructs an external TOPCAT application to load a table with a given location and table format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOPCAT_LOAD_MTYPE

public static final String TOPCAT_LOAD_MTYPE
See Also:
Constant Field Values
Constructor Detail

TopcatSender

public TopcatSender(org.astrogrid.samp.client.HubConnection connection,
                    String topcatId)
Constructor.

Parameters:
connection - registered connection to hub
topcatId - client ID for currently registered TOPCAT client
Method Detail

sendTable

public org.astrogrid.samp.Response sendTable(String location,
                                             String format)
                                      throws IOException,
                                             org.astrogrid.samp.client.SampException
Instructs an external TOPCAT application to load a table with a given location and table format.

Parameters:
location - table URL or filename
format - STIL-friendly table format (null for auto)
Returns:
response from table load message
Throws:
IOException
org.astrogrid.samp.client.SampException

createSendMessage

protected abstract org.astrogrid.samp.Message createSendMessage(String uloc,
                                                                String format)
                                                         throws IOException
Returns a Message that can be sent to TOPCAT to receive a table.

Parameters:
uloc - location, if possible in the form of a URL
format - STIL-friendly table format name; may be an empty string (for auto-detection) but may not be null
Returns:
load table message
Throws:
IOException

close

public void close()
Unregisters the client associated with this sender.


createSender

public static TopcatSender createSender(org.astrogrid.samp.client.ClientProfile profile)
Attempts to create and return a TopcatSender for a given profile. If none can be constructed (for instance no hub or no external TOPCAT client found), null is returned.

Parameters:
profile - client profile
Returns:
working topcat sender, or null


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