Class ConsulClient
java.lang.Object
org.qubership.integration.platform.variables.management.consul.ConsulClient
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConsulClient(org.springframework.web.client.RestTemplate restTemplate, String consulUrl) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateOrUpdateKV(String key, Object value) voidvoidvoiddeleteKVsInTransaction(List<String> keys) getKVsInTransaction(List<String> keys) Throws ConsulException if at least one key in a list is not present in consulorg.apache.commons.lang3.tuple.Pair<Long, List<KeyResponse>> waitForKVChanges(String key, boolean recurse, long index, String waitTimeout)
-
Field Details
-
MAX_TXN_SIZE
public static final int MAX_TXN_SIZE- See Also:
-
CONSUL_TOKEN_HEADER
- See Also:
-
CONSUL_INDEX_HEADER
- See Also:
-
CONSUL_KV_PATH
- See Also:
-
CONSUL_TXN_PATH
- See Also:
-
CONSUL_KV_QUERY_PARAMS
- See Also:
-
CONSUL_KV_DELETE_PARAMS
- See Also:
-
-
Constructor Details
-
ConsulClient
@Autowired public ConsulClient(@Qualifier("restTemplateMS") org.springframework.web.client.RestTemplate restTemplate, @Value("${consul.url}") String consulUrl)
-
-
Method Details
-
getKV
- Throws:
KVNotFoundException
-
getKVsInTransaction
Throws ConsulException if at least one key in a list is not present in consul- Parameters:
keys- path without leading slash (e.g. 'config/test/key')- Throws:
ConsulException
-
createOrUpdateKV
-
createOrUpdateKVsInTransaction
- Parameters:
map- key/value mapping, key - path without a leading slash (e.g. 'config/test/key')
-
deleteKV
-
deleteKVsInTransaction
- Parameters:
keys- path without leading slash (e.g. 'config/test/key')
-
waitForKVChanges
public org.apache.commons.lang3.tuple.Pair<Long,List<KeyResponse>> waitForKVChanges(String key, boolean recurse, long index, String waitTimeout) throws KVNotFoundException - Throws:
KVNotFoundException
-