Class RdeUtils

java.lang.Object
google.registry.rde.RdeUtils

public final class RdeUtils extends Object
Helper methods for RDE.
  • Method Details

    • peekWatermark

      public static org.joda.time.DateTime peekWatermark(BufferedInputStream xmlInput) throws IOException, XmlException
      Look at some bytes from xmlInput to ensure it appears to be a FULL XML deposit and then use a regular expression to extract the watermark timestamp which is returned.
      Throws:
      IOException
      XmlException
    • findMostRecentPrefixForWatermark

      public static String findMostRecentPrefixForWatermark(org.joda.time.DateTime watermark, String bucket, String tld, GcsUtils gcsUtils) throws HttpException.NoContentException
      Find the most recent folder in the given GCS bucket for the given watermark.
      Throws:
      HttpException.NoContentException
    • timestampToId

      public static String timestampToId(org.joda.time.ReadableInstant timestamp)
      Generates an ID matching the regex \w{1,13} from a millisecond timestamp.

      This routine works by turning the number of UTC milliseconds from the UNIX epoch into a big-endian byte-array which is then converted to a base32 string without padding that's no longer than 13 chars because 13 = Ceiling[Log[32, 2^64]]. How lucky!