RDAP: Use IANA identifier as the registrar handle

According to the ICAAN operation profile:

2.1.7. Registries MUST support lookup for entities with the registrar role within other objects using the handle (as described in 3.1.5 of RFC7482). The handle of the entity with the registrar role MUST be equal to IANA Registrar ID. The entity with the registrar role in the RDAP response MUST contain a publicIDs member to identify the IANA Registrar ID from the IANA’s Registrar ID registry. The type value of the publicID object MUST be equal to IANA Registrar ID.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=130452501
This commit is contained in:
mountford 2016-08-16 15:09:29 -07:00 committed by Ben McIlwain
parent 27820c512e
commit 4a34807b1d
10 changed files with 114 additions and 53 deletions

View file

@ -286,6 +286,7 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
* </ul>
* @see "http://www.iana.org/assignments/registrar-ids/registrar-ids.txt"
*/
@Index
Long ianaIdentifier;
/** Identifier of registrar used in external billing system (e.g. Oracle). */
@ -840,6 +841,29 @@ public class Registrar extends ImmutableObject implements Buildable, Jsonifiable
}});
}
/**
* Load registrar entities by IANA identifier range outside of a transaction.
*
* @param ianaIdentifierStart returned registrars will have an IANA id greater than or equal to
* this
* @param ianaIdentifierAfterEnd returned registrars will have an IANA id less than this
* @param resultSetMaxSize the maximum number of registrar entities to be returned
*/
public static Iterable<Registrar> loadByIanaIdentifierRange(
final Long ianaIdentifierStart,
final Long ianaIdentifierAfterEnd,
final int resultSetMaxSize) {
return ofy().doTransactionless(new Work<Iterable<Registrar>>() {
@Override
public Iterable<Registrar> run() {
return ofy().load()
.type(Registrar.class)
.filter("ianaIdentifier >=", ianaIdentifierStart)
.filter("ianaIdentifier <", ianaIdentifierAfterEnd)
.limit(resultSetMaxSize);
}});
}
/** Loads all registrar entities. */
public static Iterable<Registrar> loadAll() {
return ofy().load().type(Registrar.class).ancestor(getCrossTldKey());