public interface IStorage
IStorage
is a persistent place
where all data is stored.
Resources must be created within this IStorage
with the help of ResourceConfiguration
s.
//Creating the Storage
Storage.createDatabase(new StorageConfiguration(FILE));
final IStorage storage = Storage.openStorage(FILE);
//Getting a ResourceConfiguration over Guice.
storage.createResource(mResourceConfig);
The access to the data is done with the help of ISession
s:
//Ensure, storage and resources are created
final IStorage storage = Storage.openStorage(FILE);
final ISession session =
storage.getSession(new SessionConfiguration(RESOURCENAME, KEY));
final IBucketReadTrx pRtx = session.beginBucketRtx(REVISION);
final IBucketWriteTrx pWtx = session.beginBucketWtx();
Modifier and Type | Method and Description |
---|---|
boolean |
close()
Closing the database for further access.
|
boolean |
createResource(ResourceConfiguration pResConf)
Initialization of a resource.
|
boolean |
existsResource(String pResourceName)
Is the resource within this database existing?
|
File |
getLocation()
Getting the file location of this database.
|
ISession |
getSession(SessionConfiguration pSessionConf)
Getting the session associated within this database.
|
String[] |
listResources()
Listing all resources within this database.
|
boolean |
truncateResource(SessionConfiguration pResConf)
Truncating a resource.
|
boolean createResource(ResourceConfiguration pResConf) throws TTException
pResConf
- the config of the resourceTTIOException
- if anything happens while creating the resourceTTException
ISession getSession(SessionConfiguration pSessionConf) throws TTException
pSessionConf
- SessionConfiguration
referenceTTException
- if can't get sessionboolean truncateResource(SessionConfiguration pResConf) throws TTException
pResConf
- storing the name of the resourceTTException
- if anything weird happensboolean existsResource(String pResourceName)
pResourceName
- ot be checkedString[] listResources()
File getLocation()
boolean close() throws TTException
TTException
- if anything happens within treetank.Copyright © 2013. All Rights Reserved.