public abstract class LDJSONStreamOutput extends Object implements javax.ws.rs.core.StreamingOutput
| Constructor and Description |
|---|
LDJSONStreamOutput()
same as LDJSONStreamOutput(false)
|
LDJSONStreamOutput(boolean heartbeat)
same as LDJSONStreamOutput(5000)
|
LDJSONStreamOutput(int heartbeatMillis) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getHeartbeatMessage() |
protected com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
boolean |
isRunning() |
void |
setRunning(boolean running) |
protected void |
startStream() |
protected void |
stopStream() |
void |
write(OutputStream output) |
void |
writeObject(Object obj)
Writes the given JSON object to the stream
|
void |
writeObject(String json)
Writes the given JSON string to the stream
|
public LDJSONStreamOutput()
public LDJSONStreamOutput(boolean heartbeat)
heartbeat - public LDJSONStreamOutput(int heartbeatMillis)
heartbeatMillis - public boolean isRunning()
public void setRunning(boolean running)
running - the running to setpublic void write(OutputStream output) throws IOException, javax.ws.rs.WebApplicationException
write in interface javax.ws.rs.core.StreamingOutputIOExceptionjavax.ws.rs.WebApplicationExceptionpublic void writeObject(String json)
json - the JSON string to writepublic void writeObject(Object obj) throws com.fasterxml.jackson.core.JsonProcessingException
json - the JSON object to writecom.fasterxml.jackson.core.JsonProcessingExceptionprotected void stopStream()
protected void startStream()
protected com.fasterxml.jackson.databind.ObjectMapper getMapper()
protected String getHeartbeatMessage()
Copyright © 2013 Taimos GmbH. All Rights Reserved.