updated example application to handle IClient.getDocument() exceptions and ensured...
[vamsas.git] / src / org / vamsas / client / VorbaId.java
index f1ada9b..a12010f 100644 (file)
@@ -10,16 +10,36 @@ package org.vamsas.client;
  * The unique reference id for a Vamsas document object,
  * used by applications to refer to the vamsas object
  * within their own data space in the vamsas document.
+ * TODO: decide if VorbaId should contain a reference 
+ * to either the IVorbaIdFactory that made it or the 
+ * IClient that defines the session (it might be 
+ * convenient).
  * @author jimp
  */
 public class VorbaId {
   protected String id;
-  public static VorbaId newId(VorbaIdFactory vorbaObject) {
+  protected VorbaId() {
+    super();
+  }
+  private VorbaId(String Id) {
+    super();
+    id = Id;
+  }
+  /**
+   * 
+   * @param vorbaObject the source of vorba Ids
+   * @param vobject the object to be registered with a new vorba id
+   * @return
+   */
+  protected static VorbaId newId(IVorbaIdFactory vorbaObject, object vobject) {
     // Make unique id from appSpace info in vorbaObject
     synchronized (vorbaObject) {
-      return vorbaObject.makeVorbaId();
+      return vorbaObject.makeVorbaId(vobject);
     }
   }
+  protected static VorbaId newId(String id) {
+    return new VorbaId(id);
+  }
   /**
    * @return Returns the id.
    */