Picking code updated with full basic implementation of message sending and server...
[vamsas.git] / src / org / vamsas / client / VorbaIdFactory.java
index ece1357..d7f3867 100644 (file)
@@ -6,6 +6,8 @@
  */
 package org.vamsas.client;
 
+import java.util.Hashtable;
+
 /**
  * A VorbaIdFactory is constructed by an IClient instance.
  * It guarantees that any new VorbaId objects are unique 
@@ -14,13 +16,33 @@ package org.vamsas.client;
  * @author jimp
  */
 public abstract class VorbaIdFactory implements IVorbaIdFactory {
+  protected Hashtable extantids=null;
   /**
    * construct a new id appropriate for this client in the vamsas session.
    * 
    * @return valid VorbaId for session, or null if VorbaIdFactory not configured
    *         correctly.
    */
-  public abstract VorbaId makeVorbaId();
+  public abstract VorbaId makeVorbaId(Vobject vobject);
+  
+  /**
+   * internal method to access the protected VorbaId object constructor
+   * This shennanigan is to prevent casual generation of VorbaIds 
+   * (which may destroy the integrity of a Vamsas Document!)
+   * @param id
+   * @return new VorbaId object
+   */
+  protected VorbaId newId(String id) {
+    return VorbaId.newId(id);
+  }
+  /**
+   * Called by VorbaXmlBinder so the record of newly unmarshalled Vobject Ids
+   * is accessible to the Document's VorbaIdFactory instance. 
+   * @param idtable
+   */
+  protected void setNewIdHash(Hashtable idtable) {
+    extantids = idtable;
+  }
   /**
    * TODO: decide if these are needed.
    *