Interface InstanceRepository
- All Known Implementing Classes:
EventsourcingInstanceRepository,SnapshottingInstanceRepository
public interface InstanceRepository
Responsible for storing instances.
- Author:
- Johannes Edmeier
-
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Instance>compute(InstanceId id, BiFunction<InstanceId, Instance, reactor.core.publisher.Mono<Instance>> remappingFunction) Updates the instance associated with the id using the remapping function.reactor.core.publisher.Mono<Instance>computeIfPresent(InstanceId id, BiFunction<InstanceId, Instance, reactor.core.publisher.Mono<Instance>> remappingFunction) Updates the instance associated with the id using the remapping function.reactor.core.publisher.Mono<Instance>find(InstanceId id) reactor.core.publisher.Flux<Instance>findAll()reactor.core.publisher.Flux<Instance>findByName(String name) reactor.core.publisher.Mono<Instance>Saves the Instance
-
Method Details
-
save
Saves the Instance- Parameters:
app- instance to save- Returns:
- the saved instance
-
findAll
reactor.core.publisher.Flux<Instance> findAll()- Returns:
- all instances in the repository;
-
find
- Parameters:
id- the instances id- Returns:
- the instance with the specified id;
-
findByName
- Parameters:
name- the instances name- Returns:
- all instance with the specified name;
-
compute
reactor.core.publisher.Mono<Instance> compute(InstanceId id, BiFunction<InstanceId, Instance, reactor.core.publisher.Mono<Instance>> remappingFunction) Updates the instance associated with the id using the remapping function. If there is no associated instance the function will be called with the id and null.- Parameters:
id- instance to updateremappingFunction- function to apply- Returns:
- the saved istance
-
computeIfPresent
reactor.core.publisher.Mono<Instance> computeIfPresent(InstanceId id, BiFunction<InstanceId, Instance, reactor.core.publisher.Mono<Instance>> remappingFunction) Updates the instance associated with the id using the remapping function. If there is no associated instance the function will not be called.- Parameters:
id- instance to updateremappingFunction- function to apply- Returns:
- the saved istance
-