public class RecordStorageImpl extends java.lang.Object implements RecordStorage
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUNDLE_NAME
name of bundle.
|
static java.lang.String |
CONFIGURATION_FILE
name of configuration file.
|
static java.lang.String |
PERSISTENCE_UNIT_NAME
Constant for the eclipseLink persistence unit name.
|
| Constructor and Description |
|---|
RecordStorageImpl()
Default Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
activate(ComponentContext context)
DS activate method.
|
protected void |
deactivate(ComponentContext context)
DS deactivate method.
|
boolean |
existsRecord(java.lang.String id)
Checks if a Record exists in the storage.
|
Record |
loadRecord(java.lang.String id)
Load the record from storage.
|
java.util.Iterator<Record> |
loadRecords(java.lang.String source)
Loads all records of the given source.
|
void |
removeRecord(java.lang.String id)
Removes the record.
|
void |
storeRecord(Record record)
Stores the given Record object.
|
public static final java.lang.String BUNDLE_NAME
public static final java.lang.String PERSISTENCE_UNIT_NAME
public static final java.lang.String CONFIGURATION_FILE
protected void activate(ComponentContext context)
throws java.lang.Exception
context - ComponentContextjava.lang.Exception - if any error occursprotected void deactivate(ComponentContext context)
throws java.lang.Exception
context - the ComponentContextjava.lang.Exception - if any error occurspublic Record loadRecord(java.lang.String id) throws RecordStorageException
loadRecord in interface RecordStorageid - Id of the recordRecordStorageException - if any error occurspublic void storeRecord(Record record) throws RecordStorageException
storeRecord in interface RecordStoragerecord - the Record objectRecordStorageException - if any error occurspublic void removeRecord(java.lang.String id)
throws RecordStorageException
removeRecord in interface RecordStorageid - Id of the recordRecordStorageException - if any error occurspublic boolean existsRecord(java.lang.String id)
throws RecordStorageException
existsRecord in interface RecordStorageid - Id of the recordRecordStorageException - if any error occurspublic java.util.Iterator<Record> loadRecords(java.lang.String source) throws RecordStorageException
loadRecords in interface RecordStoragesource - the name of the data sourceRecordStorageException - if any error occursorg.eclipse.smila.recordstorage.RecordStorage#findRecordsBySource(java.lang.String)