Project JXTA

net.jxta.impl.id.CBID
Class IDFormat

java.lang.Object
  extended bynet.jxta.impl.id.UUID.IDFormat
      extended bynet.jxta.impl.id.CBID.IDFormat

public class IDFormat
extends IDFormat

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 'cbid' format uses values generated from secure hash functions as the mechanism for generating canonical values for the ids it provides.

See Also:
ID, JXTA Protocols Specification : IDs

Field Summary
static PeerGroupID defaultNetPeerGroupID
          Our local version of the net Peer Group ID.
static IDFactory.URIInstantiator INSTANTIATOR
          The instantiator for this ID Format which is used by the IDFactory.
(package private) static Object[][] wellKnownIDs
          This table maps our local private versions of the well known ids to the globally known version.
static PeerGroupID worldPeerGroupID
          Our local version of the world Peer Group ID.
 
Fields inherited from class net.jxta.impl.id.UUID.IDFormat
flagCodatID, flagModuleClassID, flagModuleSpecID, flagPeerGroupID, flagPeerID, flagPipeID, flagsIdTypeOffset, flagsOffset, flagsSize, IdByteArraySize, uuidSize
 
Constructor Summary
protected IDFormat()
          This class cannot be instantiated.
 
Method Summary
protected static URL getURL(String uniqueValue)
          Public member which returns a URI (URL in Java nomenclature) of the ID.
protected static URI toURI(String uniqueValue)
          Public member which returns a URI (URL in Java nomenclature) of the ID.
(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

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.


wellKnownIDs

static final Object[][] wellKnownIDs
This table maps our local private versions of the well known ids to the globally known version.


INSTANTIATOR

public static final IDFactory.URIInstantiator 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.

getURL

protected static URL getURL(String uniqueValue)
Public member which returns a URI (URL in Java nomenclature) of the ID.

Parameters:
uniqueValue - the unique portion of the ID
Returns:
URL Object containing the URI

toURI

protected static URI toURI(String uniqueValue)
Public member which returns a URI (URL in Java nomenclature) of the ID.

Parameters:
uniqueValue - the unique portion of the ID
Returns:
URL Object containing the URI

JXTA J2SE