Class DHTDBValueImpl
java.lang.Object
com.biglybt.core.dht.db.impl.DHTDBValueImpl
- All Implemented Interfaces:
DHTDBValue, DHTTransportValue
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate byteprivate final byteprivate final booleanprivate DHTTransportContactprivate final byteprivate DHTTransportContactprivate longprivate byte[]private intprivate static final byte[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDHTDBValueImpl(long _creation_time, byte[] _value, int _version, DHTTransportContact _originator, DHTTransportContact _sender, boolean _local, int _flags, int _life_hours, byte _rep_control) constructor for the originator of values onlyprotectedDHTDBValueImpl(DHTTransportContact _sender, DHTTransportValue _other, boolean _local) Constructor used to generate values for relaying to other contacts or receiving a value from another contact - adjusts the sender Originator, creation time, flags and value are fixed. -
Method Summary
Modifier and TypeMethodDescriptionlongintgetFlags()intbytebytebyteprotected longbyte[]getValue()getValueForDeletion(int _version) getValueForRelay(DHTTransportContact _sender) intbooleanisLocal()protected voidreset()protected voidvoidsetFlags(byte _flags) protected voidsetOriginatorAndSender(DHTTransportContact _originator) protected voidsetStoreTime(long l)
-
Field Details
-
ZERO_LENGTH_BYTE_ARRAY
private static final byte[] ZERO_LENGTH_BYTE_ARRAY -
creation_time
private long creation_time -
value
private byte[] value -
originator
-
sender
-
local
private final boolean local -
flags
private byte flags -
life_hours
private final byte life_hours -
rep_control
private final byte rep_control -
version
private int version -
store_time
private long store_time
-
-
Constructor Details
-
DHTDBValueImpl
protected DHTDBValueImpl(long _creation_time, byte[] _value, int _version, DHTTransportContact _originator, DHTTransportContact _sender, boolean _local, int _flags, int _life_hours, byte _rep_control) constructor for the originator of values only- Parameters:
_creation_time-_value-_originator-_sender-_flags-_distance-
-
DHTDBValueImpl
Constructor used to generate values for relaying to other contacts or receiving a value from another contact - adjusts the sender Originator, creation time, flags and value are fixed.- Parameters:
_sender-_other-
-
-
Method Details
-
reset
protected void reset() -
getCreationTime
public long getCreationTime()- Specified by:
getCreationTimein interfaceDHTTransportValue
-
setCreationTime
protected void setCreationTime() -
setStoreTime
protected void setStoreTime(long l) -
getStoreTime
protected long getStoreTime() -
isLocal
public boolean isLocal()- Specified by:
isLocalin interfaceDHTTransportValue
-
getValue
public byte[] getValue()- Specified by:
getValuein interfaceDHTTransportValue
-
getVersion
public int getVersion()- Specified by:
getVersionin interfaceDHTTransportValue
-
getOriginator
- Specified by:
getOriginatorin interfaceDHTTransportValue
-
getSender
-
getFlags
public int getFlags()- Specified by:
getFlagsin interfaceDHTTransportValue
-
setFlags
public void setFlags(byte _flags) - Specified by:
setFlagsin interfaceDHTDBValue
-
getLifeTimeHours
public int getLifeTimeHours()- Specified by:
getLifeTimeHoursin interfaceDHTTransportValue
-
getReplicationControl
public byte getReplicationControl()- Specified by:
getReplicationControlin interfaceDHTTransportValue
-
getReplicationFactor
public byte getReplicationFactor()- Specified by:
getReplicationFactorin interfaceDHTTransportValue
-
getReplicationFrequencyHours
public byte getReplicationFrequencyHours()- Specified by:
getReplicationFrequencyHoursin interfaceDHTTransportValue
-
setOriginatorAndSender
-
getValueForRelay
- Specified by:
getValueForRelayin interfaceDHTDBValue
-
getValueForDeletion
-
getString
- Specified by:
getStringin interfaceDHTTransportValue
-