code: protected CompletionStage<Void> emitEvent(final IRI identifier, final IRI activityType, final IRI resourceType) {
          // Always notify about updates for the resource in question
          getServices().getEventService().emit(new SimpleEvent(getUrl(identifier), getSession().getAgent(),
                      asList(PROV.Activity, activityType), asList(resourceType)));
          // If this was an update and the parent is an ldp:IndirectContainer,
          // notify about the member resource (if it exists)
          if (AS.Update.equals(activityType) && LDP.IndirectContainer.equals(getParentModel())) {
              return emitMembershipUpdateEvent();
          // If this was a creation or deletion, and the parent is some form of container,
          // notify about the parent resource, too
          } else if (AS.Create.equals(activityType) || AS.Delete.equals(activityType)) {
              final IRI model = getParentModel();
              final IRI id = getParentIdentifier();
              if (HttpUtils.isContainer(model)) {
                  getServices().getEventService().emit(new SimpleEvent(getUrl(id),
                                  getSession().getAgent(), asList(PROV.Activity, AS.Update), asList(model)));
                  // If the parent's membership resource is different than the parent itself,
                  // notify about that membership resource, too (if it exists)
                  if (!parent.getMembershipResource().map(MutatingLdpHandler::removeHashFragment).filter(isEqual(id))
                          .isPresent()) {
                      return allOf(getServices().getResourceService().touch(id).toCompletableFuture(),
                              emitMembershipUpdateEvent().toCompletableFuture());
                  }
                  return getServices().getResourceService().touch(id);
              }
          }
          return completedFuture(null);
      }
docs: Emit events for the change.
  @param identifier the resource identifier
  @param activityType the activity type
  @param resourceType the resource type
  @return the next completion stage