JXTA

net.jxta.impl.id.UUID
Class IDFormat

java.lang.Object
  extended by net.jxta.impl.id.UUID.IDFormat
Direct Known Subclasses:
IDFormat

public class IDFormat
extends Object

A general purpose JXTA ID Format implementing all of the six standard ID Types. It was originally created for the Java 2 SE reference implementation. The 'uuid' format uses (IETF version 4) randomly generated UUIDs as the mechanism for generating canonical values for the ids it provides.

For IDs constructed using "seed" variant constructors, the first 16 bytes of the seed are used literally as the UUID value. The value is masked to make it a valid version 4 IETF variant UUID.

See Also:
ID, JXTA Protocols Specification : IDs, JXTA Protocols Specification : UUID ID Format

Field Summary
static PeerGroupID defaultNetPeerGroupID
          Our local version of the net Peer Group ID.
static byte flagCodatID
          Type value for Codat
static byte flagCodatID7
          Type value for CodatID
static byte flagModuleClassID
          Type value for ModuleClass
static byte flagModuleSpecID
          Type value for ModuleSpec
static byte flagPeerGroupID
          Type value for PeerGroup
static byte flagPeerID
          Type value for Peer
static byte flagPipeID
          Type value for Pipe
static int flagsIdTypeOffset
          Location of the type field within the flags field
static int flagsOffset
          Location of ID flags within byte array.
static int flagsSize
          The size of the flags field
static int IdByteArraySize
          number of bytes in the byte array
static IDFactory.Instantiator INSTANTIATOR
          The instantiator for this ID Format which is used by the IDFactory.
static int uuidSize
          The size of a UUID in bytes
static PeerGroupID worldPeerGroupID
          Our local version of the world Peer Group ID.
 
Constructor Summary
protected IDFormat()
          This class cannot be instantiated.
 
Method Summary
(package private) static ID translateFromWellKnown(ID input)
          Translate from well known ID to our locally encoded versions.
(package private) static ID translateToWellKnown(ID input)
          Translate from locally encoded versions to the well known versions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IdByteArraySize

public static final int IdByteArraySize
number of bytes in the byte array

See Also:
Constant Field Values

uuidSize

public static final int uuidSize
The size of a UUID in bytes

See Also:
Constant Field Values

flagsSize

public static final int flagsSize
The size of the flags field

See Also:
Constant Field Values

flagsIdTypeOffset

public static final int flagsIdTypeOffset
Location of the type field within the flags field

See Also:
Constant Field Values

flagCodatID

public static final byte flagCodatID
Type value for Codat

See Also:
Constant Field Values

flagPeerGroupID

public static final byte flagPeerGroupID
Type value for PeerGroup

See Also:
Constant Field Values

flagPeerID

public static final byte flagPeerID
Type value for Peer

See Also:
Constant Field Values

flagPipeID

public static final byte flagPipeID
Type value for Pipe

See Also:
Constant Field Values

flagModuleClassID

public static final byte flagModuleClassID
Type value for ModuleClass

See Also:
Constant Field Values

flagModuleSpecID

public static final byte flagModuleSpecID
Type value for ModuleSpec

See Also:
Constant Field Values

flagCodatID7

public static final byte flagCodatID7
Type value for CodatID

See Also:
Constant Field Values

flagsOffset

public static final int flagsOffset
Location of ID flags within byte array.

See Also:
Constant Field Values

worldPeerGroupID

public static final PeerGroupID worldPeerGroupID
Our local version of the world Peer Group ID. We need this for cases where we have to make ids which are in the world peer group. We only use this ID for those cases and never return this ID.


defaultNetPeerGroupID

public static final PeerGroupID defaultNetPeerGroupID
Our local version of the net Peer Group ID. We need this for cases where we have to make ids which are in the net peer group. We only use this ID for those cases and never return this ID.


INSTANTIATOR

public static final IDFactory.Instantiator INSTANTIATOR
The instantiator for this ID Format which is used by the IDFactory.

Constructor Detail

IDFormat

protected IDFormat()
This class cannot be instantiated.

Method Detail

translateFromWellKnown

static ID translateFromWellKnown(ID input)
Translate from well known ID to our locally encoded versions.

Parameters:
input - the id to be translated.
Returns:
the translated ID or the input ID if no translation was needed.

translateToWellKnown

static ID translateToWellKnown(ID input)
Translate from locally encoded versions to the well known versions.

Parameters:
input - the id to be translated.
Returns:
the translated ID or the input ID if no translation was needed.

JXSE