@Component public class MappingManagerImpl extends com.marklogic.client.ext.helper.LoggingObject implements MappingManager
| Modifier and Type | Field and Description | 
|---|---|
protected HubConfig | 
hubConfig  | 
protected HubProject | 
hubProject  | 
MAPPING_FILE_EXTENSION| Constructor and Description | 
|---|
MappingManagerImpl()  | 
| Modifier and Type | Method and Description | 
|---|---|
Mapping | 
createMapping(java.lang.String mappingName)
Creates a mapping given a string name 
 | 
Mapping | 
createMapping(java.lang.String mappingName,
             java.lang.String entityName)
Creates a mapping given a string name 
 | 
Mapping | 
createMappingFromJSON(com.fasterxml.jackson.databind.JsonNode json)
Creates a mapping from a given JsonNode 
 | 
Mapping | 
createMappingFromJSON(java.lang.String json)
Creates a mapping from a given JSON string 
 | 
void | 
deleteMapping(java.lang.String mappingName)
Deletes a defined mapping by string name 
 | 
Mapping | 
getMapping(java.lang.String mappingName)
Returns a mapping based on the provided name 
 | 
Mapping | 
getMapping(java.lang.String mappingName,
          int version,
          boolean createIfNotExisted)
Returns a mapping based on the provided name 
 | 
java.lang.String | 
getMappingAsJSON(java.lang.String mappingName)
Returns a mapping based on the provided name as JSON string 
 | 
java.lang.String | 
getMappingAsJSON(java.lang.String mappingName,
                int version,
                boolean createIfNotExisted)
Returns a mapping based on the provided name as JSON string 
 | 
java.util.ArrayList<Mapping> | 
getMappings()
Returns a list of all mappings currently defined 
 | 
java.util.ArrayList<java.lang.String> | 
getMappingsNames()
Returns a string list of names for all mappings currently defined 
 | 
void | 
saveMapping(Mapping mapping)
Saves a map to disk 
 | 
void | 
saveMapping(Mapping mapping,
           boolean autoIncrement)
Saves a map to disk, incrementing its version by 1 
 | 
@Autowired protected HubConfig hubConfig
@Autowired protected HubProject hubProject
public Mapping createMapping(java.lang.String mappingName)
MappingManagercreateMapping in interface MappingManagermappingName - - the base name of the mapping you want to createpublic Mapping createMapping(java.lang.String mappingName, java.lang.String entityName)
MappingManagercreateMapping in interface MappingManagermappingName - - the base name of the mapping you want to createentityName - - the name of the entity being mapped topublic Mapping createMappingFromJSON(java.lang.String json) throws java.io.IOException
MappingManagercreateMappingFromJSON in interface MappingManagerjson - - string representation of jsonjava.io.IOException - - thrown if mapping file cannot be found/read off diskpublic Mapping createMappingFromJSON(com.fasterxml.jackson.databind.JsonNode json)
MappingManagercreateMappingFromJSON in interface MappingManagerjson - - JsonNodepublic void deleteMapping(java.lang.String mappingName)
MappingManagerdeleteMapping in interface MappingManagermappingName - - the base-name of the mapping you want to delete as a stringpublic void saveMapping(Mapping mapping)
MappingManagersaveMapping in interface MappingManagermapping - - the mapping object to be savedpublic void saveMapping(Mapping mapping, boolean autoIncrement)
MappingManagersaveMapping in interface MappingManagermapping - the mapping object to be savedautoIncrement - - true to increment version, false if not topublic java.util.ArrayList<java.lang.String> getMappingsNames()
MappingManagergetMappingsNames in interface MappingManagerpublic java.util.ArrayList<Mapping> getMappings()
MappingManagergetMappings in interface MappingManagerpublic Mapping getMapping(java.lang.String mappingName)
MappingManagergetMapping in interface MappingManagermappingName - - the basename of the mappingpublic Mapping getMapping(java.lang.String mappingName, int version, boolean createIfNotExisted)
MappingManagergetMapping in interface MappingManagermappingName - - name of the mapversion - - the version of the mappingcreateIfNotExisted - - create mapping object if true, otherwise throws exceptionpublic java.lang.String getMappingAsJSON(java.lang.String mappingName)
MappingManagergetMappingAsJSON in interface MappingManagermappingName - - name of the mappingpublic java.lang.String getMappingAsJSON(java.lang.String mappingName,
                                         int version,
                                         boolean createIfNotExisted)
MappingManagergetMappingAsJSON in interface MappingManagermappingName - - name of the mappingversion - - the version number of the mappingcreateIfNotExisted - - create mapping object if true, otherwise throws exception