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 AdapterDefinitionadapterConfigA single instance of an adapter will only be responsible for this one configprotected org.slf4j.LoggerLOGprotected com.codahale.metrics.TimerlogParsingTimerTime taken to handle a logprotected com.codahale.metrics.HistogrampacketsPerLogHistogramNumber 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 voiddestroy()abstract voidhandleMessage(TelemetryMessageLogEntry message, TelemetryMessageLog messageLog)voidhandleMessageLog(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:AdapterHandle the messages. IMPORTANT: Implementations of this method MUST be thread-safe.- Specified by:
handleMessageLogin interfaceAdapter- Parameters:
messageLog- group of messages to be handled
-
-