public void storeMeemDefinition(MeemPath meemPath, MeemDefinition meemDefinition) {
    if (DEBUG) {
      logger.info("storing meem def: " + meemPath);
    }

    // only store meemstore paths
    if (meemPath.getSpace().equals(Space.MEEMSTORE)) {
      int meemVersion = meemDefinition.getMeemAttribute().getVersion();
      if (meemVersion > definitionStore.getVersion(meemPath)) {
        definitionStore.store(meemPath, meemDefinition);

        synchronized (meemPaths) {
          if (!meemPaths.containsKey(meemPath.getLocation())) {
            meemPaths.put(meemPath.getLocation(), meemPath);
            meemStoreClient.meemStored(meemPath);
          }
          meemDefinitionClient.meemDefinitionChanged(meemPath, meemDefinition);
          meemContentClient.meemContentChanged(meemPath, null);
        }
      } else {
        // definition version number is same or smaller than the persisted one
        // LogTools.warn(logger, "Request to persist MeemDefinition with lower version number than
        // most recent version");
      }
    }
  }
  /**
   * Rename a wedge in the passed in meem definition. Note that if the meem definition contains
   * multiple wedges with the same identifier only the first one will be renamed.
   *
   * @param meemDefinition The meem definition containing the identified wedge.
   * @param oldWedgeIdentifier The original wedge identifier
   * @param newWedgeIdentifier The new wedge identifier
   */
  public static void renameWedgeIdentifier(
      MeemDefinition meemDefinition, String oldWedgeIdentifier, String newWedgeIdentifier) {

    WedgeDefinition wedgeDefinition = meemDefinition.getWedgeDefinition(oldWedgeIdentifier);
    if (wedgeDefinition == null) {
      logger.info(
          "renameWedgeIdentifier() - No wedge with identifier of '" + oldWedgeIdentifier + "'");
    } else {
      wedgeDefinition.getWedgeAttribute().setIdentifier(newWedgeIdentifier);
    }
  }
  /**
   * Rename a facet appearing in the passed in meem definition which is associated with the given
   * wedge identified by wedgeIdentifier. Note that if there are multiple wedges with the same
   * identifier only the first one will be renamed. Also note that the oldFacetIdentifier argument
   * should not contain the full package name of the facet class but just the class name. For
   * example if you wish to rename a Binary inbound facet you should just use <b>Binary</b> instead
   * of <b>org.openmaji.common.Binary</b>.
   *
   * @param meemDefinition the meem definition containing the identified wedge.
   * @param wedgeIdentifier the identifier for the wedge the facet is in.
   * @param oldFacetIdentifier the original facet identifier value.
   * @param newFacetIdentifier the new facet identifier value.
   */
  public static void renameFacetIdentifier(
      MeemDefinition meemDefinition,
      String wedgeIdentifier,
      String oldFacetIdentifier,
      String newFacetIdentifier) {

    WedgeDefinition wedgeDefinition = meemDefinition.getWedgeDefinition(wedgeIdentifier);
    if (wedgeDefinition == null) {
      logger.info(
          "renameFacetIdentifier() - No wedge with identifier of '" + wedgeIdentifier + "'");
    } else {
      WedgeDefinitionUtility.renameFacetIdentifier(
          wedgeDefinition, oldFacetIdentifier, newFacetIdentifier);
    }
  }