Package uk.ac.starlink.topcat.interop
Class TopcatServer
- java.lang.Object
-
- uk.ac.starlink.topcat.interop.TopcatServer
-
public class TopcatServer extends java.lang.ObjectProvides HTTP server functionality for TOPCAT. This includes a web server for dynamically generated content and an XML-RPC server for use with SAMP. This class is a singleton.- Since:
- 29 Aug 2008
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URLaddResource(java.lang.String name, org.astrogrid.samp.httpd.ServerResource resource)Makes a resource available for retrieving from this internal HTTP server.static TopcatServergetInstance()Returns the sole instance of this class.org.astrogrid.samp.client.ClientProfilegetProfile()Returns a SAMP client profile.java.net.URLgetTopcatPackageUrl()Returns the URL corresponding to the classpath for the package uk.ac.starlink.topcat.booleanisFound(java.net.URL url)Indicates whether this server can serve the resource with a given URL.voidremoveResource(java.net.URL url)Removes a resource from this server.
-
-
-
Method Detail
-
getProfile
public org.astrogrid.samp.client.ClientProfile getProfile()
Returns a SAMP client profile.- Returns:
- profile
-
addResource
public java.net.URL addResource(java.lang.String name, org.astrogrid.samp.httpd.ServerResource resource)Makes a resource available for retrieving from this internal HTTP server. Anamemay be supplied which will appear at the end of the URL, but this is just for cosmetic purposes. The URL at which the resource is available will provided as the return value.- Parameters:
name- filename identifying the resourceresource- resource to make available- Returns:
- URL at which
resourcecan be found
-
removeResource
public void removeResource(java.net.URL url)
Removes a resource from this server.- Parameters:
url- URL returned by a previous addResource call
-
getTopcatPackageUrl
public java.net.URL getTopcatPackageUrl()
Returns the URL corresponding to the classpath for the package uk.ac.starlink.topcat.- Returns:
- documentation URL
-
isFound
public boolean isFound(java.net.URL url)
Indicates whether this server can serve the resource with a given URL.- Parameters:
url- URL to enquire about- Returns:
- true if a request for
urlwill complete with non-error status
-
getInstance
public static TopcatServer getInstance() throws java.io.IOException
Returns the sole instance of this class.- Returns:
- instance
- Throws:
java.io.IOException
-
-