public class FileRecordStore extends Object implements IRecordStore
IRecordStore using a RandomAccessFile over a local file as the persistency medium| Constructor and Description |
|---|
FileRecordStore()
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes the
IRecordStore instance as well as any permanent storage resources occupied |
void |
enableOrder(boolean enableOrder)
Whether the
IRecordStore.retrieveByIndex(long, boolean) operation should be enabled or not |
long |
getRecordCount()
Retrieves the number of
Records stored using this IRecordStore |
void |
persist(Record record)
Persists the provided
Record |
Record |
retrieve(long recordID,
boolean reset)
Retrieves a previously stored
Record based on its id |
Record |
retrieveByIndex(long recordIndex,
boolean reset)
Retrieve a previously stored
Record based on the index by which it was stored. |
public FileRecordStore()
throws IOException
IOExceptionpublic void enableOrder(boolean enableOrder)
IRecordStore.retrieveByIndex(long, boolean) operation should be enabled or notenableOrder in interface IRecordStoreenableOrder - whether the IRecordStore.retrieveByIndex(long, boolean) operation should be enabled or notIRecordStore.enableOrder(boolean)public long getRecordCount()
Records stored using this IRecordStoregetRecordCount in interface IRecordStoreRecords storedIRecordStore.getRecordCount()public void dispose()
throws GRS2RecordStoreException
IRecordStore instance as well as any permanent storage resources occupieddispose in interface IRecordStoreGRS2RecordStoreException - the state of the IRecordStore does not allow for this operation to be completedIRecordStore.dispose()public void persist(Record record) throws GRS2RecordStoreException
Recordpersist in interface IRecordStorerecord - the Record to persistGRS2RecordStoreException - the state of the IRecordStore does not allow for this operation to be completedIRecordStore.persist(gr.uoa.di.madgik.grs.record.Record)public Record retrieve(long recordID, boolean reset) throws GRS2RecordStoreException
Record based on its idretrieve in interface IRecordStorerecordID - the ID of the Record to be retrievedreset - whether during the Record.inflate(java.io.DataInput, boolean) invocation
the reset parameter should be set to true or falseRecord retrievedGRS2RecordStoreException - the state of the IRecordStore does not allow for this operation to be completedIRecordStore.retrieve(long, boolean)public Record retrieveByIndex(long recordIndex, boolean reset) throws GRS2RecordStoreException
Record based on the index by which it was stored. This method is only
available if before the first time a IRecordStore.persist(Record) was invoked the method
IRecordStore.enableOrder(boolean) has been set to trueretrieveByIndex in interface IRecordStorerecordIndex - The index by which the Record to be retrieved was storedreset - whether during the Record.inflate(java.io.DataInput, boolean) invocation
the reset parameter should be set to true or falseRecord retrievedGRS2RecordStoreException - the state of the IRecordStore does not allow for this operation to be completedIRecordStore.retrieveByIndex(long, boolean)Copyright © 2014. All Rights Reserved.