The cursor token is just the Base 64 encoded value of the last data item returned. To fetch * the next page, the code can just decode the cursor, and return only data whose value is greater * than the cursor value. */ protected void decodeCursorToken() { if (!cursorTokenParam.isPresent()) { cursorString = Optional.empty(); } else { cursorString = Optional.of( new String( Base64.getDecoder().decode(cursorTokenParam.get().getBytes(UTF_8)), UTF_8)); } } /** Returns an encoded cursor token to pass back in the RDAP JSON link strings. */ protected String encodeCursorToken(String nextCursorString) { return new String(Base64.getEncoder().encode(nextCursorString.getBytes(UTF_8)), UTF_8); } /** Returns the original request URL, but with the specified parameter added or overridden. */ protected String getRequestUrlWithExtraParameter(String parameterName, String parameterValue) { return getRequestUrlWithExtraParameter(parameterName, ImmutableList.of(parameterValue)); } /** * Returns the original request URL, but with the specified parameter added or overridden. * *
This version handles a list of parameter values, all associated with the same name. * *
Example: If the original parameters were "a=w&a=x&b=y&c=z", and this method is called with
* parameterName = "b" and parameterValues of "p" and "q", the result will be
* "a=w&a=x&c=z&b=p&b=q". The new values of parameter "b" replace the old ones.
*
*/
protected String getRequestUrlWithExtraParameter(
String parameterName, List