|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.util.CodeHelper
public class CodeHelper
enclosing_type Description:
| Constructor Summary | |
|---|---|
CodeHelper()
|
|
| Method Summary | |
|---|---|
static long |
getForeverUniqueID()
PLEASE use only if REALLY needed. Best effort is taken to make it "globally unique" without any persisting media by instantiating it by System.currentTimeMilis * 64, so that after a restart of the vm, the counter advances 64000 units per second which should be enough that that value is never exceeded by the usage of that ID (100 concurrent users which can consume 640 unique id per each second, and: even if exceeded, after a restart of a vm (assumed time at least 10secs), a loss of 10*64000 = 640000 can be caught up if you just need a counter which is unique within the virtual machine, but does not need to be unique if the sessions are persisted and the vm is restarted, then use @see getRAMUniqueID() returns a unique id; even if the system is restarted. |
static java.lang.String |
getGlobalForeverUniqueID()
Generates a virtually global unique ID based on the forever unique ID (see getForeverUniqueID()) and a user defined namespace (see OLATContext.instanceId). |
static long |
getRAMUniqueID()
a simple counter which is garanteed to be unique ONLY within one instance of a virtual machine. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CodeHelper()
| Method Detail |
|---|
public static java.lang.String getGlobalForeverUniqueID()
public static long getForeverUniqueID()
public static long getRAMUniqueID()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||