public class SSEvent extends Object
The library maps every property to the corresponding keyword in a Server-Sent Event response. If a property in this class is null it will be ignored.
| Constructor and Description |
|---|
SSEvent() |
| Modifier and Type | Method and Description |
|---|---|
String |
getComment() |
String |
getData() |
String |
getEvent() |
String |
getId() |
Integer |
getRetry() |
void |
setComment(String comment)
Adds a comment to this event.
|
void |
setData(Object data)
Sets the data part of the Server-Sent Event response.
|
void |
setData(String data)
Sets the data part of the Server-Sent Event response.
|
void |
setEvent(String event)
Name of the event.
|
void |
setId(String id)
Sets the event source's last event ID.
|
void |
setRetry(Integer retry)
Sets the retry value.
|
public String getId()
public void setId(String id)
id - new event source's last event idpublic String getData()
public void setData(String data)
data - the actual payload of the reponsepublic void setData(Object data)
data - the actual payload of the reponse. Converted to a String by
calling the object's toString() method. If null data is set to
null.public Integer getRetry()
public void setRetry(Integer retry)
Default value is 3000 (3 seconds).
retry - the new retry value in millisecondspublic String getEvent()
public void setEvent(String event)
event - the new name of the eventpublic String getComment()
public void setComment(String comment)
comment - the new comment for this eventCopyright © 2010-2013. All Rights Reserved.