public class JsonFileBasedPersister<T extends Identifiable> extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
INDEX_METADATA |
protected static org.slf4j.Logger |
logger |
protected String |
modelVersion |
protected JacksonObjectMapper |
objectMapper |
protected String |
uidVersion |
protected BeanValidator |
validator |
| Constructor and Description |
|---|
JsonFileBasedPersister(JacksonObjectMapper objectMapper,
BeanValidator validator) |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Path directory,
T content)
delete an identifiable object in a json file
|
Path |
jsonFile(Path directory,
String id) |
void |
refreshIndexing(Path metadataFolder,
List<T> pages) |
protected void |
removeFromIndex(Path metadataPath,
T content) |
void |
save(Path directory,
T content)
Save an identifiable object in a json file
|
void |
saveInIndex(Path metadataPath,
T content) |
Path |
updateMetadata(Path directory,
T content) |
public static final String INDEX_METADATA
@Value(value="${designer.version}")
protected String uidVersion
@Value(value="${designer.modelVersion}")
protected String modelVersion
protected JacksonObjectMapper objectMapper
protected BeanValidator validator
protected static final org.slf4j.Logger logger
public JsonFileBasedPersister(JacksonObjectMapper objectMapper, BeanValidator validator)
public void save(Path directory, T content) throws IOException
IOExceptionpublic Path updateMetadata(Path directory, T content) throws IOException
IOExceptionpublic void saveInIndex(Path metadataPath, T content) throws IOException
IOExceptionprotected void removeFromIndex(Path metadataPath, T content) throws IOException
IOExceptionpublic void delete(Path directory, T content) throws IOException
IOExceptionpublic void refreshIndexing(Path metadataFolder, List<T> pages) throws IOException
IOExceptionCopyright © 2020. All rights reserved.