Package com.influxdb.client.osgi
Class PointWriter
java.lang.Object
com.influxdb.client.osgi.PointWriter
- All Implemented Interfaces:
org.osgi.service.event.EventHandler
OSGi event handler writing structured data (points) to InfluxDB.
Service is used to write structural (Point or
Map) event data to InfluxDB. OSGi event topic
DEFAULT_EVENT_TOPIC used by default. The following OSGi event properties are supported:
- point (
PointorMap): value represents a single structured data - points (
Collection): value represents a collection of structured data - organization (
String, optional): used to override InfluxDB organization ofLineProtocolWriterservice (by event). - bucket (
String, optional): used to override InfluxDB bucket ofLineProtocolWriterservice (by event).
One of point or points must be set.
Measurement name is defined by OSGi event topic if Map type is used: measure name is fragment after
the last slash (/) character. For example: weather measure is written
if event topic is influxdb/point/weather (in this case OSGi event filter must be changed,
i.e. influxdb/point/*).
Structured data can be decorated with host name, host address or timestamp (by configuration).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic @interfaceConfiguration for Point Writer. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringOSGi event property name to override InfluxDB bucket.static final StringDefault OSGi event topic.static final StringOSGi event property name to override InfluxDB organization.static final StringOSGi event property name used to write single structured data.static final StringOSGi event property name used to write collection of structured data. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleEvent(org.osgi.service.event.Event event) Write structured data from OSGi event.
-
Field Details
-
DEFAULT_EVENT_TOPIC
Default OSGi event topic.- See Also:
-
POINT
OSGi event property name used to write single structured data.- See Also:
-
POINTS
OSGi event property name used to write collection of structured data.- See Also:
-
ORGANIZATION
OSGi event property name to override InfluxDB organization.- See Also:
-
BUCKET
OSGi event property name to override InfluxDB bucket.- See Also:
-
-
Constructor Details
-
PointWriter
public PointWriter()
-
-
Method Details
-
handleEvent
public void handleEvent(org.osgi.service.event.Event event) Write structured data from OSGi event.- Specified by:
handleEventin interfaceorg.osgi.service.event.EventHandler- Parameters:
event- OSGI event containing data
-