private UserHandle user;
private CRC32 unique=new CRC32(); // used to attempt a unique but predictable stream for IDs
private String idstring;
- int sequence=0; // incrementing value for next new ID
+ int sequence=1; // incrementing value for next new ID
/**
*
*/
this.user = user;
unique.reset();
unique.update(new Object[] { session, client, user}.toString().getBytes());
- idstring = "vamsas:"+session.getSessionUrn()+":"+unique.getValue()+":"+client.getClientUrn()+"/";
- sequence=0;
+ // TODO: Ensure format of URNs and use standard composition methods.
+ idstring = client.getClientUrn()+":"+unique.getValue()+"/";
extantids=new Hashtable();
}
throw new Error("makeVorbaId called on improperly initialised IdFactory object!");
String newidstring;
do {
- if (sequence!=0) {
+ if (sequence>0) {
sequence++;
} else {
idstring+="1/";
+ sequence=1;
}
newidstring=idstring+Integer.toString(sequence);
} while (extantids.containsKey(newidstring));