ERXTemporaryGlobalID Class Reference

Inherits com::webobjects::eocontrol::EOGlobalID.

Collaboration diagram for ERXTemporaryGlobalID:

Collaboration graph
[legend]

List of all members.

Public Member Functions

NSDictionary dictionary (String key)
boolean equals (Object obj)
 ERXTemporaryGlobalID ()
int hashCode ()
boolean isTemporary ()
String toString ()
long value ()

Static Public Member Functions

static void setIdentifier (int value)

Private Member Functions

long identifier ()

Static Private Member Functions

static long appIdentifier ()
static long hostIdentifier ()
static void setDefaultAppIdentifier ()

Private Attributes

long _value

Static Private Attributes

static long _cnt
static long _identifier
static long _lastTime
static String hex = "0123456789abcdef"


Detailed Description

Experimental class to have quasi-GUIDs that fit into a long. Used as an alternative to the ERXLongPrimaryKeyFactory or the 24 byte built-in keys. To have it installed, set your pk prototype to "longId".
Note: by default, the key is partitioned by the lower 2 bytes host address, the lower byte of the port number and the current time in seconds. Then you have a byte left for inserts in one second.
This means, if you you are inserting - say - one thousand objects and your app crashes and restarts in 4 seconds and directly inserts new objects, then you might end up with duplicate keys. So this might only be for apps that stay at a low volume.
Also you need to be sure that your app is in one class B subnet and your instances port numbers are partitionable over the lower byte - which means less than 256 instances on one host.
Given these restrictions, you might want to stay with sequences...

Author:
ak

Constructor & Destructor Documentation


Member Function Documentation

static long appIdentifier (  )  [static, private]

NSDictionary dictionary ( String  key  ) 

Returns a pk-ready dictionary with the supplied key.

Parameters:
key 

boolean equals ( Object  obj  ) 

int hashCode (  ) 

static long hostIdentifier (  )  [static, private]

long identifier (  )  [private]

boolean isTemporary (  ) 

static void setDefaultAppIdentifier (  )  [static, private]

static void setIdentifier ( int  value  )  [static]

String toString (  ) 

long value (  ) 


Member Data Documentation

long _cnt [static, private]

long _identifier [static, private]

long _lastTime [static, private]

long _value [private]

String hex = "0123456789abcdef" [static, private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:11 2012 for Project Wonder by  doxygen 1.5.8