public class DatabaseMemory extends BasicMemory
Modifier and Type | Class and Description |
---|---|
class |
DatabaseMemory.SessionInfo |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CACHE_SIZE |
static java.lang.String |
DATABASE_DRIVER |
static java.lang.String |
DATABASE_PASSWORD |
static java.lang.String |
DATABASE_TEST_URL |
static java.lang.String |
DATABASE_URL |
static java.lang.String |
DATABASE_URL_PREFIX |
static java.lang.String |
DATABASE_USER |
static boolean |
RECREATE_DATABASE |
static java.lang.String |
SCHEMA_URL_PREFIX |
static java.util.concurrent.ConcurrentMap<java.lang.String,DatabaseMemory.SessionInfo> |
sessions |
static boolean |
TEST |
Constructor and Description |
---|
DatabaseMemory() |
Modifier and Type | Method and Description |
---|---|
void |
abort()
Clear the memory.
|
void |
awake()
Load any properties and init.
|
int |
cacheSize() |
void |
checkSchemaVersion() |
void |
clearProperties(java.lang.String propertySet)
Delete the property set.
|
void |
createMemory(java.lang.String database)
Create the database.
|
void |
createMemory(java.lang.String database,
boolean schema)
Create the database.
|
void |
createMemoryFromTemplate(java.lang.String database,
boolean isSchema,
java.lang.String template,
boolean templateIsSchema)
Create the database.
|
void |
deleteMemory()
Delete all content from the database.
|
void |
destroyMemory(java.lang.String database,
boolean isSchema)
Drop the database.
|
boolean |
executeDDL(java.lang.String ddl) |
void |
fastRestore(java.lang.String database,
boolean isSchema)
Connect and create the EntityManager.
|
static void |
forceShutdown(java.lang.String name) |
void |
freeMemory() |
javax.persistence.EntityManager |
getEntityManager() |
javax.persistence.EntityManagerFactory |
getFactory() |
java.lang.String |
getMemoryName()
Return the current connected database name.
|
void |
importMemory(java.lang.String database)
Import the database into this instance.
|
void |
initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
Initialize any configurable settings from the properties.
|
void |
initMemory() |
boolean |
isSchema() |
void |
loadProperties(java.lang.String propertySet)
Load the property set.
|
Network |
newMemory()
Return an isolated transactional memory.
|
void |
pool()
Reset state when instance is pooled.
|
void |
restore()
This implementation does not support persistence.
|
void |
restore(java.lang.String database,
boolean isSchema)
Connect and create the EntityManager.
|
void |
restore(java.lang.String database,
boolean isSchema,
boolean recreateDatabase)
Connect and create the EntityManager.
|
void |
save()
Commit short-term memory to the database.
|
void |
setEntityManager(javax.persistence.EntityManager entityManager) |
void |
setFactory(javax.persistence.EntityManagerFactory factory) |
void |
setSchema(boolean isSchema) |
void |
shutdown()
Shutdown the database.
|
void |
switchMemory(java.lang.String database)
Switch to a different database.
|
void |
switchMemory(java.lang.String database,
boolean isSchema)
Switch to a different database.
|
addActiveMemory, addListener, createMemoryFromTemplate, destroyMemory, find, findInstances, findInstances, findReferences, findReferencesBy, getActiveMemory, getBot, getListeners, getLongTermMemory, getProperties, getProperty, getShortTermMemory, removeListener, removeProperty, setActiveMemory, setBot, setLongTermMemory, setProperties, setProperty, setShortTermMemory, toString
public static java.lang.String DATABASE_USER
public static java.lang.String DATABASE_PASSWORD
public static java.lang.String DATABASE_URL_PREFIX
public static java.lang.String SCHEMA_URL_PREFIX
public static java.lang.String DATABASE_URL
public static java.lang.String DATABASE_TEST_URL
public static java.lang.String DATABASE_DRIVER
public static java.lang.String CACHE_SIZE
public static boolean TEST
public static boolean RECREATE_DATABASE
public static java.util.concurrent.ConcurrentMap<java.lang.String,DatabaseMemory.SessionInfo> sessions
public void initialize(java.util.Map<java.lang.String,java.lang.Object> properties)
initialize
in interface Memory
initialize
in class BasicMemory
public javax.persistence.EntityManagerFactory getFactory()
public void setFactory(javax.persistence.EntityManagerFactory factory)
public javax.persistence.EntityManager getEntityManager()
public void setEntityManager(javax.persistence.EntityManager entityManager)
public boolean isSchema()
public void setSchema(boolean isSchema)
public void save()
save
in interface Memory
save
in class BasicMemory
public void pool()
pool
in interface Memory
pool
in class BasicMemory
public void shutdown()
shutdown
in interface Memory
shutdown
in class BasicMemory
public void restore()
restore
in interface Memory
restore
in class BasicMemory
public void restore(java.lang.String database, boolean isSchema)
restore
in interface Memory
restore
in class BasicMemory
public void checkSchemaVersion()
public void restore(java.lang.String database, boolean isSchema, boolean recreateDatabase)
public static void forceShutdown(java.lang.String name)
public void initMemory()
initMemory
in class BasicMemory
public void fastRestore(java.lang.String database, boolean isSchema)
fastRestore
in interface Memory
fastRestore
in class BasicMemory
public void awake()
awake
in interface Memory
awake
in class BasicMemory
public void loadProperties(java.lang.String propertySet)
loadProperties
in interface Memory
loadProperties
in class BasicMemory
public void clearProperties(java.lang.String propertySet)
clearProperties
in interface Memory
clearProperties
in class BasicMemory
public boolean executeDDL(java.lang.String ddl)
public Network newMemory()
newMemory
in interface Memory
newMemory
in class BasicMemory
public java.lang.String getMemoryName()
getMemoryName
in interface Memory
getMemoryName
in class BasicMemory
public void createMemory(java.lang.String database)
createMemory
in interface Memory
createMemory
in class BasicMemory
public void createMemory(java.lang.String database, boolean schema)
createMemory
in interface Memory
createMemory
in class BasicMemory
public void createMemoryFromTemplate(java.lang.String database, boolean isSchema, java.lang.String template, boolean templateIsSchema)
createMemoryFromTemplate
in interface Memory
createMemoryFromTemplate
in class BasicMemory
public void destroyMemory(java.lang.String database, boolean isSchema)
destroyMemory
in interface Memory
destroyMemory
in class BasicMemory
public void deleteMemory()
deleteMemory
in interface Memory
deleteMemory
in class BasicMemory
public void switchMemory(java.lang.String database)
switchMemory
in interface Memory
switchMemory
in class BasicMemory
public void switchMemory(java.lang.String database, boolean isSchema)
switchMemory
in interface Memory
switchMemory
in class BasicMemory
public void importMemory(java.lang.String database)
importMemory
in interface Memory
importMemory
in class BasicMemory
public void abort()
abort
in interface Memory
abort
in class BasicMemory
public int cacheSize()
cacheSize
in interface Memory
cacheSize
in class BasicMemory
public void freeMemory()
freeMemory
in interface Memory
freeMemory
in class BasicMemory