public abstract class Transport extends Object implements Closeable
Modifier and Type | Field and Description |
---|---|
static String |
LOSE_THRESHOLD_PROPERTY |
static String |
SEND_THRESHOLD_PROPERTY |
Modifier | Constructor and Description |
---|---|
protected |
Transport(int sendThreshold,
int loseThreshold)
Constructor for inheritors
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Sends the remaining cached records to Thermostat
|
long |
getLostCount()
Getter for number of lost records
|
void |
send(BytemanMetric rec) |
protected abstract void |
transferToPeer(ArrayList<BytemanMetric> records)
This method should transfer specified records to Thermostat
It will be called from the background thread and no more than from
a single thread simultaneously
|
public static final String SEND_THRESHOLD_PROPERTY
public static final String LOSE_THRESHOLD_PROPERTY
protected Transport(int sendThreshold, int loseThreshold)
sendThreshold
- min number of records to cache before sendingloseThreshold
- max number of packages to cacheprotected abstract void transferToPeer(ArrayList<BytemanMetric> records)
records
- records to transferpublic void send(BytemanMetric rec)
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public long getLostCount()
Copyright © 2017. All rights reserved.