Package org.apache.pulsar.client.cli
Class CmdProduce.ProducerSocket
- java.lang.Object
-
- org.apache.pulsar.client.cli.CmdProduce.ProducerSocket
-
- Enclosing class:
- CmdProduce
@WebSocket(maxTextMessageSize=65536) public static class CmdProduce.ProducerSocket extends Object
-
-
Constructor Summary
Constructors Constructor Description ProducerSocket(CompletableFuture<Void> connected)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitClose(int duration, TimeUnit unit)voidclose()org.eclipse.jetty.websocket.api.RemoteEndpointgetRemote()org.eclipse.jetty.websocket.api.SessiongetSession()voidonClose(int statusCode, String reason)voidonConnect(org.eclipse.jetty.websocket.api.Session session)voidonMessage(String msg)CompletableFuture<Void>send(int index, byte[] content)
-
-
-
Constructor Detail
-
ProducerSocket
public ProducerSocket(CompletableFuture<Void> connected)
-
-
Method Detail
-
send
public CompletableFuture<Void> send(int index, byte[] content) throws Exception
- Throws:
Exception
-
awaitClose
public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedException- Throws:
InterruptedException
-
onClose
@OnWebSocketClose public void onClose(int statusCode, String reason)
-
onConnect
@OnWebSocketConnect public void onConnect(org.eclipse.jetty.websocket.api.Session session)
-
onMessage
@OnWebSocketMessage public void onMessage(String msg) throws com.google.gson.JsonParseException
- Throws:
com.google.gson.JsonParseException
-
getRemote
public org.eclipse.jetty.websocket.api.RemoteEndpoint getRemote()
-
getSession
public org.eclipse.jetty.websocket.api.Session getSession()
-
close
public void close()
-
-