Class EventService

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

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

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.cloud.consul.ConsulClient
     
    protected tools.jackson.databind.ObjectMapper
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    EventService(ConsulBinderProperties properties, org.springframework.cloud.consul.ConsulClient consul, tools.jackson.databind.ObjectMapper objectMapper)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected List<org.springframework.cloud.consul.model.http.event.Event>
    filterEvents(List<org.springframework.cloud.consul.model.http.event.Event> toFilter, Long lastIndex)
    from https://github.com/hashicorp/consul/blob/master/watch/funcs.go#L169-L194 .
    org.springframework.cloud.consul.model.http.event.Event
    fire(String name, String payload)
     
    org.springframework.cloud.consul.ConsulClient
     
    List<org.springframework.cloud.consul.model.http.event.Event>
     
    List<org.springframework.cloud.consul.model.http.event.Event>
    getEvents(Long lastIndex)
     
    org.springframework.http.ResponseEntity<List<org.springframework.cloud.consul.model.http.event.Event>>
     
     
    void
     
    protected List<org.springframework.cloud.consul.model.http.event.Event>
    readEvents(org.springframework.http.ResponseEntity<List<org.springframework.cloud.consul.model.http.event.Event>> response)
     
    List<org.springframework.cloud.consul.model.http.event.Event>
     
    List<org.springframework.cloud.consul.model.http.event.Event>
    watch(Long lastIndex)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • properties

      protected ConsulBinderProperties properties
    • consul

      protected org.springframework.cloud.consul.ConsulClient consul
    • objectMapper

      protected tools.jackson.databind.ObjectMapper objectMapper
  • Constructor Details

    • EventService

      public EventService(ConsulBinderProperties properties, org.springframework.cloud.consul.ConsulClient consul, tools.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • getConsulClient

      public org.springframework.cloud.consul.ConsulClient getConsulClient()
    • init

      @PostConstruct public void init()
    • getLastIndex

      public Long getLastIndex()
    • fire

      public org.springframework.cloud.consul.model.http.event.Event fire(String name, String payload)
    • getEventsResponse

      public org.springframework.http.ResponseEntity<List<org.springframework.cloud.consul.model.http.event.Event>> getEventsResponse()
    • getEvents

      public List<org.springframework.cloud.consul.model.http.event.Event> getEvents()
    • getEvents

      public List<org.springframework.cloud.consul.model.http.event.Event> getEvents(Long lastIndex)
    • watch

      public List<org.springframework.cloud.consul.model.http.event.Event> watch()
    • watch

      public List<org.springframework.cloud.consul.model.http.event.Event> watch(Long lastIndex)
    • readEvents

      protected List<org.springframework.cloud.consul.model.http.event.Event> readEvents(org.springframework.http.ResponseEntity<List<org.springframework.cloud.consul.model.http.event.Event>> response)
    • filterEvents

      protected List<org.springframework.cloud.consul.model.http.event.Event> filterEvents(List<org.springframework.cloud.consul.model.http.event.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