java.lang.Object
tech.deplant.java4ever.binding.Processing
This module incorporates functions related to complex messageprocessing scenarios.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprocessMessage
(@NonNull Context context, Abi.ABI abi, String address, Abi.DeploySet deploySet, Abi.CallSet callSet, Abi.Signer signer, Number processingTryIndex, @NonNull Boolean sendEvents, Consumer<ProcessMessageEvent> consumer) Creates message, sends it to the network and monitors its processing.sendMessage
(@NonNull Context context, @NonNull String message, Abi.ABI abi, @NonNull Boolean sendEvents, Consumer<SendMessageEvent> consumer) Sends message to the networkwaitForTransaction
(@NonNull Context context, Abi.ABI abi, @NonNull String message, @NonNull String shardBlockId, @NonNull Boolean sendEvents, String[] sendingEndpoints, Consumer<WaitForTransactionEvent> consumer) Performs monitoring of the network for the result transaction of the external inbound message processing.
-
Constructor Details
-
Processing
public Processing()
-
-
Method Details
-
sendMessage
public static CompletableFuture<Processing.ResultOfSendMessage> sendMessage(@NonNull @NonNull Context context, @NonNull @NonNull String message, Abi.ABI abi, @NonNull @NonNull Boolean sendEvents, Consumer<SendMessageEvent> consumer) Sends message to the network- Parameters:
message
- Message BOC.abi
- Optional message ABI. If this parameter is specified and the message has the`expire` header then expiration time will be checked againstthe current time to prevent unnecessary sending of already expired message.The `message already expired` error will be returned in thiscase.
Note, that specifying `abi` for ABI compliant contracts isstrongly recommended, so that proper processing strategy can bechosen.
sendEvents
- Flag for requesting events sending
-
waitForTransaction
public static CompletableFuture<Processing.ResultOfProcessMessage> waitForTransaction(@NonNull @NonNull Context context, Abi.ABI abi, @NonNull @NonNull String message, @NonNull @NonNull String shardBlockId, @NonNull @NonNull Boolean sendEvents, String[] sendingEndpoints, Consumer<WaitForTransactionEvent> consumer) Performs monitoring of the network for the result transaction of the external inbound message processing.- Parameters:
abi
- Optional ABI for decoding the transaction result. If it is specified, then the output messages' bodies will bedecoded according to this ABI.The `abi_decoded` result field will be filled out.
message
- Message BOC. Encoded with `base64`.shardBlockId
- The last generated block id of the destination account shard before the message was sent. You must provide the same value as the `send_message` has returned.sendEvents
- Flag that enables/disables intermediate eventssendingEndpoints
- The list of endpoints to which the message was sent. Use this field to get more informative errors.Provide the same value as the `send_message` has returned.If the message was not delivered (expired), SDK will log the endpoint URLs, used for its sending.
-
processMessage
public static CompletableFuture<Processing.ResultOfProcessMessage> processMessage(@NonNull @NonNull Context context, @NonNull Abi.ABI abi, String address, Abi.DeploySet deploySet, Abi.CallSet callSet, @NonNull Abi.Signer signer, Number processingTryIndex, @NonNull @NonNull Boolean sendEvents, Consumer<ProcessMessageEvent> consumer) Creates message, sends it to the network and monitors its processing.- Parameters:
abi
- Contract ABI.address
- Target address the message will be sent to. Must be specified in case of non-deploy message.deploySet
- Deploy parameters. Must be specified in case of deploy message.callSet
- Function call parameters. Must be specified in case of non-deploy message.In case of deploy message it is optional and contains parametersof the functions that will to be called upon deploy transaction.
signer
- Signing parameters.processingTryIndex
- Processing try index. Used in message processing with retries (if contract's ABI includes "expire" header).Encoder uses the provided try index to calculate messageexpiration time. The 1st message expiration time is specified inClient config.
Expiration timeouts will grow with every retry.Retry grow factor is set in Client config:<.....add config parameter with default value here>
Default value is 0.
sendEvents
- Flag for requesting events sending
-