public interface MappingManager
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MAPPING_FILE_EXTENSION
String value for the mapping file extension
|
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 incrementVersion)
Saves a map to disk, incrementing its version by 1
|
static final java.lang.String MAPPING_FILE_EXTENSION
Mapping createMapping(java.lang.String mappingName)
mappingName
- - the base name of the mapping you want to createMapping createMapping(java.lang.String mappingName, java.lang.String entityName)
mappingName
- - the base name of the mapping you want to createentityName
- - the name of the entity being mapped toMapping createMappingFromJSON(java.lang.String json) throws java.io.IOException
json
- - string representation of jsonjava.io.IOException
- - thrown if mapping file cannot be found/read off diskMapping createMappingFromJSON(com.fasterxml.jackson.databind.JsonNode json) throws java.io.IOException
json
- - JsonNodejava.io.IOException
- - thrown if mapping file cannot be found/read off diskvoid saveMapping(Mapping mapping)
mapping
- - the mapping object to be savedvoid saveMapping(Mapping mapping, boolean incrementVersion)
mapping
- the mapping object to be savedincrementVersion
- - true to increment version, false if not tovoid deleteMapping(java.lang.String mappingName)
mappingName
- - the base-name of the mapping you want to delete as a stringjava.util.ArrayList<Mapping> getMappings()
java.util.ArrayList<java.lang.String> getMappingsNames()
Mapping getMapping(java.lang.String mappingName)
mappingName
- - the basename of the mappingMapping getMapping(java.lang.String mappingName, int version, boolean createIfNotExisted)
mappingName
- - name of the mapversion
- - the version of the mappingcreateIfNotExisted
- - create mapping object if true, otherwise throws exceptionjava.lang.String getMappingAsJSON(java.lang.String mappingName)
mappingName
- - name of the mappingjava.lang.String getMappingAsJSON(java.lang.String mappingName, int version, boolean createIfNotExisted)
mappingName
- - name of the mappingversion
- - the version number of the mappingcreateIfNotExisted
- - create mapping object if true, otherwise throws exception