Class GenericReplayStatusChanged
java.lang.Object
org.axonframework.messaging.core.MessageDecorator
org.axonframework.messaging.eventhandling.replay.GenericReplayStatusChanged
- All Implemented Interfaces:
Message,ReplayStatusChanged
@Internal
public class GenericReplayStatusChanged
extends MessageDecorator
implements ReplayStatusChanged
Generic implementation of the
ReplayStatusChanged interface.- Since:
- 5.1.0
- Author:
- Simon Zambrovski, Stefan Dragisic, Steven van Beelen
-
Field Summary
Fields inherited from interface org.axonframework.messaging.core.Message
RESOURCE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionGenericReplayStatusChanged(ReplayStatus status, @Nullable Object payload) Constructs aGenericReplayStatusChangefor the givenstatusandpayload.GenericReplayStatusChanged(ReplayStatus status, @Nullable Object payload, Map<String, @Nullable String> metadata) Constructs aGenericReplayStatusChangefor the givenstatus,payload, andmetadata.GenericReplayStatusChanged(ReplayStatus status, Message delegate) Constructs aGenericReplayStatusChangefor the givendelegate, intended to reconstruct anotherReplayStatusChanged. -
Method Summary
Modifier and TypeMethodDescriptionandMetadata(Map<String, @Nullable String> additionalMetadata) protected StringDescribe the type of message, used inMessageDecorator.toString().status()The status changed to as notified by this message.withConvertedPayload(Type type, Converter converter) Returns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.withMetadata(Map<String, String> metadata) Returns a copy of thisMessage(implementation) with the givenmetadata.Methods inherited from class org.axonframework.messaging.core.MessageDecorator
delegate, describeTo, identifier, metadata, payload, payloadAs, payloadAs, payloadType, toString, typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.axonframework.messaging.core.Message
identifier, metadata, payload, payloadAs, payloadAs, payloadAs, payloadAs, payloadAs, payloadType, typeMethods inherited from interface org.axonframework.messaging.eventhandling.replay.ReplayStatusChanged
withConvertedPayload, withConvertedPayload
-
Constructor Details
-
GenericReplayStatusChanged
Constructs aGenericReplayStatusChangefor the givenstatusandpayload.The
Metadatadefaults to an empty instance.- Parameters:
status- the status changed to as notified by this messagepayload- the payload for thisReplayStatusChanged
-
GenericReplayStatusChanged
public GenericReplayStatusChanged(ReplayStatus status, @Nullable Object payload, Map<String, @Nullable String> metadata) Constructs aGenericReplayStatusChangefor the givenstatus,payload, andmetadata.- Parameters:
status- the status changed to as notified by this messagepayload- the payload for thisReplayStatusChangedmetadata- the metadata for thisReplayStatusChanged
-
GenericReplayStatusChanged
Constructs aGenericReplayStatusChangefor the givendelegate, intended to reconstruct anotherReplayStatusChanged.Unlike the other constructors, this constructor will not attempt to retrieve any correlation data from the Unit of Work.
- Parameters:
status- the status changed to as notified by this messagedelegate- theMessagecontainingpayload,type,identifierandmetadatafor theEventMessageto reconstruct
-
-
Method Details
-
status
Description copied from interface:ReplayStatusChangedThe status changed to as notified by this message.- Specified by:
statusin interfaceReplayStatusChanged- Returns:
- the status changed to as notified by this message
-
withMetadata
Description copied from interface:MessageReturns a copy of thisMessage(implementation) with the givenmetadata.All other fields, like for example the
Message.payload(), remain unchanged.While the implementation returned may be different from the implementation of
this, implementations must take special care in returning the same type ofMessageto prevent errors further downstream.- Specified by:
withMetadatain interfaceMessage- Specified by:
withMetadatain interfaceReplayStatusChanged- Parameters:
metadata- The new metadata for theMessage.- Returns:
- A copy of
this Message (implementation)with the givenmetadata.
-
andMetadata
Description copied from interface:MessageReturns a copy of thisMessage(implementation) with itsmetadatamerged with the givenmetadata.All other fields, like for example the
Message.payload(), remain unchanged.- Specified by:
andMetadatain interfaceMessage- Specified by:
andMetadatain interfaceReplayStatusChanged- Parameters:
additionalMetadata- The metadata to merge with.- Returns:
- A copy of
this Message (implementation)with the givenmetadata.
-
withConvertedPayload
Description copied from interface:MessageReturns a newMessageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter. This newMessageis effectively a copy ofthis Messagewith a renewed payload andMessage.payloadType().Will return the
thisinstance if thepayload typeisassignable fromthe converted result.- Specified by:
withConvertedPayloadin interfaceMessage- Specified by:
withConvertedPayloadin interfaceReplayStatusChanged- Overrides:
withConvertedPayloadin classMessageDecorator- Parameters:
type- The type to convert theMessage.payload()to.converter- The converter to convert theMessage.payload()with.- Returns:
- A new
Messageimplementation with itsMessage.payload()converted to the giventypeby the givenconverter.
-
describeType
Description copied from class:MessageDecoratorDescribe the type of message, used inMessageDecorator.toString().Defaults to the simple class name of the actual instance.
- Overrides:
describeTypein classMessageDecorator- Returns:
- The type of the message.
-