Package tbdex.sdk.messages
Class Close
-
- All Implemented Interfaces:
-
tbdex.sdk.http.ReplyToMessage,tbdex.sdk.messages.Message
public final class Close implements Message, ReplyToMessage
Represents a Close message in the tbDEX protocol.
A Close message is sent by a PFI to Alice to signal the termination of an exchange, either because the exchange was successfully completed or because it cannot be fulfilled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classClose.Companion
-
Field Summary
Fields Modifier and Type Field Description private final MessageMetadatametadataprivate final CloseDatadataprivate final Stringsignaturepublic final static Close.CompanionCompanion
-
Method Summary
Modifier and Type Method Description final MessageMetadatagetMetadata()Metadata about the message, including sender, recipient, and protocol information. final CloseDatagetData()The data part of the Close message, including the reason for closure and success status. final StringgetSignature()The signature verifying the authenticity and integrity of the Close message. final StringtoJsonString()Serializes the Close message to a JSON string. final Unitsign(BearerDid bearerDid)Signs the Close message using the provided Bearer DID. final Unitverify()Verifies the Close message's signature and validity. -
-
Method Detail
-
getMetadata
final MessageMetadata getMetadata()
Metadata about the message, including sender, recipient, and protocol information.
-
getData
final CloseData getData()
The data part of the Close message, including the reason for closure and success status.
-
getSignature
final String getSignature()
The signature verifying the authenticity and integrity of the Close message.
-
toJsonString
final String toJsonString()
Serializes the Close message to a JSON string.
- Returns:
The serialized JSON string of the Close message.
-
sign
final Unit sign(BearerDid bearerDid)
Signs the Close message using the provided Bearer DID.
- Parameters:
bearerDid- The Bearer DID used to sign the Close message.
-
-
-
-