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 (
Point
orMap
): value represents a single structured data - points (
Collection
): value represents a collection of structured data - organization (
String
, optional): used to override InfluxDB organization ofLineProtocolWriter
service (by event). - bucket (
String
, optional): used to override InfluxDB bucket ofLineProtocolWriter
service (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
Modifier and TypeClassDescriptionstatic @interface
Configuration for Point Writer. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
OSGi event property name to override InfluxDB bucket.static final String
Default OSGi event topic.static final String
OSGi event property name to override InfluxDB organization.static final String
OSGi event property name used to write single structured data.static final String
OSGi event property name used to write collection of structured data. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
handleEvent
(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:
handleEvent
in interfaceorg.osgi.service.event.EventHandler
- Parameters:
event
- OSGI event containing data
-