refactored org to uk
[vamsas.git] / src / org / vamsas / client / simpleclient / SimpleClient.java
index 970bcfa..2041c11 100644 (file)
@@ -23,6 +23,7 @@ import org.vamsas.client.ClientHandle;
 import org.vamsas.client.Events;
 import org.vamsas.client.IClient;
 import org.vamsas.client.IClientDocument;
+import org.vamsas.client.IObjectUpdate;
 import org.vamsas.client.InvalidSessionUrnException;
 import org.vamsas.client.SessionHandle;
 import org.vamsas.client.UserHandle;
@@ -49,6 +50,10 @@ public class SimpleClient implements IClient {
   protected EventGeneratorThread evgen = null;
   protected ClientDocument cdocument = null;
   /**
+   * object hash table that persists in each client holding vorbaIds and hash values after a document write
+   */
+  protected Hashtable extantobjects=null;
+  /**
    * construct a transient IdFactory instance - this should last only as long as the 
    * SimpleClient object holds the lock on the vamsas document being created/manipulated.
    * @return
@@ -152,7 +157,7 @@ public class SimpleClient implements IClient {
    * @return user field for a provenance entry
    */
   protected String getProvenanceUser() {
-    return new String(user.getFullName()+" ["+client.getClientUrn()+"]");
+    return new String(user.getFullName());
   }
   /**
    * construct a provenance entry for this client with the specified action string.
@@ -160,8 +165,7 @@ public class SimpleClient implements IClient {
    * @return properly completed provenance entry
    */
   protected Entry getProvenanceEntry(String action) {
-    // VAMSAS: modify schema to allow referencing of user field (plus other issues, ClientUrn field, machine readable action, input parameters, additional data generated notes
-    Entry prov = ProvenanceStuff.newProvenanceEntry(getProvenanceUser(), action);
+    Entry prov = ProvenanceStuff.newProvenanceEntry(client.getClientUrn(), getProvenanceUser(), action);
     return prov;
   }
   private Hashtable handlers = initHandlers();
@@ -288,10 +292,11 @@ public class SimpleClient implements IClient {
     // garbage collect the ClientDocument instance.
     try {
       cdocument.finalize();
+
     } catch (Throwable e) {
       log.error("Exception when trying to garbage collect ClientDocument for "+session.getSessionUrn(), e);
     }
-    cdocument = null;
+    cdocument = null; // this is probably done by finalize
   }
   
   /*
@@ -341,7 +346,7 @@ public class SimpleClient implements IClient {
     }
     
     if (!evgen.isAlive()) {
-      log.warn("pollUpdate called before joinSession()");
+      log.warn("pollUpdate called before joinSession() - trying to do this.");
       try {
         joinSession();
       } catch (Exception e) {
@@ -386,6 +391,26 @@ public class SimpleClient implements IClient {
    */
   public void importDocument(File location) {
     // TODO LATER: implement SimpleClient.importDocument()
-    log.error("importDocument is not implemented for a SimpleClient Session.");
+    log.error("importDocument is not yet implemented for a SimpleClient Session.");
+  }
+
+  public IObjectUpdate getUpdateHandler(Class rootObject) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  public IObjectUpdate[] getUpdateHandlers() {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  public void removeUpdateHandler(Class rootObject) {
+    // TODO Auto-generated method stub
+    
+  }
+
+  public void setUpdateHandler(IObjectUpdate handler) {
+    // TODO Auto-generated method stub
+    
   }
 }