String newId() { return new UID().toString(); }
protected void setId(Object o) { if (OwsUtils.get(o, "id") == null) { String uid = new UID().toString(); OwsUtils.set(o, "id", o.getClass().getSimpleName() + "-" + uid); } } }
protected void setId(Object o) { if (OwsUtils.get(o, "id") == null) { String uid = new UID().toString(); OwsUtils.set(o, "id", o.getClass().getSimpleName() + "-" + uid); } } }
/** Internal method for creating feature id's when none is specified. */ public static String createDefaultFeatureId() { // According to GML and XML schema standards, FID is a XML ID // (http://www.w3.org/TR/xmlschema-2/#ID), whose acceptable values are those that match an // NCNAME production (http://www.w3.org/TR/1999/REC-xml-names-19990114/#NT-NCName): // NCName ::= (Letter | '_') (NCNameChar)* /* An XML Name, minus the ":" */ // NCNameChar ::= Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender // We have to fix the generated UID replacing all non word chars with an _ (it seems // they area all ":") // return "fid-" + NON_WORD_PATTERN.matcher(new UID().toString()).replaceAll("_"); // optimization, since the UID toString uses only ":" and converts long and integers // to strings for the rest, so the only non word character is really ":" return "fid-" + new UID().toString().replace(':', '_'); } /**
/** * Returns the string representation of this GUID. * * @return the string representation of this GUID. */ @Override public String toString() { return host + ":" + uid.toString(); } }
public static String getGUID() { String localhost = "unknown_local_host"; try { localhost = InetAddress.getLocalHost().getHostAddress(); } catch (UnknownHostException e) { } return localhost + new UID().toString(); }
/** * @see org.geotools.data.jdbc.fidmapper.FIDMapper#getID(java.lang.Object[]) */ public String getID(Object[] attributes) { // optimization, since the UID toString uses only ":" and converts long and integers // to strings for the rest, so the only non word character is really ":" return "nfm-" + new UID().toString().replace(':', '_'); }
/** Create a unique id for the download session. */ private String createUID() { String uid; uid = new UID().toString(); if (uid.startsWith("-")) { uid = uid.substring(1); } return uid; } }
protected String generateTokenValue() { StringBuilder sb = new StringBuilder(); sb.append(new UID().toString()); sb.append(":"); sb.append(random.nextLong()); return sb.toString(); }
/** * Randomly generates a unique identifier * * @return the unique identifier */ public static String generateUID() { String uid = null; UID cour = new UID(); uid = String.valueOf(cour.toString()); return uid; }
public RequestEventImpl(TFTPPacket req, TFTPTransfer source) { super(source); this.req = req; this.tt = source; this.id = new UID().toString(); }
public RequestEventImpl(TFTPPacket req, TFTPTransfer source) { super(source); this.req = req; this.tt = source; this.id = new UID().toString(); }
protected String generateTokenValue() { StringBuilder sb = new StringBuilder(); sb.append(new UID().toString()); sb.append(":"); sb.append(random.nextLong()); return sb.toString(); }
public static String getGUID() { String localhost = "unknown_local_host"; try { localhost = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { } return localhost +"-" +new UID().toString(); } public static void main(String[] args) {
/** * Creates a reasonably unique identifier only consisting of hexadecimal characters and underscores. * It looks like <code>d578271282b42fce__2955b56e_107df3fbc96__8000</code> and is 48 characters long. * * @return The identifier */ protected String createUniqueIdentifier() { return new UID().toString().replace(':', '_').replace('-', '_'); } // GemStone changes BEGIN
public void createTempFile() { try { tempFile = File.createTempFile(new UID().toString().replace(":", "-"), ".upload"); tempFile.deleteOnExit(); fOut = new FileOutputStream(tempFile); } catch (IOException ex) { throw new FileUploadException("Could not create temporary file"); } }
public void init(String endpointId){ this.endpointId = endpointId; this.fakeId = new UID().toString(); this.executor = this.stack.getNextExecutor(); }
/** * @param uriPrefix - must include schema information * @return a new, random unique URI starting with uriPrefix */ public static URI createNewRandomUniqueURI(String uriPrefix) { return new URIImpl(uriPrefix + new UID().toString()); } }
protected String autoGenerateID(PortletDefinition pd) { String appName = pd.getApplication().getName(); String portletName = pd.getPortletName(); return appName+"::"+portletName+"::"+new UID().toString(); }
private String createBridgeRequestScope(PortletRequest request) { // Generate an RMI UID, which is a unique identifier WITHIN the local // host. This will be used as the new lifecyleID UID uid = new UID(); return qualifyScopeId(mPortletConfig.getPortletName(), request.getPortletSession(true).getId(), request.getPortletMode().toString(), uid.toString()); }