public void process()

in service/src/main/java/org/apache/fineract/cn/rhythm/service/internal/command/handler/ClockOffsetCommandHandler.java [63:85]


  public void process(final ChangeClockOffsetCommand changeClockOffsetCommand) {

    final Optional<ClockOffsetEntity> oldClockOffsetEntity =
        clockOffsetRepository.findByTenantIdentifier(changeClockOffsetCommand.getTenantIdentifier());

    final ClockOffsetEntity newOffsetEntity = ClockOffsetMapper.map(
        changeClockOffsetCommand.getTenantIdentifier(),
        changeClockOffsetCommand.getInstance(),
        oldClockOffsetEntity);

    clockOffsetRepository.save(newOffsetEntity);

    drummer.realignAllBeatsForTenant(
        changeClockOffsetCommand.getTenantIdentifier(),
        oldClockOffsetEntity.orElseGet(ClockOffsetEntity::new),
        newOffsetEntity);

    logger.info("Sending change clock offset event.");
    eventHelper.sendEvent(
        EventConstants.PUT_CLOCKOFFSET,
        changeClockOffsetCommand.getTenantIdentifier(),
        changeClockOffsetCommand.getInstance());
  }