T
- The type of payload contained in this Messagepublic class GenericDeadlineMessage<T> extends GenericEventMessage<T> implements DeadlineMessage<T>
DeadlineMessage
.clock
Constructor and Description |
---|
GenericDeadlineMessage(String deadlineName)
Instantiate a GenericDeadlineMessage with the given
deadlineName , a null payload and en empty
MetaData . |
GenericDeadlineMessage(String deadlineName,
Message<T> delegate,
Supplier<Instant> timestampSupplier)
Constructor to reconstruct a DeadlineMessage using existing data.
|
GenericDeadlineMessage(String deadlineName,
String identifier,
T payload,
Map<String,?> metaData,
Instant timestamp)
Constructor to reconstructs a DeadlineMessage using existing data.
|
GenericDeadlineMessage(String deadlineName,
T payload)
Instantiate a GenericDeadlineMessage with the given
deadlineName , a payload of type T and
en empty MetaData . |
GenericDeadlineMessage(String deadlineName,
T payload,
Map<String,?> metaData)
Instantiate a GenericDeadlineMessage with the given
deadlineName , a payload of type T and
the given metaData . |
Modifier and Type | Method and Description |
---|---|
GenericDeadlineMessage<T> |
andMetaData(Map<String,?> additionalMetaData)
Returns a copy of this EventMessage with it MetaData merged with the given
metaData . |
static <T> DeadlineMessage<T> |
asDeadlineMessage(String deadlineName,
Object messageOrPayload)
Deprecated.
Use
asDeadlineMessage(String, Object, Instant) instead, as it sets the timestamp of the
deadline, rather than the current time |
static <T> DeadlineMessage<T> |
asDeadlineMessage(String deadlineName,
Object messageOrPayload,
Instant expiryTime)
Returns the given
deadlineName and messageOrPayload as a DeadlineMessage which expires at the
given expiryTime . |
protected String |
describeType()
Describe the type of message, used in
MessageDecorator.toString() . |
String |
getDeadlineName()
Retrieve a
String representing the name of this DeadlineMessage. |
GenericDeadlineMessage<T> |
withMetaData(Map<String,?> metaData)
Returns a copy of this EventMessage with the given
metaData . |
asEventMessage, describeTo, getTimestamp
getDelegate, getIdentifier, getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getIdentifier, getTimestamp
getMetaData, getPayload, getPayloadType, serializeMetaData, serializePayload
public GenericDeadlineMessage(@Nonnull String deadlineName)
deadlineName
, a null
payload and en empty
MetaData
.deadlineName
- A String
denoting the deadline's namepublic GenericDeadlineMessage(@Nonnull String deadlineName, @Nullable T payload)
deadlineName
, a payload
of type T
and
en empty MetaData
.deadlineName
- A String
denoting the deadline's namepayload
- The payload of type T
for the DeadlineMessagepublic GenericDeadlineMessage(@Nonnull String deadlineName, @Nullable T payload, @Nonnull Map<String,?> metaData)
deadlineName
, a payload
of type T
and
the given metaData
.deadlineName
- A String
denoting the deadline's namepayload
- The payload of the MessagemetaData
- The MetaData of the Messagepublic GenericDeadlineMessage(@Nonnull String deadlineName, @Nonnull String identifier, @Nullable T payload, Map<String,?> metaData, Instant timestamp)
public GenericDeadlineMessage(@Nonnull String deadlineName, @Nonnull Message<T> delegate, @Nonnull Supplier<Instant> timestampSupplier)
@Deprecated public static <T> DeadlineMessage<T> asDeadlineMessage(@Nonnull String deadlineName, Object messageOrPayload)
asDeadlineMessage(String, Object, Instant)
instead, as it sets the timestamp of the
deadline, rather than the current timedeadlineName
and messageOrPayload
as a DeadlineMessage. If the
messageOrPayload
parameter is of type Message
, a new DeadlineMessage will be created using the
payload and meta data of the given deadline.
Otherwise, the given messageOrPayload
is wrapped into a GenericDeadlineMessage as its payload.T
- The generic type of the expected payload of the resulting objectdeadlineName
- A String
denoting the deadline's namemessageOrPayload
- A Message
or payload to wrap as a DeadlineMessagedeadlineName
as its deadline name and containing the given
messageOrPayload
as the payloadpublic static <T> DeadlineMessage<T> asDeadlineMessage(@Nonnull String deadlineName, @Nullable Object messageOrPayload, @Nonnull Instant expiryTime)
deadlineName
and messageOrPayload
as a DeadlineMessage which expires at the
given expiryTime
. If the messageOrPayload
parameter is of type Message
, a new
DeadlineMessage
instance will be created using the payload and meta data of the given message.
Otherwise, the given messageOrPayload
is wrapped into a GenericDeadlineMessage
as its payload.T
- The generic type of the expected payload of the resulting objectdeadlineName
- A String
denoting the deadline's namemessageOrPayload
- A Message
or payload to wrap as a DeadlineMessageexpiryTime
- The timestamp at which the deadline expiresdeadlineName
as its deadline name and containing the given
messageOrPayload
as the payloadpublic String getDeadlineName()
DeadlineMessage
String
representing the name of this DeadlineMessage.getDeadlineName
in interface DeadlineMessage<T>
String
representing the name of this DeadlineMessagepublic GenericDeadlineMessage<T> withMetaData(@Nonnull Map<String,?> metaData)
EventMessage
metaData
. The payload, Timestamp
and Identifier
remain unchanged.withMetaData
in interface DeadlineMessage<T>
withMetaData
in interface EventMessage<T>
withMetaData
in interface Message<T>
withMetaData
in class GenericEventMessage<T>
metaData
- The new MetaData for the Messagepublic GenericDeadlineMessage<T> andMetaData(@Nonnull Map<String,?> additionalMetaData)
EventMessage
metaData
. The payload, Timestamp
and Identifier
remain unchanged.andMetaData
in interface DeadlineMessage<T>
andMetaData
in interface EventMessage<T>
andMetaData
in interface Message<T>
andMetaData
in class GenericEventMessage<T>
additionalMetaData
- The MetaData to merge withprotected String describeType()
MessageDecorator
MessageDecorator.toString()
.
Defaults to the simple class name of the actual instance.
describeType
in class GenericEventMessage<T>
Copyright © 2010–2024. All rights reserved.