code: @Override
      public void add(Event event) {
          if (getNumStoredEvents() >= maxEvents) {
              logger.warn("Not adding Event because at least "
                  + Integer.toString(maxEvents) + " events are already stored: " + event.getId());
              return;
          }
  
          File eventFile = new File(bufferDir.getAbsolutePath(), event.getId().toString() + FILE_SUFFIX);
          if (eventFile.exists()) {
              logger.trace("Not adding Event to offline storage because it already exists: "
                  + eventFile.getAbsolutePath());
              return;
          } else {
              logger.debug("Adding Event to offline storage: " + eventFile.getAbsolutePath());
          }
  
          try (FileOutputStream fileOutputStream = new FileOutputStream(eventFile);
               ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream)) {
              objectOutputStream.writeObject(event);
          } catch (Exception e) {
              logger.error("Error writing Event to offline storage: " + event.getId(), e);
          }
  
          logger.debug(Integer.toString(getNumStoredEvents())
              + " stored events are now in dir: "
              + bufferDir.getAbsolutePath());
      }
docs: Store a single event to the add directory. Java serialization is used and each
  event is stored in a file named by its UUID.
  
  @param event Event to store in add directory