/** * Retrieves a list of string values for a specific key from the key/value * store. * * GET /v1/kv/{key}?recurse * * @param key The key to retrieve. * @return A list of zero to many string values. */ public List<String> getValuesAsString(String key) { return getValuesAsString(key, Charset.defaultCharset()); }
@InvokeOnHeader(ConsulKeyValueActions.GET_VALUES) protected void getValues(Message message) throws Exception { Object result; Boolean asString = message.getHeader(ConsulConstants.CONSUL_VALUE_AS_STRING, getConfiguration().isValueAsString(), Boolean.class); if (asString) { result = getClient().getValuesAsString( getMandatoryHeader(message, ConsulConstants.CONSUL_KEY, getConfiguration().getKey(), String.class) ); } else { result = getClient().getValues( getMandatoryHeader(message, ConsulConstants.CONSUL_KEY, getConfiguration().getKey(), String.class), message.getHeader(ConsulConstants.CONSUL_OPTIONS, QueryOptions.BLANK, QueryOptions.class) ); } setBodyAndResult(message, result); }