Example usage for java.util UUID randomUUID

List of usage examples for java.util UUID randomUUID

Introduction

In this page you can find the example usage for java.util UUID randomUUID.

Prototype

public static UUID randomUUID() 

Source Link

Document

Static factory to retrieve a type 4 (pseudo randomly generated) UUID.

Usage

From source file:com.decypher.threadsclient.JPanelChart.java

public void saveAsImage() {

    String folder = getFolder();//from   ww w. ja v  a2  s .  c o m
    if (!folder.isEmpty()) {
        String location = folder + "/" + UUID.randomUUID().toString() + ".jpeg";
        int width = 1280;
        int height = 960;
        try {
            File imgChart = new File(location);
            ChartUtilities.saveChartAsJPEG(imgChart, chart, width, height);
            Desktop.getDesktop().open(new File(folder));
        } catch (IOException ex) {
            Extra.MessageBox.Show(ex.getMessage(), Extra.Title.Error);
        }
    }
}

From source file:org.elasticsoftware.elasticactors.geoevents.messages.ScanRequest.java

public ScanRequest(Coordinate location, int radiusInMetres) {
    this(UUID.randomUUID(), location, radiusInMetres);
}

From source file:guru.bubl.module.model.User.java

public User password(String password) {
    if (password != null) {
        salt = UUID.randomUUID().toString();
        passwordHash = encode(password);
    }/*  w  ww  .j av  a2  s . c o m*/
    return this;
}

From source file:com.microsoft.azure.servicebus.samples.managingentity.ManagingEntity.java

public void run(String connectionString) throws Exception {

    this.managementClient = new ManagementClientAsync(new ConnectionStringBuilder(connectionString));
    String queueName = UUID.randomUUID().toString();

    System.out.println("Creating a new Queue with name - " + queueName);
    this.createQueue(queueName);

    System.out.println("Retrieving the created queue");
    QueueDescription getQueue = this.getQueue(queueName);

    System.out.println("Updating few properties of the queue");
    this.updateQueue(getQueue);

    System.out.println("Retrieving runtime information of the queue");
    this.getQueueRuntimeInfo(queueName);

    System.out.println("Deleting the queue");
    this.deleteQueue(queueName);

    this.managementClient.close();
}

From source file:h2backup.H2BackupTestBase.java

@Before
public void baseSetUp() throws IOException, SQLException {
    workDirectory = Paths.get(BUILD_DIRECTORY, "h2-backup", UUID.randomUUID().toString());

    if (!Files.exists(workDirectory)) {
        Files.createDirectories(workDirectory);
    }/*from   w  w w.  jav  a 2  s .co  m*/

    dataSource = new JdbcDataSource();
    dataSource.setURL("jdbc:h2:" + workDirectory + "/testdb");
    dataSource.setUser("sa");
    dataSource.setPassword("sa");

    createTestTable();
}

From source file:io.sidecar.event.EventTest.java

private Event.Builder createBuilderWithExpectedValues() {
    return new Event.Builder().id(randomUUID()).timestamp(DateTime.now(DateTimeZone.UTC))
            .deviceId(UUID.randomUUID().toString()).stream("streamname").tags(Sets.newHashSet("foo", "bar"))
            .location(new Location(0.0, 0.0))
            .readings(singletonList(new Reading("key", DateTime.now(DateTimeZone.UTC), 1L)))
            .keytags(new ImmutableList.Builder<KeyTag>().add(new KeyTag("key", Sets.newHashSet("keytag")))
                    .build());//from w  w  w  .  j  ava 2  s  . com
}

From source file:cloud.simple.StreamProductApplication.java

@RequestMapping("/send")
public String send() {
    String info = "hi,i'am product , msgid:" + UUID.randomUUID().toString();
    Message<String> msg = MessageBuilder.withPayload(info).build();
    sender.output().send(msg);/*from ww w.  j av  a2  s  .c o  m*/
    return info;
}

From source file:com.clican.pluto.dataprocess.dpl.parser.object.SubDpl.java

/**
 * ?????/* ww w .  java 2 s  .  c  om*/
 * 
 * @param subDplStr
 *            ?dpl
 * @param alias
 *            ??
 * @param result
 *            ?
 */
public void addSubDpl(String subDplStr, String alias, Object result) {
    if (StringUtils.isEmpty(alias)) {
        alias = "dual." + "s" + UUID.randomUUID().toString().replaceAll("\\-", "");
    }
    aliasResultMap.put(alias, result);
    subDplStrAliasMap.put(subDplStr, alias);
}

From source file:com.auditbucket.registration.service.KeyGenService.java

String getUniqueKey(METHOD method) {
    // Snowflake?
    if (method.equals(METHOD.SNOWFLAKE))
        return getSnowFlake();
    else if (method.equals(METHOD.BASE64))
        return Base64.format(UUID.randomUUID());
    else//from   www .  jav  a2  s . c om

        return getUUID();
}

From source file:com.epam.ta.reportportal.ws.converter.builders.RestorePasswordBidBuilder.java

public RestorePasswordBidBuilder addRestorePasswordBid(RestorePasswordRQ rq) {
    getObject().setEmail(rq.getEmail());
    getObject().setId(UUID.randomUUID().toString());
    return this;
}