Class FieldTypeConflictHandler
java.lang.Object
io.openems.backend.timedata.influx.FieldTypeConflictHandler
Handles Influx FieldTypeConflictExceptions. This helper provides conversion
functions to provide the correct field types for InfluxDB.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBiConsumer<com.influxdb.client.write.Point,
com.google.gson.JsonElement> getHandler
(String field) Gets the handler for the given Field.void
handleException
(com.influxdb.exceptions.InfluxException e) Handles aFieldTypeConflictException
; adds special handling for fields that already exist in the database.protected boolean
handleExceptionMessage
(String message)
-
Constructor Details
-
FieldTypeConflictHandler
-
-
Method Details
-
handleException
public void handleException(com.influxdb.exceptions.InfluxException e) throws IllegalStateException, IllegalArgumentException Handles aFieldTypeConflictException
; adds special handling for fields that already exist in the database.- Parameters:
e
- theFieldTypeConflictException
- Throws:
IllegalStateException
IllegalArgumentException
-
handleExceptionMessage
protected boolean handleExceptionMessage(String message) throws IllegalStateException, IllegalArgumentException -
getHandler
public BiConsumer<com.influxdb.client.write.Point,com.google.gson.JsonElement> getHandler(String field) Gets the handler for the given Field.- Parameters:
field
- the Field- Returns:
- the handler or null
-