Package com.biglybt.core.dht.db.impl
Class DHTDBValueImpl
- java.lang.Object
-
- com.biglybt.core.dht.db.impl.DHTDBValueImpl
-
- All Implemented Interfaces:
DHTDBValue
,DHTTransportValue
public class DHTDBValueImpl extends java.lang.Object implements DHTDBValue
-
-
Field Summary
Fields Modifier and Type Field Description private long
creation_time
private byte
flags
private byte
life_hours
private boolean
local
private DHTTransportContact
originator
private byte
rep_control
private DHTTransportContact
sender
private long
store_time
private byte[]
value
private int
version
private static byte[]
ZERO_LENGTH_BYTE_ARRAY
-
Constructor Summary
Constructors Modifier Constructor Description 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 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCreationTime()
int
getFlags()
int
getLifeTimeHours()
DHTTransportContact
getOriginator()
byte
getReplicationControl()
byte
getReplicationFactor()
byte
getReplicationFrequencyHours()
DHTTransportContact
getSender()
protected long
getStoreTime()
java.lang.String
getString()
byte[]
getValue()
DHTDBValue
getValueForDeletion(int _version)
DHTDBValue
getValueForRelay(DHTTransportContact _sender)
int
getVersion()
boolean
isLocal()
protected void
reset()
protected void
setCreationTime()
void
setFlags(byte _flags)
protected void
setOriginatorAndSender(DHTTransportContact _originator)
protected void
setStoreTime(long l)
-
-
-
Field Detail
-
ZERO_LENGTH_BYTE_ARRAY
private static final byte[] ZERO_LENGTH_BYTE_ARRAY
-
creation_time
private long creation_time
-
value
private byte[] value
-
originator
private DHTTransportContact originator
-
sender
private DHTTransportContact 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 Detail
-
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
-_distance
-_flags
-
-
DHTDBValueImpl
protected 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.- Parameters:
_sender
-_other
-
-
-
Method Detail
-
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
public DHTTransportContact getOriginator()
- Specified by:
getOriginator
in interfaceDHTTransportValue
-
getSender
public DHTTransportContact 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
protected void setOriginatorAndSender(DHTTransportContact _originator)
-
getValueForRelay
public DHTDBValue getValueForRelay(DHTTransportContact _sender)
- Specified by:
getValueForRelay
in interfaceDHTDBValue
-
getValueForDeletion
public DHTDBValue getValueForDeletion(int _version)
-
getString
public java.lang.String getString()
- Specified by:
getString
in interfaceDHTTransportValue
-
-