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, toStringpublic 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 Memoryinitialize in class BasicMemorypublic 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 Memorysave in class BasicMemorypublic void pool()
pool in interface Memorypool in class BasicMemorypublic void shutdown()
shutdown in interface Memoryshutdown in class BasicMemorypublic void restore()
restore in interface Memoryrestore in class BasicMemorypublic void restore(java.lang.String database,
boolean isSchema)
restore in interface Memoryrestore in class BasicMemorypublic 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 BasicMemorypublic void fastRestore(java.lang.String database,
boolean isSchema)
fastRestore in interface MemoryfastRestore in class BasicMemorypublic void awake()
awake in interface Memoryawake in class BasicMemorypublic void loadProperties(java.lang.String propertySet)
loadProperties in interface MemoryloadProperties in class BasicMemorypublic void clearProperties(java.lang.String propertySet)
clearProperties in interface MemoryclearProperties in class BasicMemorypublic boolean executeDDL(java.lang.String ddl)
public Network newMemory()
newMemory in interface MemorynewMemory in class BasicMemorypublic java.lang.String getMemoryName()
getMemoryName in interface MemorygetMemoryName in class BasicMemorypublic void createMemory(java.lang.String database)
createMemory in interface MemorycreateMemory in class BasicMemorypublic void createMemory(java.lang.String database,
boolean schema)
createMemory in interface MemorycreateMemory in class BasicMemorypublic void createMemoryFromTemplate(java.lang.String database,
boolean isSchema,
java.lang.String template,
boolean templateIsSchema)
createMemoryFromTemplate in interface MemorycreateMemoryFromTemplate in class BasicMemorypublic void destroyMemory(java.lang.String database,
boolean isSchema)
destroyMemory in interface MemorydestroyMemory in class BasicMemorypublic void deleteMemory()
deleteMemory in interface MemorydeleteMemory in class BasicMemorypublic void switchMemory(java.lang.String database)
switchMemory in interface MemoryswitchMemory in class BasicMemorypublic void switchMemory(java.lang.String database,
boolean isSchema)
switchMemory in interface MemoryswitchMemory in class BasicMemorypublic void importMemory(java.lang.String database)
importMemory in interface MemoryimportMemory in class BasicMemorypublic void abort()
abort in interface Memoryabort in class BasicMemorypublic int cacheSize()
cacheSize in interface MemorycacheSize in class BasicMemorypublic void freeMemory()
freeMemory in interface MemoryfreeMemory in class BasicMemory