Serializable
, Clearable
public class MonitorAccumModel extends Object implements Clearable, Serializable
Constructor | Description |
---|---|
MonitorAccumModel() |
Modifier and Type | Method | Description |
---|---|---|
void |
addListener(MonitorListener listener) |
Add a listener.
|
void |
addSample(SampleResult sample) |
Method will try to parse the response data.
|
void |
addSample(MonitorModel model) |
Method will look up the server in the map.
|
void |
clearData() |
Clears everything except the listener.
|
MonitorModel |
createNewMonitorModel(URL url) |
Method will return a new MonitorModel object with the given URL.
|
List<MonitorModel> |
getAllSamples(String url) |
Get all MonitorModels matching the URL.
|
int |
getBufferSize() |
|
MonitorModel |
getLastSample() |
Added this method we that we can save the calculated stats.
|
MonitorModel |
getSample(String url) |
Get the MonitorModel matching the url.
|
void |
noResponse(URL url) |
If there is no response from the server, we create a new MonitorStats
object with the current timestamp and health "dead".
|
void |
notifyListeners(MonitorModel model) |
notify the listeners with the MonitorModel object.
|
void |
setBufferSize(int buffer) |
|
void |
setPrefix(String prefix) |
public int getBufferSize()
public void setBufferSize(int buffer)
public void setPrefix(String prefix)
public MonitorModel getLastSample()
public void addSample(MonitorModel model)
model
- the MonitorModel
to be addedpublic List<MonitorModel> getAllSamples(String url)
url
- to be matched againstpublic MonitorModel getSample(String url)
url
- to be matched againstMonitorModel
registered for this
url
public void addSample(SampleResult sample)
sample
- SampleResult
with the result of the status requestpublic void noResponse(URL url)
url
- URL from where the status should have comepublic MonitorModel createNewMonitorModel(URL url)
url
- URL from where the status should have comepublic void clearData()
public void notifyListeners(MonitorModel model)
model
- the MonitorModel
that should be sent to the listenerspublic void addListener(MonitorListener listener)
listener
- the MonitorListener
that should be addedCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.