Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-5896

Add Stream or reactive Publisher support to EntryReader interface

    XMLWordPrintable

    Details

    • Improvement
    • Status: Dev backlog
    • Major
    • Resolution: Unresolved
    • 7.0.0
    • None
    • core apis
    • None

      Description

      Typical use-case:

          private static Version readConfigFileVersion(final Path configFile) throws InitializationException {
              try (LdifEntryReader reader = new LdifEntryReader(newBufferedReader(configFile))) {
                  while (reader.hasNext()) {
                      final Entry entry = reader.readEntry();
                      if (entry.getName().equals(ROOT_CONFIG)) {
                          return entry.parseAttribute("ds-cfg-version").as(v -> version(v.toString()));
                      }
                  }
                  return null;
              } catch (IOException e) {
                  throw new InitializationException(ERR_CANNOT_READ_CONFIG_VERSION.get(configFile, e.getLocalizedMessage()));
              }
          }
      

      A reactive approach might be more appropriate in order to support error handling and back-pressure. For consistency, we should also consider adding similar support to ChangeRecordReader.

        Attachments

          Activity

            People

            Unassigned Unassigned
            matthew Matthew Swift
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: