/**
* low level vamsas document management routines
+ * analogous to ClientsFile
* This class is not thread safe.
* @author jimp
*
*/
-public class documentHandler {
+public class VamsasFile {
/**
* Vamsas client is intialised with a path to create live session directories.
* This path may contain a vamsas.properties file
private long timeout=1000; // time in milliseconds before we give up getting a lock
private long interval=100; // time between attempts to lock
private PrintWriter vamsasWriterStream; // non null if there is a write to a new Document in progress.
- public documentHandler(File sessionDir) throws java.io.IOException {
- newSessionDir = File.createTempFile("vamsasSimple", "session", sessionDir);
+ /**
+ *
+ * Connect to an existing Vamsas document in a given sessionDir
+ * or create a new one.
+ *
+ * @param sessionDir
+ * @throws java.io.IOException
+ */
+ public VamsasFile(File sessionDir) throws java.io.IOException {
+ // check if directory exists. if not, create it.
+ // check if vamsas jar exists, if not, create it.
+
}
-
- public documentHandler(File lockfile, File vamsasJar) {
- this.lockfile = lockfile;
- this.vamsasJar = vamsasJar;
+ /**
+ * Expand a previously stored session into the sessionDir
+ * @param sessionDir
+ * @param storedSession
+ */
+ public VamsasFile(File sessionDir, JarFile storedSession) throws IOException {
+ // check if sessionDir is live or not
+
+ // if live - try to merge storedSession with sessionDir
+ // - will probably fail through duplicate object references needing to be dereferenced.
+ // TODO: think of a way of specifying vorba_id scope for an application's references to allow merging of one vamsasDocument with another.
+
}
/**
- * gets an unlocked stream from the vamsas document.
+ * gets a locked Reader for the vamsas document.
* @return reader for vamsasdocument.xml enrty
*/
public java.io.Reader getDocumentReader() {