From: jprocter Date: Sun, 15 Jul 2007 13:35:42 +0000 (+0000) Subject: vorbaId generator constructs valid ID strings (NCNames) X-Git-Tag: Release_0.2~95 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dbcb3f27a4b84228f8d86f27d6a9f9b84de39e92;p=vamsas.git vorbaId generator constructs valid ID strings (NCNames) git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@425 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/client/ClientHandle.java b/src/uk/ac/vamsas/client/ClientHandle.java index a168c4d..b566c8d 100644 --- a/src/uk/ac/vamsas/client/ClientHandle.java +++ b/src/uk/ac/vamsas/client/ClientHandle.java @@ -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; + } } diff --git a/src/uk/ac/vamsas/client/simpleclient/IdFactory.java b/src/uk/ac/vamsas/client/simpleclient/IdFactory.java index b81b2fe..09a28e4 100644 --- a/src/uk/ac/vamsas/client/simpleclient/IdFactory.java +++ b/src/uk/ac/vamsas/client/simpleclient/IdFactory.java @@ -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(); }