Class AllocationTokenFlowUtils


  • public class AllocationTokenFlowUtils
    extends java.lang.Object
    Utility functions for dealing with AllocationTokens in domain flows.
    • Method Detail

      • checkDomainsWithToken

        public AllocationTokenDomainCheckResults checkDomainsWithToken​(java.util.List<com.google.common.net.InternetDomainName> domainNames,
                                                                       java.lang.String token,
                                                                       java.lang.String registrarId,
                                                                       org.joda.time.DateTime now)
        Checks if the allocation token applies to the given domain names, used for domain checks.
        Returns:
        A map of domain names to domain check error response messages. If a message is present for a a given domain then it does not validate with this allocation token; domains that do validate have blank messages (i.e. no error).
      • validateToken

        public static void validateToken​(com.google.common.net.InternetDomainName domainName,
                                         AllocationToken token,
                                         java.lang.String registrarId,
                                         org.joda.time.DateTime now)
                                  throws EppException
        Validates a given token. The token could be invalid if it has allowed client IDs or TLDs that do not include this client ID / TLD, or if the token has a promotion that is not currently running.
        Throws:
        EppException - if the token is invalid in any way
      • verifyAllocationTokenIfPresent

        public java.util.Optional<AllocationToken> verifyAllocationTokenIfPresent​(Domain existingDomain,
                                                                                  Registry registry,
                                                                                  java.lang.String registrarId,
                                                                                  org.joda.time.DateTime now,
                                                                                  java.util.Optional<AllocationTokenExtension> extension)
                                                                           throws EppException
        Verifies and returns the allocation token if one is specified, otherwise does nothing.
        Throws:
        EppException
      • maybeApplyPackageRemovalToken

        public static Domain maybeApplyPackageRemovalToken​(Domain domain,
                                                           java.util.Optional<AllocationToken> allocationToken)