public class RestServer
extends java.lang.Object
Constructor and Description |
---|
RestServer(TopologyElement te,
int port)
Create a REST server that will listen on the specified port.
|
RestServer(TopologyElement te)
Create a REST server that will listen on port 8080.
|
Modifier and Type | Method and Description |
---|---|
Topology |
topology()
Get the topology for this REST server.
|
java.lang.String |
viewer(TWindow<?,?> window,
java.lang.String context,
java.lang.String name)
Declare a HTTP REST view of tuples in a window.
|
public RestServer(TopologyElement te)
te
- Topology to contain the REST server.public RestServer(TopologyElement te, int port)
te
- Topology to contain the REST server.port
- Port to listen on.public Topology topology()
public java.lang.String viewer(TWindow<?,?> window, java.lang.String context, java.lang.String name)
window
.
TStream<JSONObject>
- Each tuple is the JSON object.
TStream<? extends JSONAble>
- Each tuple is converted to a JSON object
using JSONAble.toJSON()
.
TStream<String>
- Each tuple will be converted to a JSON object with a single
attribute 'string
' with the tuple's value.
SPLStream
-
Each Tuple
is converted to JSON using the encoding provided
by the Java Operator API com.ibm.streams.operator.encoding.JSONEncoding
.
window
- Window to expose through the HTTP GETcontext
- Context path for the URL to access the resource.name
- Relative name (to context
) of the resource.