public static void genPageMutations()

in webindex/modules/core/src/main/java/webindex/core/IndexClient.java [267:288]


  public static void genPageMutations(PageUpdate update, long seq, Consumer<Mutation> consumer) {
    Mutation jsonMutation = new Mutation("p:" + update.getUri());
    if (update.getJson().equals(Page.DELETE_JSON)) {
      jsonMutation.putDelete(Constants.PAGE, Constants.CUR, seq);
    } else {
      jsonMutation.put(Constants.PAGE, Constants.CUR, seq, update.getJson());
    }
    consumer.accept(jsonMutation);

    // invert links on export
    for (Link link : update.getAddedLinks()) {
      Mutation m = new Mutation("p:" + link.getUri());
      m.put(Constants.INLINKS, update.getUri(), seq, link.getAnchorText());
      consumer.accept(m);
    }

    for (Link link : update.getDeletedLinks()) {
      Mutation m = new Mutation("p:" + link.getUri());
      m.putDelete(Constants.INLINKS, update.getUri(), seq);
      consumer.accept(m);
    }
  }