return (OUT) badRequest(response, "Invalid prefix: not in key range (%s) of node",
_cluster.getLocalState().totalRange());
}
// Then extract 'lastSeen', if it's passed:
StorableKey lastSeen = null;
String b64str = request.getQueryParameter(ClusterMateConstants.QUERY_PARAM_LAST_SEEN);
if (b64str != null && b64str.length() > 0) {
try {
// Jackson can do base64 decoding, and this is the easiest way
byte[] lastSeenRaw = _objectMapper.convertValue(b64str, byte[].class);
lastSeen = new StorableKey(lastSeenRaw);
} catch (Exception e) {
return (OUT) badRequest(response, "Invalid '"+ClusterMateConstants.QUERY_PARAM_LAST_SEEN
+"' value; not valid base64 encoded byte sequence");
}
}
// Otherwise can start listing
boolean useSmile = _acceptSmileContentType(request);
final StorableKey rawPrefix = prefix.asStorableKey();
ListLimits limits = DEFAULT_LIST_LIMITS;
String maxStr = request.getQueryParameter(ClusterMateConstants.QUERY_PARAM_MAX_ENTRIES);
if (maxStr != null) {
limits = limits.withMaxEntries(_decodeInt(maxStr, limits.getMaxEntries()));