Package google.registry.model.poll
Class PollMessageExternalKeyConverter
- java.lang.Object
-
- google.registry.model.poll.PollMessageExternalKeyConverter
-
public final class PollMessageExternalKeyConverter extends java.lang.Object
A converter between external key strings forPollMessage
s (i.e. what registrars use to identify and ACK them) andVKey
s to the resource.The format of the key string is A-B as follows:
A = PollMessage.id (decimal) B = PollMessage.eventTime (decimal, year only)
A typical poll message ID might thus look like: 10072612074-2018
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PollMessageExternalKeyConverter.PollMessageExternalKeyParseException
An exception thrown when an external key cannot be parsed.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
makePollMessageExternalId(PollMessage pollMessage)
Returns an external poll message ID for the given poll message.static VKey<PollMessage>
parsePollMessageExternalId(java.lang.String externalKey)
Returns aVKey
to aPollMessage
corresponding with the external ID.
-
-
-
Method Detail
-
makePollMessageExternalId
public static java.lang.String makePollMessageExternalId(PollMessage pollMessage)
Returns an external poll message ID for the given poll message.
-
parsePollMessageExternalId
public static VKey<PollMessage> parsePollMessageExternalId(java.lang.String externalKey)
Returns aVKey
to aPollMessage
corresponding with the external ID.Note that the year field that is included at the end of the poll message isn't actually used for anything; it exists solely to create unique externally visible IDs for autorenews. We thus ignore it (for now) for backwards compatibility reasons, so that registrars can still ACK existing poll message IDs they may have lying around.
- Throws:
PollMessageExternalKeyConverter.PollMessageExternalKeyParseException
- if the external key has an invalid format.
-
-