Class WebEditorSocket
java.lang.Object
me.lucko.luckperms.common.webeditor.socket.WebEditorSocket
-
Constructor Summary
ConstructorsConstructorDescriptionWebEditorSocket(LuckPermsPlugin plugin, Sender sender, WebEditorSession session) -
Method Summary
Modifier and TypeMethodDescriptionvoidappendDetailToRequest(WebEditorRequest request) Adds detail about the socket channel and the plugin public key to the editor request payload that gets sent via bytebin to the viewer.voidclose()voidinitialize(BytesocksClient client) Initializes the socket connection.booleanisClosed()voidvoidsend(com.google.gson.JsonObject msg) Send a message to the socket.voidsetRemotePublicKey(PublicKey remotePublicKey) booleantrustConnection(String nonce) voidwaitForConnect(long timeout, TimeUnit unit) Waits the specified amount of time for the socket to connect, before throwing an exception if a timeout occurs.
-
Constructor Details
-
WebEditorSocket
-
-
Method Details
-
initialize
Initializes the socket connection.- Parameters:
client- the bytesocks client to connect to- Throws:
UnsuccessfulRequestException- if the request failsIOException- if an i/o error occurs
-
waitForConnect
Waits the specified amount of time for the socket to connect, before throwing an exception if a timeout occurs.- Parameters:
timeout- the timeoutunit- the timeout unit
-
appendDetailToRequest
Adds detail about the socket channel and the plugin public key to the editor request payload that gets sent via bytebin to the viewer.- Parameters:
request- the request
-
send
public void send(com.google.gson.JsonObject msg) Send a message to the socket.The message will be encoded as JSON and signed using the public public key.
- Parameters:
msg- the message
-
trustConnection
-
scheduleCleanupIfUnused
public void scheduleCleanupIfUnused() -
close
public void close() -
getPlugin
-
getSender
-
getSession
-
getSocket
-
getRemotePublicKey
-
setRemotePublicKey
-
isClosed
public boolean isClosed()
-