Class EventsourcingInstanceRepository
java.lang.Object
de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository
- All Implemented Interfaces:
InstanceRepository
- Direct Known Subclasses:
SnapshottingInstanceRepository
InstanceRepository storing instances using an event log.
- Author:
- Johannes Edmeier
-
Constructor Summary
Constructors -
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
-
Constructor Details
-
EventsourcingInstanceRepository
-
-
Method Details
-
save
Description copied from interface:InstanceRepositorySaves the Instance- Specified by:
savein interfaceInstanceRepository- Parameters:
instance- instance to save- Returns:
- the saved instance
-
findAll
- Specified by:
findAllin interfaceInstanceRepository- Returns:
- all instances in the repository;
-
find
- Specified by:
findin interfaceInstanceRepository- Parameters:
id- the instances id- Returns:
- the instance with the specified id;
-
findByName
- Specified by:
findByNamein interfaceInstanceRepository- Parameters:
name- the instances name- Returns:
- all instance with the specified name;
-
compute
public reactor.core.publisher.Mono<Instance> compute(InstanceId id, BiFunction<InstanceId, Instance, reactor.core.publisher.Mono<Instance>> remappingFunction) Description copied from interface:InstanceRepositoryUpdates 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.- Specified by:
computein interfaceInstanceRepository- Parameters:
id- instance to updateremappingFunction- function to apply- Returns:
- the saved istance
-
computeIfPresent
public reactor.core.publisher.Mono<Instance> computeIfPresent(InstanceId id, BiFunction<InstanceId, Instance, reactor.core.publisher.Mono<Instance>> remappingFunction) Description copied from interface:InstanceRepositoryUpdates the instance associated with the id using the remapping function. If there is no associated instance the function will not be called.- Specified by:
computeIfPresentin interfaceInstanceRepository- Parameters:
id- instance to updateremappingFunction- function to apply- Returns:
- the saved istance
-