import org.vamsas.client.UserHandle;
import org.vamsas.client.VorbaId;
import org.vamsas.client.VorbaIdFactory;
+import org.vamsas.client.Vobject;
import org.vamsas.objects.utils.document.VersionEntries;
import java.util.Hashtable;
idstring = client.getClientUrn()+":"+unique.getValue()+"/";
extantids=new Hashtable();
}
-
+ /**
+ * values for keys in this hash can be used to reference the org.vamsas.client.Vobject instance for the VorbaId string.
+ * @return the hash of all VorbaIds
+ */
+ protected Hashtable getVorbaIdHash() {
+ return extantids;
+ }
+
/* (non-Javadoc)
* @see org.vamsas.client.VorbaIdFactory#makeVorbaId()
*/
- public VorbaId makeVorbaId() {
+ public VorbaId makeVorbaId(Vobject vobject) {
if (session==null)
- throw new Error("makeVorbaId called on improperly initialised IdFactory object!");
+ throw new Error("makeVorbaId called on improperly initialised IdFactory Vobject!");
String newidstring;
do {
if (sequence>0) {
}
newidstring=idstring+Integer.toString(sequence);
} while (extantids.containsKey(newidstring));
+ extantids.put(newidstring, vobject); // hash the Vobject by its new Id
VorbaId id = newId(newidstring);
return id;
}
clientname="org.vamsas.client.simpleclient.IdFactory";
return new IdFactory(new SessionHandle("dummy.session"),
new ClientHandle(clientname,VersionEntries.latestVersion()),
- new UserHandle("arnoldUser", "none"));
+ new UserHandle(clientname, "Arnold User's Inc."));
}
}