Class CodatID
package: src.net.jxta.impl.id.UUID
net.jxta.impl.id.UUID.CodatID
public class CodatID
Extends:
net.jxta.codat.CodatID
An implementation of the net.jxta.codat.CodatID ID Type.
Field Summary
protected final static int
   Location of the hash value portion of the id within the byte array.
 
protected final static int
   Location of the group id in the byte array.
 
protected final static int
   size of a SHA1 hash.
 
protected IDBytes
   The id data
 
protected final static int
   Location of the randomly chosen portion of the id within the byte array.
 
private final static transient Logger
   Log4J categorgy
 
protected final static int
   Location of the begining of pad (unused space) within the byte array.
 
protected final static int
   Size of the pad.
 
Constructor Summary
protected
   Internal constructor
 
protected
   Intializes contents from provided bytes.
 
public
   See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID).
 
public
CodatID(PeerGroupID groupID, byte [] seed)
   See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID,byte[]).
 
public
CodatID(PeerGroupID groupID, byte [] seed, InputStream in)
   See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID,InputStream).
 
public
CodatID(PeerGroupID groupID, InputStream in)
   See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID,InputStream).
 
protected
CodatID(UUID groupUUID, UUID idUUID)
Method Summary
public boolean
equals(Object target)
   {@inheritDoc}
 
public String
   {@inheritDoc}
 
public net.jxta.id.ID
   {@inheritDoc}
 
public Object
   {@inheritDoc}
 
public int
   {@inheritDoc}
 
public boolean
   {@inheritDoc}
 
protected void
setHash(InputStream in)
   Calculates the SHA-1 hash of a stream.
 
Field Detail
codatHashOffset
protected final static int codatHashOffset = CodatID.idOffset + IDFormat.uuidSize
Location of the hash value portion of the id within the byte array.

groupIdOffset
protected final static int groupIdOffset = 0
Location of the group id in the byte array.

hashSize
protected final static int hashSize = 20
size of a SHA1 hash. I would use MessageDigest.getDigestLength, but possible exceptions make it difficult to do.

id
protected IDBytes id
The id data

idOffset
protected final static int idOffset = CodatID.groupIdOffset + IDFormat.uuidSize
Location of the randomly chosen portion of the id within the byte array.

LOG
private final static transient Logger LOG = Logger.getLogger( CodatID.class.getName())
Log4J categorgy
transient

padOffset
protected final static int padOffset = CodatID.codatHashOffset + CodatID.hashSize
Location of the begining of pad (unused space) within the byte array.

padSize
protected final static int padSize = IDFormat.flagsOffset - CodatID.padOffset
Size of the pad.
Constructor Detail
CodatID
protected CodatID()
Internal constructor

CodatID
protected CodatID(IDBytes id)
Intializes contents from provided bytes.
Parameters:
id the ID data

CodatID
public CodatID(PeerGroupID groupID)
See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID).

CodatID
public CodatID(PeerGroupID groupID, byte [] seed)
See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID,byte[]).

CodatID
public CodatID(PeerGroupID groupID, byte [] seed, InputStream in)
See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID,InputStream).
Throws:
IOException

CodatID
public CodatID(PeerGroupID groupID, InputStream in)
See net.jxta.id.IDFactory.Instantiator#newCodatID(net.jxta.peergroup.PeerGroupID,InputStream).
Throws:
IOException

CodatID
protected CodatID(UUID groupUUID, UUID idUUID)
Method Detail
equals
public boolean equals(Object target)
{@inheritDoc}

getIDFormat
public String getIDFormat()
{@inheritDoc}

getPeerGroupID
public net.jxta.id.ID getPeerGroupID()
{@inheritDoc}

getUniqueValue
public Object getUniqueValue()
{@inheritDoc}

hashCode
public int hashCode()
{@inheritDoc}

isStatic
public boolean isStatic()
{@inheritDoc}

setHash
protected void setHash(InputStream in)
Calculates the SHA-1 hash of a stream.
Throws:
IOException
Parameters:
in The InputStream.