Interface DeliveryPayload
- All Known Subinterfaces:
MessageDelivery
,MessageDeliveryPayload
,ResourceCreatedDelivery
,ResourceCreatedDeliveryPayload
,ResourceDeletedDelivery
,ResourceDeletedDeliveryPayload
,ResourceUpdatedDelivery
,ResourceUpdatedDeliveryPayload
,SubscriptionDelivery
- All Known Implementing Classes:
DeliveryPayloadImpl
,MessageDeliveryPayloadImpl
,ResourceCreatedDeliveryPayloadImpl
,ResourceDeletedDeliveryPayloadImpl
,ResourceUpdatedDeliveryPayloadImpl
public interface DeliveryPayload
All payloads for the PlatformFormat share these common fields.
Example to create a subtype instance using the builder pattern
DeliveryPayload deliveryPayload = DeliveryPayload.messageBuilder()
projectKey("{projectKey}")
resource(resourceBuilder -> resourceBuilder)
id("{id}")
version(0.3)
createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
sequenceNumber(0.3)
resourceVersion(0.3)
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic DeliveryPayload
deepCopy
(DeliveryPayload template) factory method to create a deep copy of DeliveryPayload@NotNull String
Identifies the payload.@NotNull String
key
of the Project.@NotNull @Valid Reference
Reference to the resource that triggered the message.@Valid UserProvidedIdentifiers
User-defined unique identifiers of the resource.builder for message subtypebuilder for resourceCreated subtypebuilder for resourceDeleted subtypebuilder for resourceUpdated subtypevoid
setProjectKey
(String projectKey) key
of the Project.void
setResource
(Reference resource) Reference to the resource that triggered the message.void
setResourceUserProvidedIdentifiers
(UserProvidedIdentifiers resourceUserProvidedIdentifiers) User-defined unique identifiers of the resource.static com.fasterxml.jackson.core.type.TypeReference<DeliveryPayload>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withDeliveryPayload
(Function<DeliveryPayload, T> helper) accessor map function
-
Method Details
-
getProjectKey
key
of the Project. Useful in message processing if the Destination receives events from multiple Projects.- Returns:
- projectKey
-
getNotificationType
Identifies the payload.
- Returns:
- notificationType
-
getResource
Reference to the resource that triggered the message.
- Returns:
- resource
-
getResourceUserProvidedIdentifiers
User-defined unique identifiers of the resource.
- Returns:
- resourceUserProvidedIdentifiers
-
setProjectKey
key
of the Project. Useful in message processing if the Destination receives events from multiple Projects.- Parameters:
projectKey
- value to be set
-
setResource
Reference to the resource that triggered the message.
- Parameters:
resource
- value to be set
-
setResourceUserProvidedIdentifiers
User-defined unique identifiers of the resource.
- Parameters:
resourceUserProvidedIdentifiers
- value to be set
-
deepCopy
factory method to create a deep copy of DeliveryPayload- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
messageBuilder
builder for message subtype- Returns:
- builder
-
resourceCreatedBuilder
builder for resourceCreated subtype- Returns:
- builder
-
resourceDeletedBuilder
builder for resourceDeleted subtype- Returns:
- builder
-
resourceUpdatedBuilder
builder for resourceUpdated subtype- Returns:
- builder
-
withDeliveryPayload
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-