mirror of
https://github.com/google/nomulus.git
synced 2025-05-21 11:49:37 +02:00
Add next page navigation for RDAP nameserver searches
Domain and entity searches will be handled in future CLs. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=178912832
This commit is contained in:
parent
7dc224627f
commit
359bab291b
12 changed files with 486 additions and 62 deletions
|
@ -20,6 +20,7 @@ import static google.registry.rdap.RdapIcannStandardInformation.TRUNCATION_NOTIC
|
|||
import com.google.auto.value.AutoValue;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* Holds domain, nameserver and entity search results.
|
||||
|
@ -46,13 +47,14 @@ abstract class RdapSearchResults {
|
|||
}
|
||||
|
||||
static RdapSearchResults create(ImmutableList<ImmutableMap<String, Object>> jsonList) {
|
||||
return create(jsonList, IncompletenessWarningType.COMPLETE);
|
||||
return create(jsonList, IncompletenessWarningType.COMPLETE, Optional.empty());
|
||||
}
|
||||
|
||||
static RdapSearchResults create(
|
||||
ImmutableList<ImmutableMap<String, Object>> jsonList,
|
||||
IncompletenessWarningType incompletenessWarningType) {
|
||||
return new AutoValue_RdapSearchResults(jsonList, incompletenessWarningType);
|
||||
IncompletenessWarningType incompletenessWarningType,
|
||||
Optional<String> nextCursor) {
|
||||
return new AutoValue_RdapSearchResults(jsonList, incompletenessWarningType, nextCursor);
|
||||
}
|
||||
|
||||
/** List of JSON result object representations. */
|
||||
|
@ -61,6 +63,9 @@ abstract class RdapSearchResults {
|
|||
/** Type of warning to display regarding possible incomplete data. */
|
||||
abstract IncompletenessWarningType incompletenessWarningType();
|
||||
|
||||
/** Cursor for fetching the next page of results, or empty() if there are no more. */
|
||||
abstract Optional<String> nextCursor();
|
||||
|
||||
/** Convenience method to get the appropriate warnings for the incompleteness warning type. */
|
||||
ImmutableList<ImmutableMap<String, Object>> getIncompletenessWarnings() {
|
||||
if (incompletenessWarningType() == IncompletenessWarningType.TRUNCATED) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue