Class PointWriter

java.lang.Object
com.influxdb.client.osgi.PointWriter
All Implemented Interfaces:
org.osgi.service.event.EventHandler

public class PointWriter extends Object implements 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 or Map): value represents a single structured data
  • points (Collection): value represents a collection of structured data
  • organization (String, optional): used to override InfluxDB organization of LineProtocolWriter service (by event).
  • bucket (String, optional): used to override InfluxDB bucket of LineProtocolWriter 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

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Configuration for Point Writer.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handleEvent(org.osgi.service.event.Event event)
    Write structured data from OSGi event.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_EVENT_TOPIC

      public static final String DEFAULT_EVENT_TOPIC
      Default OSGi event topic.
      See Also:
    • POINT

      public static final String POINT
      OSGi event property name used to write single structured data.
      See Also:
    • POINTS

      public static final String POINTS
      OSGi event property name used to write collection of structured data.
      See Also:
    • ORGANIZATION

      public static final String ORGANIZATION
      OSGi event property name to override InfluxDB organization.
      See Also:
    • BUCKET

      public static final String 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 interface org.osgi.service.event.EventHandler
      Parameters:
      event - OSGI event containing data