Package uk.ac.starlink.topcat
Class TopcatSender
java.lang.Object
uk.ac.starlink.topcat.TopcatSender
Object capable of sending a table location to a running TOPCAT instance.
- Since:
- 2 Aug 2011
- Author:
- Mark Taylor
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTopcatSender
(org.astrogrid.samp.client.HubConnection connection, String topcatId) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
Instructs an external TOPCAT application to load a table with a given location and table format.
-
Field Details
-
TOPCAT_LOAD_MTYPE
- See Also:
-
-
Constructor Details
-
TopcatSender
Constructor.- Parameters:
connection
- registered connection to hubtopcatId
- client ID for currently registered TOPCAT client
-
-
Method Details
-
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 filenameformat
- 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 URLformat
- 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
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
-