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

Add Stream or reactive Publisher support to EntryReader interface

    Details

    • Type: Improvement
    • Status: Dev backlog
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.0.0
    • Fix Version/s: None
    • Component/s: core apis
    • Labels:
      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

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

              Dates

              • Created:
                Updated: