Package google.registry.model.common
Class Cursor
- java.lang.Object
-
- google.registry.model.ImmutableObject
-
- google.registry.model.UpdateAutoTimestampEntity
-
- google.registry.model.common.Cursor
-
- All Implemented Interfaces:
UnsafeSerializable
,java.io.Serializable
,java.lang.Cloneable
@Entity public class Cursor extends UpdateAutoTimestampEntity
Shared entity for date cursors.This type supports both "scoped" cursors (i.e. one per TLD) and global (i.e. one per environment) cursors.
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Cursor.CursorId
static class
Cursor.CursorType
The types of cursors, used as the string id field for each cursor in the database.-
Nested classes/interfaces inherited from class google.registry.model.ImmutableObject
ImmutableObject.DoNotHydrate, ImmutableObject.IgnoredInDiffableMap, ImmutableObject.Insignificant
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
GLOBAL
The scope of a global cursor.-
Fields inherited from class google.registry.model.ImmutableObject
hashCode
-
-
Constructor Summary
Constructors Constructor Description Cursor()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Cursor
createGlobal(Cursor.CursorType cursorType, org.joda.time.DateTime cursorTime)
Creates a new global cursor instance.static VKey<Cursor>
createGlobalVKey(Cursor.CursorType type)
static Cursor
createScoped(Cursor.CursorType cursorType, org.joda.time.DateTime cursorTime, Tld scope)
Creates a new cursor instance with a givenTld
scope.static VKey<Cursor>
createScopedVKey(Cursor.CursorType type, Tld tld)
VKey<Cursor>
createVKey()
org.joda.time.DateTime
getCursorTime()
static org.joda.time.DateTime
getCursorTimeOrStartOfTime(java.util.Optional<Cursor> cursor)
Returns the current time for a given cursor, orSTART_OF_TIME
if the cursor is null.org.joda.time.DateTime
getLastUpdateTime()
java.lang.String
getScope()
Cursor.CursorType
getType()
-
Methods inherited from class google.registry.model.UpdateAutoTimestampEntity
copyUpdateTimestamp, getUpdateTimestamp, resetUpdateTimestamp, setUpdateTimestamp
-
Methods inherited from class google.registry.model.ImmutableObject
clone, cloneEmptyToNull, equals, getSignificantFields, hashCode, toDiffableFieldMap, toHydratedString, toString, toStringHelper
-
-
-
-
Field Detail
-
GLOBAL
public static final java.lang.String GLOBAL
The scope of a global cursor. A global cursor is a cursor that is not specific to one tld.- See Also:
- Constant Field Values
-
-
Method Detail
-
createVKey
public VKey<Cursor> createVKey()
- Overrides:
createVKey
in classImmutableObject
-
createGlobalVKey
public static VKey<Cursor> createGlobalVKey(Cursor.CursorType type)
-
createScopedVKey
public static VKey<Cursor> createScopedVKey(Cursor.CursorType type, Tld tld)
-
getLastUpdateTime
public org.joda.time.DateTime getLastUpdateTime()
-
getScope
public java.lang.String getScope()
-
getType
public Cursor.CursorType getType()
-
createGlobal
public static Cursor createGlobal(Cursor.CursorType cursorType, org.joda.time.DateTime cursorTime)
Creates a new global cursor instance.
-
createScoped
public static Cursor createScoped(Cursor.CursorType cursorType, org.joda.time.DateTime cursorTime, Tld scope)
Creates a new cursor instance with a givenTld
scope.
-
getCursorTimeOrStartOfTime
public static org.joda.time.DateTime getCursorTimeOrStartOfTime(java.util.Optional<Cursor> cursor)
Returns the current time for a given cursor, orSTART_OF_TIME
if the cursor is null.
-
getCursorTime
public org.joda.time.DateTime getCursorTime()
-
-