Package org.ldk.structs
Class CustomOnionMessageHandler
- java.lang.Object
-
- org.ldk.structs.CustomOnionMessageHandler
-
public class CustomOnionMessageHandler extends Object
Handler for custom onion messages. If you are using [`SimpleArcOnionMessenger`], [`SimpleRefOnionMessenger`], or prefer to ignore inbound custom onion messages, [`IgnoringMessageHandler`] must be provided to [`OnionMessenger::new`]. Otherwise, a custom implementation of this trait must be provided, with [`CustomMessage`] specifying the supported message types. See [`OnionMessenger`] for example usage. [`IgnoringMessageHandler`]: crate::ln::peer_handler::IgnoringMessageHandler [`CustomMessage`]: Self::CustomMessage
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
CustomOnionMessageHandler.CustomOnionMessageHandlerInterface
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy()
Destroys the object, freeing associated resources.protected void
finalize()
void
handle_custom_message(CustomOnionMessageContents msg)
Called with the custom message that was received.static CustomOnionMessageHandler
new_impl(CustomOnionMessageHandler.CustomOnionMessageHandlerInterface arg)
Result_COption_CustomOnionMessageContentsZDecodeErrorZ
read_custom_message(long message_type, byte[] buffer)
Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the message type is unknown.
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
destroy
public void destroy()
Destroys the object, freeing associated resources. After this call, any access to this object may result in a SEGFAULT or worse. You should generally NEVER call this method. You should let the garbage collector do this for you when it finalizes objects. However, it may be useful for types which represent locks and should be closed immediately to avoid holding locks until the GC runs.
-
new_impl
public static CustomOnionMessageHandler new_impl(CustomOnionMessageHandler.CustomOnionMessageHandlerInterface arg)
-
handle_custom_message
public void handle_custom_message(CustomOnionMessageContents msg)
Called with the custom message that was received.
-
read_custom_message
public Result_COption_CustomOnionMessageContentsZDecodeErrorZ read_custom_message(long message_type, byte[] buffer)
Read a custom message of type `message_type` from `buffer`, returning `Ok(None)` if the message type is unknown.
-
-