a12010f278f2162a52485d87cc9eb9e19a98237f
[vamsas.git] / src / org / vamsas / client / VorbaId.java
1 /*
2  * Created on 12-Sep-2005
3  *
4  * TODO To change the template for this generated file go to
5  * Window - Preferences - Java - Code Style - Code Templates
6  */
7 package org.vamsas.client;
8
9 /**
10  * The unique reference id for a Vamsas document object,
11  * used by applications to refer to the vamsas object
12  * within their own data space in the vamsas document.
13  * TODO: decide if VorbaId should contain a reference 
14  * to either the IVorbaIdFactory that made it or the 
15  * IClient that defines the session (it might be 
16  * convenient).
17  * @author jimp
18  */
19 public class VorbaId {
20   protected String id;
21   protected VorbaId() {
22     super();
23   }
24   private VorbaId(String Id) {
25     super();
26     id = Id;
27   }
28   /**
29    * 
30    * @param vorbaObject the source of vorba Ids
31    * @param vobject the object to be registered with a new vorba id
32    * @return
33    */
34   protected static VorbaId newId(IVorbaIdFactory vorbaObject, object vobject) {
35     // Make unique id from appSpace info in vorbaObject
36     synchronized (vorbaObject) {
37       return vorbaObject.makeVorbaId(vobject);
38     }
39   }
40   protected static VorbaId newId(String id) {
41     return new VorbaId(id);
42   }
43   /**
44    * @return Returns the id.
45    */
46   public String getId() {
47     return id;
48   }
49 }