|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ispheres.server.core.ISphereId
public final class ISphereId
Methods for generating and checking iSphere unique identifiers (ids). An id is made up of two parts: - The first 7 characters is the time the iSphere was first started in seconds, displayed in base 36. - The final 7 characters is a CRC32 hash of the hostname the iSphere is on in base 36. This makes a unique id of 14 characters length. This was originally a longer id - however Ian Johnson requested a much smaller string.
| Method Summary | |
|---|---|
static java.lang.String |
generateUniqueId(long startupTime,
java.lang.String hostname)
Generate a unique identifier, this is generated from a concatination of the time in milliseconds (POSIX time) and a hash of the local ip address. |
static boolean |
isValidUniqueId(java.lang.String id)
Return true if the unique id is valid. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static java.lang.String generateUniqueId(long startupTime,
java.lang.String hostname)
startupTime - The time the iSphere was first started as a long.hostname - The name of the host.
public static boolean isValidUniqueId(java.lang.String id)
id - The unique id to check.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||