List of usage examples for java.util UUID randomUUID
public static UUID randomUUID()
From source file:com.folion.api.rest.controller.HomePageRestController.java
@RequestMapping(value = "/test/test", method = RequestMethod.GET) public ResponseEntity<Feature> getFeature() { Feature feature = new Feature(); feature.setId(UUID.randomUUID().toString()); return new ResponseEntity<>(feature, HttpStatus.OK); }
From source file:at.ac.tuwien.dsg.cloud.utilities.messaging.lightweight.rabbitMq.RabbitMqMessage.java
public RabbitMqMessage() { this.key = UUID.randomUUID().toString(); }
From source file:org.trustedanalytics.utils.hdfs.LocalConfigTests.java
private static String randomString() { return UUID.randomUUID().toString(); }
From source file:gov.va.vinci.leo.tools.LeoUtils.java
/** * Generate a random UUID string.//from ww w. j a va 2s .c om * * @return String representation of a UUID */ public static String getUUID() { UUID id = UUID.randomUUID(); return id.toString(); }
From source file:com.twosigma.cook.jobclient.InstanceTest.java
@Before public void setup() { final Instance.Builder instanceBuilder = new Instance.Builder(); instanceBuilder.setTaskID(UUID.randomUUID()); instanceBuilder.setSlaveID("20150311-033720-1963923116-5050-4084-32"); instanceBuilder.setStartTime(1426632249597L); instanceBuilder.setEndTime(1426632251828L); instanceBuilder.setHostName("server1.example.com"); instanceBuilder.setExecutorID("f52fbacf-52a1-44a2-bda1-cbfa477cc163"); instanceBuilder.setStatus(Instance.Status.SUCCESS); instanceBuilder.setPreempted(false); _successfulInstance = instanceBuilder.build(); }
From source file:com.ebay.myriad.state.NodeTask.java
public NodeTask(String clusterId, NMProfile profile) { super();//from w ww . j av a 2s . c om this.taskId = UUID.randomUUID().toString(); this.clusterId = clusterId; this.profile = profile; this.hostname = ""; }
From source file:de.zib.gndms.gndmc.utils.DownloadResponseExtractor.java
public DownloadResponseExtractor() { outputFile = "/tmp/GNDMS.t" + Thread.currentThread().getId() + "." + UUID.randomUUID().toString(); }
From source file:com.hp.autonomy.hod.client.api.resource.ResourceTest.java
@Test public void buildsResourceUuid() { final UUID uuid = UUID.randomUUID(); final Resource resource = new Resource(uuid, "resource_name", "domain_name"); final ResourceUuid resourceUuid = resource.getResourceUuid(); assertThat(resourceUuid.getUuid(), is(uuid)); }
From source file:com.delphix.session.service.ServiceUUID.java
public ServiceUUID(String alias) { this(UUID.randomUUID(), true, alias); }
From source file:fr.cnrs.sharp.reasoning.Interlinking.java
/** * Generates a Jena Model with an SHA-512 fingerprint of a file content. * @param inputRawFile the file to be fingerprinted * @return a Jena Model with an SHA-512, based on PROV and tavernaprov vocabularies. * @throws IOException/*from w w w . ja v a 2s .c o m*/ */ public static Model fingerprint(Path inputRawFile) throws IOException { StopWatch sw = new StopWatch(); sw.start(); Model data = ModelFactory.createDefaultModel(); Path p = inputRawFile; String label = p.getFileName().toString(); System.out.println(); FileInputStream fis = new FileInputStream(p.toFile()); String sha512 = DigestUtils.sha512Hex(fis); StringBuffer sb = new StringBuffer(); sb.append("@base <http://fr.symetric> .\n" + "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n" + "@prefix prov: <http://www.w3.org/ns/prov#> .\n" + "@prefix tavernaprov: <http://ns.taverna.org.uk/2012/tavernaprov/> .\n" + "@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .\n"); sb.append("<#" + UUID.randomUUID().toString() + ">\n" + "\t a prov:Entity ;\n"); sb.append("\t rdfs:label \"" + label + "\"^^xsd:String ;\n"); sb.append("\t tavernaprov:sha512 \"" + sha512 + "\"^^xsd:String ."); RDFDataMgr.read(data, new StringReader(sb.toString()), null, Lang.TTL); fis.close(); return data; }