Class EventService

java.lang.Object
org.springframework.cloud.consul.binder.EventService

public class EventService extends Object
Author:
Spencer Gibb
  • Field Details

    • properties

      protected ConsulBinderProperties properties
    • consul

      protected com.ecwid.consul.v1.ConsulClient consul
    • objectMapper

      protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

    • EventService

      public EventService(ConsulBinderProperties properties, com.ecwid.consul.v1.ConsulClient consul, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • getConsulClient

      public com.ecwid.consul.v1.ConsulClient getConsulClient()
    • init

      @PostConstruct public void init()
    • getLastIndex

      public Long getLastIndex()
    • fire

      public com.ecwid.consul.v1.event.model.Event fire(String name, String payload)
    • getEventsResponse

      public com.ecwid.consul.v1.Response<List<com.ecwid.consul.v1.event.model.Event>> getEventsResponse()
    • getEvents

      public List<com.ecwid.consul.v1.event.model.Event> getEvents()
    • getEvents

      public List<com.ecwid.consul.v1.event.model.Event> getEvents(Long lastIndex)
    • watch

      public List<com.ecwid.consul.v1.event.model.Event> watch()
    • watch

      public List<com.ecwid.consul.v1.event.model.Event> watch(Long lastIndex)
    • readEvents

      protected List<com.ecwid.consul.v1.event.model.Event> readEvents(com.ecwid.consul.v1.Response<List<com.ecwid.consul.v1.event.model.Event>> response)
    • filterEvents

      protected List<com.ecwid.consul.v1.event.model.Event> filterEvents(List<com.ecwid.consul.v1.event.model.Event> toFilter, Long lastIndex)
      from https://github.com/hashicorp/consul/blob/master/watch/funcs.go#L169-L194 .
      Parameters:
      toFilter - events to filter
      lastIndex - last index to pick from the list of events
      Returns:
      filtered list of events