public class JSONDialect extends Dialect
| Modifier and Type | Class and Description |
|---|---|
static class |
JSONDialect.JsonFile
A wrapper for a JSON file with utility methods
|
Dialect.MigrationDatadataManager| Constructor and Description |
|---|
JSONDialect(@NotNull DataManager dataManager)
Creates a new H2 dialect
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull java.util.Optional<java.lang.String> |
getFromCacheImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String key)
Get a value from the cache
|
protected @NotNull java.util.Optional<java.lang.String> |
getFromDatabaseImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String key)
Get a value from the database
|
protected @NotNull java.util.Optional<Dialect.MigrationData> |
getMigrationDataFromDatabaseImpl(@NotNull DataManager newManager)
Get migration data from the database
|
void |
removeFromCacheImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String key)
Remove a value from the cache
|
protected boolean |
removeFromDatabaseImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String key)
Remove a value from the database
|
void |
saveCacheImpl()
Save all cache data to the database
|
void |
saveCacheImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target)
Save a specific target in a table to the cache
|
void |
setToCacheImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String key,
@NotNull java.lang.String value)
Set a value to the cache
|
protected boolean |
setToDatabaseImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.util.Map<java.lang.String,java.lang.String> data)
Set multiple values to the database
|
protected boolean |
setToDatabaseImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String key,
@NotNull java.lang.String value)
Set a value to the database
|
getFromCache, getFromDatabase, getMigrationDataFromDatabase, removeFromCache, removeValueFromDatabase, saveCache, saveCache, setToCache, setToDatabase, setToDatabase, setToDatabasepublic JSONDialect(@NotNull
@NotNull DataManager dataManager)
dataManager - Dialect.dataManager@NotNull
public @NotNull java.util.Optional<java.lang.String> getFromCacheImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String key)
DialectgetFromCacheImpl in class Dialecttable - the tabletarget - the targetkey - the keypublic void setToCacheImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
DialectsetToCacheImpl in class Dialecttable - the tabletarget - the targetkey - the keyvalue - the valuepublic void removeFromCacheImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String key)
DialectremoveFromCacheImpl in class Dialecttable - the tabletarget - the targetkey - the keypublic void saveCacheImpl()
DialectsaveCacheImpl in class Dialectpublic void saveCacheImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target)
DialectsaveCacheImpl in class Dialecttable - the table to save intarget - the target to save@NotNull protected @NotNull java.util.Optional<Dialect.MigrationData> getMigrationDataFromDatabaseImpl(@NotNull @NotNull DataManager newManager)
DialectgetMigrationDataFromDatabaseImpl in class DialectnewManager - the new DataManager to migrate to@NotNull
protected @NotNull java.util.Optional<java.lang.String> getFromDatabaseImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String key)
DialectgetFromDatabaseImpl in class Dialecttable - the table to get fromtarget - the target to get fromkey - the key to getprotected boolean setToDatabaseImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull java.lang.String value)
DialectsetToDatabaseImpl in class Dialecttable - the table to set totarget - the target to set tokey - the key to setvalue - the value to setprotected boolean setToDatabaseImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.util.Map<java.lang.String,java.lang.String> data)
DialectsetToDatabaseImpl in class Dialecttable - the table to set totarget - the target to set todata - the data to setprotected boolean removeFromDatabaseImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String key)
DialectremoveFromDatabaseImpl in class Dialecttable - the table to remove fromtarget - the target to remove fromkey - the key to remove