Java UUID Create generateClientId()

Here you can find the source of generateClientId()

Description

Generates a random UUID suitable for use as MQTT client ID.

License

Amazon Software License

Return

36 character UUID string.

Declaration

static String generateClientId() 

Method Source Code

//package com.java2s;
//License from project: Amazon Software License 

import java.util.UUID;

public class Main {
    /**/* w  w w  .ja  v a2 s  .  c  om*/
     * Generates a random UUID suitable for use as MQTT client ID. MQTT clients
     * in the same AWS account require a unique client ID for each
     * simulataneously connected client. This routine generates UUIDs which can
     * be considered "practically unique". See:
     * https://en.wikipedia.org/wiki/Universally_unique_identifier Each call to
     * this routine will return a different UUID.
     *
     * @return 36 character UUID string.
     */
    static String generateClientId() {
        return UUID.randomUUID().toString();
    }
}

Related

  1. generate()
  2. generateApiAccesskeyId()
  3. generateAppIds(int noOfAppIdsToGenerate)
  4. generateAttributeId()
  5. generateBoundary(final String value)
  6. generateConnectionId()
  7. generateConsumerName(String serverInstanceId)
  8. generateContentID()
  9. generateCurrentTimestampUUID()