public class EventService extends Object
Modifier and Type | Field and Description |
---|---|
protected com.ecwid.consul.v1.ConsulClient |
consul |
protected com.fasterxml.jackson.databind.ObjectMapper |
objectMapper |
protected ConsulBinderProperties |
properties |
Constructor and Description |
---|
EventService(ConsulBinderProperties properties,
com.ecwid.consul.v1.ConsulClient consul,
com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
Modifier and Type | Method and Description |
---|---|
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 .
|
com.ecwid.consul.v1.event.model.Event |
fire(String name,
String payload) |
com.ecwid.consul.v1.ConsulClient |
getConsulClient() |
List<com.ecwid.consul.v1.event.model.Event> |
getEvents() |
List<com.ecwid.consul.v1.event.model.Event> |
getEvents(Long lastIndex) |
com.ecwid.consul.v1.Response<List<com.ecwid.consul.v1.event.model.Event>> |
getEventsResponse() |
Long |
getLastIndex() |
void |
init() |
protected List<com.ecwid.consul.v1.event.model.Event> |
readEvents(com.ecwid.consul.v1.Response<List<com.ecwid.consul.v1.event.model.Event>> response) |
List<com.ecwid.consul.v1.event.model.Event> |
watch() |
List<com.ecwid.consul.v1.event.model.Event> |
watch(Long lastIndex) |
protected ConsulBinderProperties properties
protected com.ecwid.consul.v1.ConsulClient consul
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
public EventService(ConsulBinderProperties properties, com.ecwid.consul.v1.ConsulClient consul, com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public com.ecwid.consul.v1.ConsulClient getConsulClient()
@PostConstruct public void init()
public Long getLastIndex()
public com.ecwid.consul.v1.Response<List<com.ecwid.consul.v1.event.model.Event>> getEventsResponse()
public List<com.ecwid.consul.v1.event.model.Event> getEvents()
public List<com.ecwid.consul.v1.event.model.Event> watch()
protected List<com.ecwid.consul.v1.event.model.Event> readEvents(com.ecwid.consul.v1.Response<List<com.ecwid.consul.v1.event.model.Event>> response)
protected List<com.ecwid.consul.v1.event.model.Event> filterEvents(List<com.ecwid.consul.v1.event.model.Event> toFilter, Long lastIndex)
toFilter
- events to filterlastIndex
- last index to pick from the list of eventsCopyright © 2019 Pivotal Software, Inc.. All rights reserved.