public class BTreeTransition extends java.lang.Object implements DatabaseTransition
Constructor and Description |
---|
BTreeTransition()
Constructor
|
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<?> peristentType,
java.lang.String taskID,
Instruction instruction)
Execute an instruction delete
|
boolean |
exists(TransactionContext context,
PersistentType<?> persistentType,
java.lang.Object key)
Checks, if an object exists
|
org.resoa.json.JSONObject |
finalizeRelations(TransactionContext context,
PersistentType<?> persistentType,
org.resoa.json.JSONObject json)
Finalize persistent relations
|
java.lang.Object |
getDatabase() |
<T> T |
getInstance(TransactionContext context,
PersistentType<T> persistentType,
java.lang.Object key)
read with strict type binding
|
java.lang.String |
getJSONFromDB(TransactionContext context,
PersistentType<?> persistentType,
java.lang.Object key)
Provide an unprocessed JSON string
|
BTreeStorage |
getStorage() |
void |
init(PersistentDomain domain)
Initialize the database
|
void |
newPersistenceType(PersistentType<?> persistentType)
Activate persistence for a new type
|
org.resoa.grid.RecordSet |
readRecords(TransactionContext context,
PersistentType<?> peristentType,
org.resoa.grid.RecordSet result,
boolean keysOnly)
Read a set of records from database
|
void |
setStorage(BTreeStorage storage) |
TransactionContext |
startTransaction(java.lang.String domain,
TransactionContext.TransactionType type)
Start a transaction for a persistent service domain
|
void |
stop()
Clear all locks
|
void |
storeRecord(TransactionContext context,
PersistentType<?> peristentType,
java.lang.String taskID,
Instruction instruction)
Store a single instruction
|
public void setStorage(BTreeStorage storage)
storage
- the storage to setpublic BTreeStorage getStorage()
public void init(PersistentDomain domain) throws org.resoa.exception.PersistenceException
DatabaseTransition
init
in interface DatabaseTransition
org.resoa.exception.PersistenceException
public 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()
stop
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 java.lang.String getJSONFromDB(TransactionContext context, PersistentType<?> persistentType, java.lang.Object key)
getJSONFromDB
in interface DatabaseTransition
persistentType
- the PersistentType descriptorkey
- the keypublic <T> T getInstance(TransactionContext context, PersistentType<T> persistentType, java.lang.Object key)
getInstance
in interface DatabaseTransition
persistentType
- the PersistentDescriptorkey
- the keypublic boolean exists(TransactionContext context, PersistentType<?> persistentType, java.lang.Object key)
exists
in interface DatabaseTransition
persistentType
- the PersistentDescriptorkey
- the keyLockException
public void storeRecord(TransactionContext context, PersistentType<?> peristentType, 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<?> peristentType, 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<?> peristentType, org.resoa.grid.RecordSet result, boolean keysOnly)
DatabaseTransition
readRecords
in interface DatabaseTransition
public org.resoa.json.JSONObject finalizeRelations(TransactionContext context, PersistentType<?> persistentType, org.resoa.json.JSONObject json)
DatabaseTransition
finalizeRelations
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.