public class PersistStorageImpl extends PersistStorage
PersistStorage, which provides persistence
in plain HashMap<String,String> serialized into file.persistPolicy| Constructor and Description |
|---|
PersistStorageImpl(java.lang.String filename)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
PersistEntryScalar |
getPersistScalar(FID id)
Returns persistent scalar entry or null if not exist.
|
PersistEntryScalar[] |
getPersistScalars()
Returns array of persistent entries with scalars
in this persistence storage.
|
PersistEntryTable |
getPersistTable(FID id)
Returns persistent scalar entry or null if not exist.
|
PersistEntryTable[] |
getPersistTables()
Returns array of persistent entries with scalars
in this persistence storage.
|
void |
put(FScalar scalar)
Saves scalar in persistence storage.
|
void |
put(FTable table)
Saves table in persistence storage.
|
void |
remove(FID id)
Removes object from persistence storage.
|
void |
save()
Saves persistence storage.
|
getPersistPolicy, setPersistPolicy, shutdownpublic PersistStorageImpl(java.lang.String filename)
throws FException
filename - filename.FException - failure to create persistence storage.public void put(FScalar scalar) throws FException
put in class PersistStoragescalar - scalar to be saved in persistent storage.FException - exception thrown in derived class.PersistStorage.put(org.friendlysnmp.FScalar)public PersistEntryScalar getPersistScalar(FID id)
getPersistScalar in class PersistStorageid - id of the stored object.PersistStorage.getPersistScalar(FID)public PersistEntryScalar[] getPersistScalars()
getPersistScalars in class PersistStoragePersistStorage.getPersistScalars()public void put(FTable table) throws FException
put in class PersistStoragetable - table to be saved in persistent storage.FException - exception thrown in derived class.PersistStorage.put(org.friendlysnmp.FTable)public PersistEntryTable getPersistTable(FID id)
getPersistTable in class PersistStorageid - id of the stored objectPersistStorage.getPersistScalar(FID)public PersistEntryTable[] getPersistTables()
getPersistTables in class PersistStoragePersistStorage.getPersistScalars()public void remove(FID id) throws FException
remove in class PersistStorageid - object ID.FException - exception thrown in derived class.PersistStorage.remove(org.friendlysnmp.FID)public void save()
throws FException
save in class PersistStorageFException - exception thrown in derived class.PersistStorage.save()