private void flushTestpointValues(String testpointId) {
        // If we don't have any values yet, no need to flush
        if(!testpointFieldValues.containsKey(testpointId)) {
            return;
        }
        // If we don't have a name for the testpoint, we shouldn't flush
        if(!testpointNames.containsKey(testpointId)) {
            missingNames.add(testpointId);
            return;
        }

        String testpointName = testpointNames.get(testpointId);
        try {
            // Prepare the JSON for of the data.
            XContentBuilder testpointJson = XContentFactory.jsonBuilder()
                .startObject()
                .field("time", Calendar.getInstance().getTimeInMillis())
                .field("testpoint", testpointName);
            Map<Short, Object> values = testpointFieldValues.get(testpointId);
            for (Map.Entry<Short, Object> fieldValues : values.entrySet()) {
                testpointJson.field(getTestpointName(testpointId, fieldValues.getKey()), fieldValues.getValue());
            }
            testpointJson.endObject();

            // Store it in Elastic
            esClient.prepareIndex("delta-v-testpoints", "Testpoint").setSource(testpointJson).get();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
Writes all current values for a fiven testpoint to the database.

@param testpointId id of the testpoint.
plc4j/protocols/delta-v/src/test/java/org/apache/plc4x/java/deltav/PoCES.java