Package com.biglybt.core.dht.db.impl
Class DHTDBValueImpl
java.lang.Object
com.biglybt.core.dht.db.impl.DHTDBValueImpl
- All Implemented Interfaces:
DHTDBValue
,DHTTransportValue
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate long
private byte
private final byte
private final boolean
private DHTTransportContact
private final byte
private DHTTransportContact
private long
private byte[]
private int
private static final byte[]
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
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 onlyprotected
DHTDBValueImpl
(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 TypeMethodDescriptionlong
int
getFlags()
int
byte
byte
byte
protected long
byte[]
getValue()
getValueForDeletion
(int _version) getValueForRelay
(DHTTransportContact _sender) int
boolean
isLocal()
protected void
reset()
protected void
void
setFlags
(byte _flags) protected void
setOriginatorAndSender
(DHTTransportContact _originator) protected void
setStoreTime
(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:
getCreationTime
in interfaceDHTTransportValue
-
setCreationTime
protected void setCreationTime() -
setStoreTime
protected void setStoreTime(long l) -
getStoreTime
protected long getStoreTime() -
isLocal
public boolean isLocal()- Specified by:
isLocal
in interfaceDHTTransportValue
-
getValue
public byte[] getValue()- Specified by:
getValue
in interfaceDHTTransportValue
-
getVersion
public int getVersion()- Specified by:
getVersion
in interfaceDHTTransportValue
-
getOriginator
- Specified by:
getOriginator
in interfaceDHTTransportValue
-
getSender
-
getFlags
public int getFlags()- Specified by:
getFlags
in interfaceDHTTransportValue
-
setFlags
public void setFlags(byte _flags) - Specified by:
setFlags
in interfaceDHTDBValue
-
getLifeTimeHours
public int getLifeTimeHours()- Specified by:
getLifeTimeHours
in interfaceDHTTransportValue
-
getReplicationControl
public byte getReplicationControl()- Specified by:
getReplicationControl
in interfaceDHTTransportValue
-
getReplicationFactor
public byte getReplicationFactor()- Specified by:
getReplicationFactor
in interfaceDHTTransportValue
-
getReplicationFrequencyHours
public byte getReplicationFrequencyHours()- Specified by:
getReplicationFrequencyHours
in interfaceDHTTransportValue
-
setOriginatorAndSender
-
getValueForRelay
- Specified by:
getValueForRelay
in interfaceDHTDBValue
-
getValueForDeletion
-
getString
- Specified by:
getString
in interfaceDHTTransportValue
-