mirror of
https://github.com/google/nomulus.git
synced 2025-06-26 14:24:55 +02:00
Conform to RDAP Technical Implementation Guide
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=251864499
This commit is contained in:
parent
55dc735ba0
commit
ca1d525e28
65 changed files with 869 additions and 709 deletions
|
@ -14,6 +14,7 @@
|
|||
|
||||
package google.registry.rdap;
|
||||
|
||||
import com.google.common.base.Ascii;
|
||||
import com.google.common.collect.Streams;
|
||||
import google.registry.model.registrar.Registrar;
|
||||
import java.util.Objects;
|
||||
|
@ -30,4 +31,17 @@ public final class RdapUtils {
|
|||
.filter(registrar -> Objects.equals(ianaIdentifier, registrar.getIanaIdentifier()))
|
||||
.findFirst();
|
||||
}
|
||||
|
||||
/**
|
||||
* Looks up a registrar by its name.
|
||||
*
|
||||
* <p>Used for RDAP Technical Implementation Guide 2.4.2 - search of registrar by the fn element.
|
||||
*
|
||||
* <p>For convenience, we use case insensitive search.
|
||||
*/
|
||||
static Optional<Registrar> getRegistrarByName(String registrarName) {
|
||||
return Streams.stream(Registrar.loadAllCached())
|
||||
.filter(registrar -> Ascii.equalsIgnoreCase(registrarName, registrar.getRegistrarName()))
|
||||
.findFirst();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue