public class SQLTransition extends java.lang.Object implements DatabaseTransition
Constructor and Description |
---|
SQLTransition()
Empty Constructor used by Persistence Factory
You need to set the DatabaseManager instance before initializing
|
SQLTransition(DatabaseManager databaseManager)
Constructor with databaseManager hande
|
Modifier and Type | Method and Description |
---|---|
void |
backup(PersistentDomain domain)
Backup a persistent domain
|
void |
closePersistenceDomain(java.lang.String domain)
Stop persistence service for a domain
|
void |
deleteRecord(TransactionContext context,
PersistentType<?> persistentType,
java.lang.String taskID,
Instruction instruction)
Execute an instruction delete
|
boolean |
exists(TransactionContext context,
PersistentType<?> persistentType,
java.lang.Object key)
Indicate, if an object exists within persistence
|
org.resoa.json.JSONObject |
finalizeRelations(TransactionContext context,
PersistentType<?> persistentType,
org.resoa.json.JSONObject json)
Finalize persistent relations
|
java.lang.Object |
getDatabase() |
DatabaseManager |
getDatabaseManager() |
<T> T |
getInstance(TransactionContext context,
PersistentType<T> persistentType,
java.lang.Object key)
Return an object instance
|
java.lang.String |
getJSONFromDB(TransactionContext context,
PersistentType<?> persistentType,
java.lang.Object key)
return the unresolved JSON representation of an object, before the transaction starts
|
void |
init(PersistentDomain persistDomain)
Initialize the database
|
void |
newPersistenceType(PersistentType<?> persistentType)
Activate persistence for a new type
|
org.resoa.grid.RecordSet |
readRecords(TransactionContext context,
PersistentType<?> persistentType,
org.resoa.grid.RecordSet requestRules,
boolean keysOnly)
Read a set of records from database
|
void |
setDatabaseManager(DatabaseManager databaseManager) |
TransactionContext |
startTransaction(java.lang.String domain,
TransactionContext.TransactionType type)
Start a transaction for a persistent service domain
|
void |
stop()
Stop all services
|
void |
storeRecord(TransactionContext context,
PersistentType<?> persistentType,
java.lang.String taskID,
Instruction instruction)
Store a single instruction
|
public SQLTransition()
public SQLTransition(DatabaseManager databaseManager)
databaseManager
- public DatabaseManager getDatabaseManager()
public void setDatabaseManager(DatabaseManager databaseManager)
databaseManager
- the databaseManager to setpublic void newPersistenceType(PersistentType<?> persistentType) throws org.resoa.exception.PersistenceException
DatabaseTransition
newPersistenceType
in interface DatabaseTransition
org.resoa.exception.PersistenceException
public void closePersistenceDomain(java.lang.String domain)
DatabaseTransition
closePersistenceDomain
in interface DatabaseTransition
public void stop()
DatabaseTransition
stop
in interface DatabaseTransition
public java.lang.String getJSONFromDB(TransactionContext context, PersistentType<?> persistentType, java.lang.Object key)
DatabaseTransition
getJSONFromDB
in interface DatabaseTransition
public <T> T getInstance(TransactionContext context, PersistentType<T> persistentType, java.lang.Object key)
DatabaseTransition
getInstance
in interface DatabaseTransition
public boolean exists(TransactionContext context, PersistentType<?> persistentType, java.lang.Object key)
DatabaseTransition
exists
in interface DatabaseTransition
public org.resoa.json.JSONObject finalizeRelations(TransactionContext context, PersistentType<?> persistentType, org.resoa.json.JSONObject json)
DatabaseTransition
finalizeRelations
in interface DatabaseTransition
public TransactionContext startTransaction(java.lang.String domain, TransactionContext.TransactionType type) throws org.resoa.exception.PersistenceException
DatabaseTransition
startTransaction
in interface DatabaseTransition
org.resoa.exception.PersistenceException
public void init(PersistentDomain persistDomain) throws org.resoa.exception.PersistenceException
DatabaseTransition
init
in interface DatabaseTransition
org.resoa.exception.PersistenceException
public void storeRecord(TransactionContext context, PersistentType<?> persistentType, java.lang.String taskID, Instruction instruction) throws org.resoa.exception.PersistenceException
DatabaseTransition
storeRecord
in interface DatabaseTransition
org.resoa.exception.PersistenceException
public void deleteRecord(TransactionContext context, PersistentType<?> persistentType, java.lang.String taskID, Instruction instruction) throws org.resoa.exception.PersistenceException
DatabaseTransition
deleteRecord
in interface DatabaseTransition
org.resoa.exception.PersistenceException
public org.resoa.grid.RecordSet readRecords(TransactionContext context, PersistentType<?> persistentType, org.resoa.grid.RecordSet requestRules, boolean keysOnly)
DatabaseTransition
readRecords
in interface DatabaseTransition
public java.lang.Object getDatabase()
getDatabase
in interface DatabaseTransition
public void backup(PersistentDomain domain) throws org.resoa.exception.PersistenceException
DatabaseTransition
backup
in interface DatabaseTransition
org.resoa.exception.PersistenceException
Copyright © 2005-2014 The Resoa Project, resoa.org.