vorbaId generator constructs valid ID strings (NCNames)
authorjprocter <jprocter@compbio.dundee.ac.uk>
Sun, 15 Jul 2007 13:35:42 +0000 (13:35 +0000)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Sun, 15 Jul 2007 13:35:42 +0000 (13:35 +0000)
git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@425 be28352e-c001-0410-b1a7-c7978e42abec

src/uk/ac/vamsas/client/ClientHandle.java
src/uk/ac/vamsas/client/simpleclient/IdFactory.java

index a168c4d..b566c8d 100644 (file)
@@ -112,4 +112,11 @@ public class ClientHandle implements Serializable {
         && (this.version == null || this.version.equals(that.version)) 
         && (this.clientUrn == null || this.clientUrn.equals(that.clientUrn)));
   }
+
+  public String getClientNCname() {
+    
+    String ncname = clientName.replace(':', '_');
+    ncname = ncname.replace('@', '.');
+    return ncname;
+  }
 }
index b81b2fe..09a28e4 100644 (file)
@@ -50,7 +50,7 @@ public class IdFactory extends VorbaIdFactory {
     unique.reset();
     unique.update(new Object[] { session, client, user}.toString().getBytes());
     // TODO: Ensure format of URNs and use standard composition methods.
-    idstring = client.getClientName()+":"+unique.getValue()+".";
+    idstring = client.getClientNCname()+"_"+unique.getValue()+".";
     extantids=new Hashtable();
     this.extanthashv=new Hashtable();
   }