Package org.treetank.access

Access to Treetank

See: Description

Package org.treetank.access Description

Access to Treetank

The access semantics is as follows:

Code examples:

 // StorageConfiguration denoted the configuration for a connected set of data resources. 
 final StorageConfiguration dbConfig = new StorageConfiguration(new File("/path/to/db/location"));
 // Creation of a database. Returns true if successful, false if not (including existence of the database)
 Storage.createDatabase(dbConfig);
 // Getting of database instance, will be a singleton for the denoted path
 final IStorage database = Storage.openDatabase(new File("/path/to/db/location");
 // Creation of a resource within the db. The creation includes the setting of versioning, etc. It must take place only one.
 final ResourceConfiguration resourceConfig = new ResourceConfiguration.Builder("coolResource").setRevision(ERevisioning.Differential).build();
 database.createResource(resourceConfig);
 // Getting access via a ISession
 final SessionConfiguration sessionConfig = new SessionConfiguration("coolResource");
 final ISession someSession = Session.beginSession(sessionConfig);
  
 final IBucketWriteTrx someWTX = someSession.beginWriteTransaction();
 
 someWTX.abort();
 someWTX.close();
 someSession.close();
 database.close();
 

Author:
Sebastian Graf, University of Konstanz

Copyright © 2013. All Rights Reserved.