Class AbstractAdapter
- java.lang.Object
-
- org.opennms.netmgt.telemetry.protocols.collection.AbstractAdapter
-
- All Implemented Interfaces:
Adapter
- Direct Known Subclasses:
AbstractCollectionAdapter
,BmpPeerStatusAdapter
,BmpPersistingAdapter
public abstract class AbstractAdapter extends Object implements Adapter
-
-
Field Summary
Fields Modifier and Type Field Description protected AdapterDefinition
adapterConfig
A single instance of an adapter will only be responsible for this one configprotected org.slf4j.Logger
LOG
protected com.codahale.metrics.Timer
logParsingTimer
Time taken to handle a logprotected com.codahale.metrics.Histogram
packetsPerLogHistogram
Number of message per log
-
Constructor Summary
Constructors Constructor Description AbstractAdapter(AdapterDefinition adapterConfig, com.codahale.metrics.MetricRegistry metricRegistry)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
destroy()
abstract void
handleMessage(TelemetryMessageLogEntry message, TelemetryMessageLog messageLog)
void
handleMessageLog(TelemetryMessageLog messageLog)
Handle the messages.
-
-
-
Field Detail
-
LOG
protected final org.slf4j.Logger LOG
-
logParsingTimer
protected final com.codahale.metrics.Timer logParsingTimer
Time taken to handle a log
-
packetsPerLogHistogram
protected final com.codahale.metrics.Histogram packetsPerLogHistogram
Number of message per log
-
adapterConfig
protected final AdapterDefinition adapterConfig
A single instance of an adapter will only be responsible for this one config
-
-
Constructor Detail
-
AbstractAdapter
public AbstractAdapter(AdapterDefinition adapterConfig, com.codahale.metrics.MetricRegistry metricRegistry)
-
-
Method Detail
-
handleMessage
public abstract void handleMessage(TelemetryMessageLogEntry message, TelemetryMessageLog messageLog)
-
handleMessageLog
public void handleMessageLog(TelemetryMessageLog messageLog)
Description copied from interface:Adapter
Handle the messages. IMPORTANT: Implementations of this method MUST be thread-safe.- Specified by:
handleMessageLog
in interfaceAdapter
- Parameters:
messageLog
- group of messages to be handled
-
-