com.marklogic.hub.mapping.MappingValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marklogic-data-hub Show documentation
Show all versions of marklogic-data-hub Show documentation
Library for Creating an Operational Data Hub on MarkLogic
package com.marklogic.hub.mapping;
import com.fasterxml.jackson.databind.JsonNode;
import com.marklogic.client.DatabaseClient;
import com.marklogic.client.extensions.ResourceManager;
import com.marklogic.client.io.Format;
import com.marklogic.client.io.JacksonHandle;
import com.marklogic.client.io.StringHandle;
import com.marklogic.client.util.RequestParameters;
/**
* This is no longer used in DHF, but is still required by DHCCE.
*/
public class MappingValidator extends ResourceManager {
public MappingValidator(DatabaseClient client) {
super();
client.init("mlMappingValidator", this);
}
public JsonNode validateJsonMapping(String jsonMapping, String uri) {
RequestParameters params = new RequestParameters();
params.add("uri", uri);
return getServices().post(params,
new StringHandle(jsonMapping).withFormat(Format.JSON), new JacksonHandle()).get();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy