java.lang.Object | |
↳ | org.ocast.core.DataStream |
![]() |
Used for custom messaging. It allows an application to send and receive customized messages to/from the web application.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
DataStream(String serviceName)
Create a Datastream for the given service name
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String |
getServiceName()
Get the service name this DataStream is used for.
| ||||||||||
abstract void |
onMessage(JSONObject message)
Subclass must implement this method to manage incoming messages
| ||||||||||
void |
sendMessage(JSONObject message, Consumer<JSONObject> onSuccess, Consumer<Throwable> onFailure)
Send a message on the DataStream
| ||||||||||
void |
setBrowser(Browser browser)
Attach the stream to the provided
Browser |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Create a Datastream for the given service name
serviceName | the service name |
---|
Get the service name this DataStream is used for.
Subclass must implement this method to manage incoming messages
message | the incoming message |
---|
Send a message on the DataStream
message | the message to be sent |
---|---|
onSuccess | to be called on success |
onFailure | to be called if an error occured |
Attach the stream to the provided Browser
browser | the |
---|