public void addRemoteType(int typeId, PdxType newType) {
    PdxType oldType = idToType.get(typeId);
    if (oldType == null) {
      distributedTypeRegistry.addRemoteType(typeId, newType);
      idToType.put(typeId, newType);
      typeToId.put(newType, typeId);
      if (logger.isInfoEnabled()) {
        logger.info("Adding, from remote WAN: {}", newType.toFormattedString());
      }
    } else if (!oldType.equals(newType)) {
      Assert.fail("Old type does not equal new type for the same id. oldType=" + oldType
          + " new type=" + newType);
    }
  }
Create a type id for a type that may come locally, or from a remote member.

@return the existing type or the new type
geode-core/src/main/java/org/apache/geode/pdx/internal/TypeRegistry.java