Class GrpcTransformationStream
- java.lang.Object
-
- io.axoniq.axonserver.connector.event.transformation.impl.grpc.GrpcTransformationStream
-
- All Implemented Interfaces:
EventTransformationService.TransformationStream
public class GrpcTransformationStream extends Object implements EventTransformationService.TransformationStream
- Since:
- 2023.0.0
- Author:
- Sara Pellegrini
-
-
Constructor Summary
Constructors Constructor Description GrpcTransformationStream(String transformationId, io.grpc.stub.StreamObserver<TransformRequest> requestStreamObserver, Consumer<Consumer<Long>> ackListenerRegistration, Consumer<Consumer<Throwable>> onCompleteRegistration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomplete()Completes the stream.CompletableFuture<Void>deleteEvent(long token, long sequence)Registers the request to delete the event with the specified token.voidonCompletedByServer(Consumer<Throwable> onCompleted)Resister a callback function that is invoked when the stream is completed by Axon Server.CompletableFuture<Void>replaceEvent(long token, Event event, long sequence)Registers the request to replace the event with the specified token.
-
-
-
Method Detail
-
deleteEvent
public CompletableFuture<Void> deleteEvent(long token, long sequence)
Description copied from interface:EventTransformationService.TransformationStreamRegisters the request to delete the event with the specified token.- Specified by:
deleteEventin interfaceEventTransformationService.TransformationStream- Parameters:
token- the token of the event to be deletedsequence- the expected last sequence of the transformation, used to check that no change request before this one has been lost- Returns:
- a
CompletableFuturethat completes when the request has been received by Axon Server.
-
replaceEvent
public CompletableFuture<Void> replaceEvent(long token, Event event, long sequence)
Description copied from interface:EventTransformationService.TransformationStreamRegisters the request to replace the event with the specified token.- Specified by:
replaceEventin interfaceEventTransformationService.TransformationStream- Parameters:
token- the token of the event to be replacedevent- the new version of the event, to be used as a replacement for the original onesequence- the expected last sequence of the transformation, used to check that no change request before this one has been lost- Returns:
- a
CompletableFuturethat completes when the request has been received by Axon Server.
-
complete
public void complete()
Description copied from interface:EventTransformationService.TransformationStreamCompletes the stream.- Specified by:
completein interfaceEventTransformationService.TransformationStream
-
onCompletedByServer
public void onCompletedByServer(Consumer<Throwable> onCompleted)
Description copied from interface:EventTransformationService.TransformationStreamResister a callback function that is invoked when the stream is completed by Axon Server.- Specified by:
onCompletedByServerin interfaceEventTransformationService.TransformationStream- Parameters:
onCompleted- the callback function invoked when the stream is completed by Axon Server.
-
-