Package akka.http.scaladsl.model.sse
Class ServerSentEvent
- java.lang.Object
-
- akka.http.javadsl.model.sse.ServerSentEvent
-
- akka.http.scaladsl.model.sse.ServerSentEvent
-
- All Implemented Interfaces:
java.io.Serializable
,scala.Equals
,scala.Product
public final class ServerSentEvent extends ServerSentEvent implements scala.Product, java.io.Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ServerSentEvent(java.lang.String data, scala.Option<java.lang.String> eventType, scala.Option<java.lang.String> id, scala.Option<java.lang.Object> retry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServerSentEvent
apply(java.lang.String data, int retry)
Creates aServerSentEvent
.static ServerSentEvent
apply(java.lang.String data, java.lang.String type)
Creates aServerSentEvent
.static ServerSentEvent
apply(java.lang.String data, java.lang.String type, java.lang.String id)
Creates aServerSentEvent
.java.lang.String
data()
akka.util.ByteString
encode()
scala.Option<java.lang.String>
eventType()
java.lang.String
getData()
Data, may span multiple lines.java.util.Optional<java.lang.String>
getEventType()
Optional type, must not contain \n or \r.java.util.Optional<java.lang.String>
getId()
Optional id, must not contain \n or \r.java.util.OptionalInt
getRetry()
Optional reconnection delay in milliseconds.static ServerSentEvent
heartbeat()
scala.Option<java.lang.String>
id()
scala.Option<java.lang.Object>
retry()
-
Methods inherited from class akka.http.javadsl.model.sse.ServerSentEvent
create, create, create, create, create
-
-
-
-
Method Detail
-
heartbeat
public static ServerSentEvent heartbeat()
-
apply
public static ServerSentEvent apply(java.lang.String data, java.lang.String type)
Creates aServerSentEvent
.- Parameters:
data
- data, may span multiple linestype
- type, must not contain \n or \r- Returns:
- (undocumented)
-
apply
public static ServerSentEvent apply(java.lang.String data, java.lang.String type, java.lang.String id)
Creates aServerSentEvent
.- Parameters:
data
- data, may span multiple linestype
- type, must not contain \n or \rid
- id, must not contain \n or \r- Returns:
- (undocumented)
-
apply
public static ServerSentEvent apply(java.lang.String data, int retry)
Creates aServerSentEvent
.- Parameters:
data
- data, may span multiple linesretry
- reconnection delay in milliseconds- Returns:
- (undocumented)
-
data
public java.lang.String data()
-
eventType
public scala.Option<java.lang.String> eventType()
-
id
public scala.Option<java.lang.String> id()
-
retry
public scala.Option<java.lang.Object> retry()
-
encode
public akka.util.ByteString encode()
-
getData
public java.lang.String getData()
Description copied from class:ServerSentEvent
Data, may span multiple lines.- Specified by:
getData
in classServerSentEvent
-
getEventType
public java.util.Optional<java.lang.String> getEventType()
Description copied from class:ServerSentEvent
Optional type, must not contain \n or \r.- Specified by:
getEventType
in classServerSentEvent
-
getId
public java.util.Optional<java.lang.String> getId()
Description copied from class:ServerSentEvent
Optional id, must not contain \n or \r.- Specified by:
getId
in classServerSentEvent
-
getRetry
public java.util.OptionalInt getRetry()
Description copied from class:ServerSentEvent
Optional reconnection delay in milliseconds.- Specified by:
getRetry
in classServerSentEvent
-
-