@SuppressWarnings("unchecked")
  private ArtifactEntity toEntity(Map<String, Object> properties, String rawRequestBody)
      throws AmbariException {

    String name = (String) properties.get(ARTIFACT_NAME_PROPERTY);
    if (name == null || name.isEmpty()) {
      throw new IllegalArgumentException("Artifact name must be provided");
    }

    ArtifactEntity artifact = new ArtifactEntity();
    artifact.setArtifactName(name);
    artifact.setForeignKeys(createForeignKeyMap(properties));

    Map<String, Object> rawBodyMap = jsonSerializer.<Map<String, Object>>fromJson(
        rawRequestBody, Map.class);

    Object artifactData = rawBodyMap.get(ARTIFACT_DATA_PROPERTY);
    if (artifactData == null) {
      throw new IllegalArgumentException("artifact_data property must be provided");
    }
    if (! (artifactData instanceof Map)) {
      throw new IllegalArgumentException("artifact_data property must be a map");
    }
    artifact.setArtifactData((Map<String, Object>) artifactData);

    return artifact;
  }
Convert a map of properties to an artifact entity.

@param properties  property map

@return new artifact entity
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ArtifactResourceProvider.java