Interface InfluxDbSender

All Superinterfaces:
AutoCloseable, Closeable
All Known Implementing Classes:
InfluxDbUdpSender

public interface InfluxDbSender
extends Closeable
  • Method Summary

    Modifier and Type Method Description
    void connect()
    Connects to the server.
    void disconnect()
    Disconnects from the server.
    void flush()
    Flushes buffer, if applicable
    boolean isConnected()
    Returns true if ready to send data
    void send​(StringBuilder measurement)
    Sends the given measurement to the server.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • connect

      void connect() throws IllegalStateException, IOException
      Connects to the server.
      Throws:
      IllegalStateException - if the client is already connected
      IOException - if there is an error connecting
    • send

      void send​(StringBuilder measurement) throws IOException
      Sends the given measurement to the server.

      NOTE: The caller may modify the measurement buffer after this call. The implementation of this method MUST NOT keep any reference to the buffer after this call.

      Parameters:
      measurement - a single measurement line, according to the InfluxDb line protocol including a trailing newline.
      Throws:
      IOException - if there was an error sending the metric
    • flush

      void flush() throws IOException
      Flushes buffer, if applicable
      Throws:
      IOException - if there was an error during flushing metrics to the server
    • disconnect

      void disconnect() throws IOException
      Disconnects from the server.
      Throws:
      IOException - if there is an error disconnecting
    • isConnected

      boolean isConnected()
      Returns true if ready to send data