Class EventsourcingInstanceRepository

java.lang.Object
de.codecentric.boot.admin.server.domain.entities.EventsourcingInstanceRepository
All Implemented Interfaces:
InstanceRepository
Direct Known Subclasses:
SnapshottingInstanceRepository

public class EventsourcingInstanceRepository extends Object implements InstanceRepository
InstanceRepository storing instances using an event log.
Author:
Johannes Edmeier
  • Constructor Details

    • EventsourcingInstanceRepository

      public EventsourcingInstanceRepository(InstanceEventStore eventStore)
  • Method Details

    • save

      public reactor.core.publisher.Mono<Instance> save(Instance instance)
      Description copied from interface: InstanceRepository
      Saves the Instance
      Specified by:
      save in interface InstanceRepository
      Parameters:
      instance - instance to save
      Returns:
      the saved instance
    • findAll

      public reactor.core.publisher.Flux<Instance> findAll()
      Specified by:
      findAll in interface InstanceRepository
      Returns:
      all instances in the repository;
    • find

      public reactor.core.publisher.Mono<Instance> find(InstanceId id)
      Specified by:
      find in interface InstanceRepository
      Parameters:
      id - the instances id
      Returns:
      the instance with the specified id;
    • findByName

      public reactor.core.publisher.Flux<Instance> findByName(String name)
      Specified by:
      findByName in interface InstanceRepository
      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: InstanceRepository
      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.
      Specified by:
      compute in interface InstanceRepository
      Parameters:
      id - instance to update
      remappingFunction - 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: InstanceRepository
      Updates the instance associated with the id using the remapping function. If there is no associated instance the function will not be called.
      Specified by:
      computeIfPresent in interface InstanceRepository
      Parameters:
      id - instance to update
      remappingFunction - function to apply
      Returns:
      the saved istance