java.lang.Comparable<BaseRecord>DisabledNameservice, MembershipState, MembershipStats, MountTable, RouterState, StateStoreVersionpublic abstract class BaseRecord extends java.lang.Object implements java.lang.Comparable<BaseRecord>
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
ERROR_MSG_CREATION_TIME_NEGATIVE |
|
static java.lang.String |
ERROR_MSG_MODIFICATION_TIME_NEGATIVE |
| Constructor | Description |
|---|---|
BaseRecord() |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
checkExpired(long currentTime) |
Called when the modification time and current time is available, checks for
expirations.
|
int |
compareTo(BaseRecord record) |
|
boolean |
equals(java.lang.Object obj) |
Override equals check to use primary key(s) for comparison.
|
protected static java.lang.String |
generateMashupKey(java.util.Map<java.lang.String,java.lang.String> keys) |
Generates a cache key from a map of values.
|
abstract long |
getDateCreated() |
Get the creation time for the record.
|
abstract long |
getDateModified() |
Get the modification time for the record.
|
long |
getDeletionMs() |
Get the deletion time for the expired record.
|
abstract long |
getExpirationMs() |
Get the expiration time for the record.
|
java.lang.String |
getPrimaryKey() |
Join the primary keys into one single primary key.
|
abstract java.util.Map<java.lang.String,java.lang.String> |
getPrimaryKeys() |
Map of primary key names to values for the record.
|
int |
hashCode() |
Override hash code to use primary key(s) for comparison.
|
boolean |
hasOtherFields() |
If the record has fields others than the primary keys.
|
void |
init() |
Initialize the object.
|
boolean |
isExpired() |
Check if this record is expired.
|
boolean |
like(BaseRecord other) |
Check if this record matches a partial record.
|
abstract void |
setDateCreated(long time) |
Set the creation time for the record.
|
abstract void |
setDateModified(long time) |
Set the modification time for the record.
|
boolean |
shouldBeDeleted(long currentTime) |
Called when this record is expired and expired deletion is enabled, checks
for the deletion.
|
java.lang.String |
toString() |
|
void |
validate() |
Validates the record.
|
public static final java.lang.String ERROR_MSG_CREATION_TIME_NEGATIVE
public static final java.lang.String ERROR_MSG_MODIFICATION_TIME_NEGATIVE
public abstract void setDateModified(long time)
time - Modification time of the record.public abstract long getDateModified()
public abstract void setDateCreated(long time)
time - Creation time of the record.public abstract long getDateCreated()
public abstract long getExpirationMs()
public boolean isExpired()
public long getDeletionMs()
public abstract java.util.Map<java.lang.String,java.lang.String> getPrimaryKeys()
public void init()
public java.lang.String getPrimaryKey()
@VisibleForTesting public boolean hasOtherFields()
protected static java.lang.String generateMashupKey(java.util.Map<java.lang.String,java.lang.String> keys)
keys - Map of values.public boolean like(BaseRecord other)
other - Partial record.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int compareTo(BaseRecord record)
compareTo in interface java.lang.Comparable<BaseRecord>public boolean checkExpired(long currentTime)
currentTime - The current timestamp in ms from the data store, to be
compared against the modification and creation dates of the
object.public boolean shouldBeDeleted(long currentTime)
currentTime - The current timestamp in ms from the data store, to be
compared against the modification and creation dates of the
object.public void validate()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2008–2025 Apache Software Foundation. All rights reserved.