Class TranslationCountEndpoint

java.lang.Object
lv.id.jc.piglatin.actuator.TranslationCountEndpoint

@Component @Endpoint(id="counter") public class TranslationCountEndpoint extends Object
This class represents an endpoint for counting translations. It provides methods for reading, setting, and resetting the translation count.
  • Constructor Details

    • TranslationCountEndpoint

      public TranslationCountEndpoint(@Qualifier("translationCounter") AtomicInteger counterService)
  • Method Details

    • count

      @ReadOperation public Map<String,Integer> count()
      Retrieves the current count of translations.
      Returns:
      A Map containing the count of translations. The key "count" maps to the current count value.
    • set

      @WriteOperation public Map<String,Integer> set(int count)
      Sets the translation counts to the specified value.
      Parameters:
      count - The new count value.
      Returns:
      A Map containing the updated count of translations. The key "count" maps to the new count value.
    • reset

      @DeleteOperation public void reset()
      Resets the translation counts to zero.