public class RealmFileRW extends Object implements RealmReaderWriter
| Constructor and Description |
|---|
RealmFileRW(String realmName,
String basePath)
Opens RW on a specified realm.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
create(RealmDefinition rd)
Creates a new new realm store.
|
void |
deleteCachedAsOriginal(String id) |
void |
deleteMasterRecord(String unsanitizedId) |
void |
deleteOverrideRecord(String unsanitizedId) |
void |
deleteParentRealm(String unsanitizedId) |
void |
deleteWorldRecordsByParentId(String prId) |
RealmDefinition |
describe()
Retrieves RealmDefinition for the given realm.
|
void |
destroy()
Destroys the underlying record store;
|
Object |
getLock(String host) |
boolean |
isCachedAsParent()
In case the realm serves as parent to other realms within the same torus
installation, the following function allows for fast propagation of changes
to child realms.
|
List<RealmDefinition> |
listRealms()
List all realms available within the torus.
|
List<RealmReaderWriter> |
listRWs(boolean open) |
boolean |
open()
Attempts to open the realm store pointed to by this instance.
|
Record.Layer |
readMasterRecord(String unsanitizedId) |
List<Record.Layer> |
readMasterRecords() |
Record.Layer |
readOverrideRecord(String unsanitizedId)
Retrieve override record by id.
|
List<Record.Layer> |
readOverrideRecords()
Retrieve a list of override records within this realm, the query
parameter is used ONLY to early filter out false matches, that is
records that CONTAIN a given query field but the value DOES NOT match.
|
ParentRealm |
readParentRealm(String unsanitizedId) |
List<ParentRealm> |
readParentRealms() |
Record.Layer |
readWorldRecord(String id)
Retrieve world (within a set of parents) record by id.
|
Pair<List<Record.Layer>,Date> |
readWorldRecordsForParent(String prId)
Retrieve a time-stamped list of records for a parent specified within this realm,
|
boolean |
update(RealmDefinition rd)
Updates realm meta-data.
|
Record.Layer |
updateCachedAsOriginal(Record.Layer original) |
Record.Layer |
writeMasterRecord(Record.Layer masterLayer) |
Record.Layer |
writeMasterRecord(String unsanitizedId,
Record.Layer update) |
Record.Layer |
writeOverrideRecord(Record.Layer override)
The method is to write new record to the record store.
|
Record.Layer |
writeOverrideRecord(String unsanitizedId,
Record.Layer update)
Write data to the existing record.
|
ParentRealm |
writeParentRealm(ParentRealm pr) |
ParentRealm |
writeParentRealm(String unsanitizedId,
ParentRealm pr) |
List<Record.Layer> |
writeWorldRecordsForParent(List<Record.Layer> doc,
String prId)
Stores parent records for the given parent, updates each world record
with an ID unique to this realm (so world records can be looked up without
specifying parent)
|
List<Record.Layer> |
writeWorldRecordsForParent(List<Record.Layer> doc,
String prId,
Date timestamp) |
public boolean create(RealmDefinition rd) throws InternalIOException
RealmReaderWritercreate in interface RealmReaderWriterInternalIOException - when creation failedpublic boolean update(RealmDefinition rd) throws InternalIOException
RealmReaderWriterupdate in interface RealmReaderWriterInternalIOExceptionpublic boolean open()
throws InternalIOException
RealmReaderWriteropen in interface RealmReaderWriterInternalIOExceptionpublic RealmDefinition describe()
RealmReaderWriterdescribe in interface RealmReaderWriterpublic void destroy()
throws InternalIOException
RealmReaderWriterdestroy in interface RealmReaderWriterInternalIOExceptionpublic List<Record.Layer> readOverrideRecords() throws InternalIOException
RealmReaderWriterreadOverrideRecords in interface RealmReaderWriterInternalIOException - when experiencing problems reading/parsing recordspublic Record.Layer readOverrideRecord(String unsanitizedId) throws InternalIOException
RealmReaderWriterreadOverrideRecord in interface RealmReaderWriterunsanitizedId - override record idInternalIOException - when experiencing problems reading/parsing recordspublic Record.Layer writeOverrideRecord(String unsanitizedId, Record.Layer update) throws InternalIOException
RealmReaderWriterwriteOverrideRecord in interface RealmReaderWriterunsanitizedId - id of the recordsInternalIOExceptionpublic Record.Layer writeOverrideRecord(Record.Layer override) throws InternalIOException
RealmReaderWriterwriteOverrideRecord in interface RealmReaderWriterInternalIOExceptionpublic void deleteOverrideRecord(String unsanitizedId) throws InternalIOException
deleteOverrideRecord in interface RealmReaderWriterInternalIOExceptionpublic Pair<List<Record.Layer>,Date> readWorldRecordsForParent(String prId) throws InternalIOException
RealmReaderWriterreadWorldRecordsForParent in interface RealmReaderWriterInternalIOException - when experiencing problems reading/parsing recordspublic Record.Layer readWorldRecord(String id) throws InternalIOException
RealmReaderWriterreadWorldRecord in interface RealmReaderWriterInternalIOException - when experiencing problems reading/parsing recordspublic List<Record.Layer> writeWorldRecordsForParent(List<Record.Layer> doc, String prId) throws InternalIOException
RealmReaderWriterwriteWorldRecordsForParent in interface RealmReaderWriterInternalIOExceptionpublic List<Record.Layer> writeWorldRecordsForParent(List<Record.Layer> doc, String prId, Date timestamp) throws InternalIOException
writeWorldRecordsForParent in interface RealmReaderWriterInternalIOExceptionpublic void deleteWorldRecordsByParentId(String prId) throws InternalIOException
deleteWorldRecordsByParentId in interface RealmReaderWriterInternalIOExceptionpublic ParentRealm writeParentRealm(String unsanitizedId, ParentRealm pr) throws InternalIOException
writeParentRealm in interface RealmReaderWriterInternalIOExceptionpublic ParentRealm writeParentRealm(ParentRealm pr) throws InternalIOException
writeParentRealm in interface RealmReaderWriterInternalIOExceptionpublic ParentRealm readParentRealm(String unsanitizedId) throws InternalIOException
readParentRealm in interface RealmReaderWriterInternalIOExceptionpublic void deleteParentRealm(String unsanitizedId) throws InternalIOException
deleteParentRealm in interface RealmReaderWriterInternalIOExceptionpublic List<ParentRealm> readParentRealms() throws InternalIOException
readParentRealms in interface RealmReaderWriterInternalIOExceptionpublic List<RealmReaderWriter> listRWs(boolean open) throws InternalIOException
InternalIOExceptionpublic List<RealmDefinition> listRealms() throws InternalIOException
RealmReaderWriterlistRealms in interface RealmReaderWriterInternalIOExceptionpublic boolean isCachedAsParent()
throws InternalIOException
RealmReaderWriterisCachedAsParent in interface RealmReaderWriterInternalIOExceptionpublic Record.Layer updateCachedAsOriginal(Record.Layer original) throws InternalIOException
updateCachedAsOriginal in interface RealmReaderWriterInternalIOExceptionpublic void deleteCachedAsOriginal(String id) throws InternalIOException
deleteCachedAsOriginal in interface RealmReaderWriterInternalIOExceptionpublic List<Record.Layer> readMasterRecords() throws InternalIOException
readMasterRecords in interface RealmReaderWriterInternalIOExceptionpublic Record.Layer readMasterRecord(String unsanitizedId) throws InternalIOException
readMasterRecord in interface RealmReaderWriterInternalIOExceptionpublic Record.Layer writeMasterRecord(String unsanitizedId, Record.Layer update) throws InternalIOException
writeMasterRecord in interface RealmReaderWriterInternalIOExceptionpublic Record.Layer writeMasterRecord(Record.Layer masterLayer) throws InternalIOException
writeMasterRecord in interface RealmReaderWriterInternalIOExceptionpublic void deleteMasterRecord(String unsanitizedId) throws InternalIOException
deleteMasterRecord in interface RealmReaderWriterInternalIOExceptionCopyright © 2008-2015 Index Data. All Rights Reserved.