|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.application.jsmap.JSONWebServer
public class JSONWebServer
A simple web server to serve data base contents to a JavaScript client.
Field Summary | |
---|---|
private Database |
db
The database we use for obtaining object bundles |
protected static Logging |
logger
Our logger |
static String |
PATH_JSON
The base path we serve data from |
private HierarchicalResult |
result
The result tree we serve |
private com.sun.net.httpserver.HttpServer |
server
Server instance |
Constructor Summary | |
---|---|
JSONWebServer(int port,
HierarchicalResult result)
Constructor. |
Method Summary | |
---|---|
protected void |
bundleToJSON(JSONBuffer re,
DBID id)
Serialize an object bundle to JSON. |
void |
handle(com.sun.net.httpserver.HttpExchange exchange)
|
private void |
outlierMetaToJSON(JSONBuffer re,
OutlierScoreMeta meta)
Serialize outlier metadata as JSON. |
protected void |
resultToJSON(JSONBuffer re,
String name)
Serialize an arbitrary result into JSON. |
void |
stop()
Stop the web server. |
private DBID |
stringToDBID(String query)
Parse a string into a DBID. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final Logging logger
public static final String PATH_JSON
private com.sun.net.httpserver.HttpServer server
private HierarchicalResult result
private Database db
Constructor Detail |
---|
public JSONWebServer(int port, HierarchicalResult result)
port
- Port to listen onresult
- Result to serveMethod Detail |
---|
public void stop()
private DBID stringToDBID(String query)
query
- Query string
protected void bundleToJSON(JSONBuffer re, DBID id)
re
- Buffer to serialize toid
- Object IDprotected void resultToJSON(JSONBuffer re, String name)
re
- Buffer to serialize toname
- Result requestedprivate void outlierMetaToJSON(JSONBuffer re, OutlierScoreMeta meta)
re
- Output buffermeta
- Metadatapublic void handle(com.sun.net.httpserver.HttpExchange exchange) throws IOException
handle
in interface com.sun.net.httpserver.HttpHandler
IOException
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |