Project JXTA

net.jxta.codat
Class Codat

java.lang.Object
  |
  +--net.jxta.codat.Codat
Direct Known Subclasses:
Metadata

public class Codat
extends java.lang.Object

This class represents a Codat. Codats are JXTA objects that can hold both data or code. The core platform API is making available the Codat APIs to JXTA services and applications as a placeholder for all contents they are manipulating. The Core is not making any references to this class. The core only manipulates StructuredDocuments and Advertisements that are subclasses of Documents. The Codat class is offered as a standard way for applications and services to exchange any kinds of contents via a common API and associate a unique JXTA id to these contents.

Codats are containers objects that are used to hold any kinds of objects or data. A codat can represent a file, a class file, the saved state of an application, a loadable C library. Codats are handled transparently by the JXTA platform, and are used as placeholders for any types of data. Codats hold Document that represent the data that they hold.

Codats are published in peer groups. A Codat can belong to only one peer group. Multiple copies of a codat can be made to be published in multiple peer groups.

Codats are uniquely identified via a unique CodatID. This Id is guaranteed to be unique within the JXTA world.

The core manipulates two main types of codats:

The JXTA platform defines Codat as the unit of information shared and exchanged within a JXTA group. All instances of Codats reside within a peer group. The PeerGroup content caching service provides storage and retrieval methods for codats using codatId as index.

Since:
JXTA 1.0
See Also:
CodatID, Document, StructuredDocument, StructuredTextDocument

Field Summary
protected  Document doc
          A Jxta Document which contains the data held by this Codat.
protected  CodatID id
          Codat Id of this Codat.
protected  CodatID metaId
          Codat Id of a Codat to which this Codat is related.
 
Constructor Summary
Codat(CodatID id, CodatID about, Document document)
          Makes a new Codat instance from an existing Codat, with a given CodatID and a document.
Codat(PeerGroupID groupID, CodatID about, Document document)
          Makes a new Codat with a new CodatId given a PeerGroupID and a document.
 
Method Summary
 CodatID getCodatID()
          Returns the CodatId associated with this Codat.
 Document getDocument()
          Returns the Document associated with this Codat.
 CodatID getMetaID()
          Returns Codat id of related codat associated with this metadata Codat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected CodatID id
Codat Id of this Codat. This is the "address" which may be used to refer to this Codat. @see net.jxta.codat.CodatId

metaId

protected CodatID metaId
Codat Id of a Codat to which this Codat is related. This may be the Codat Id of another codat in the same Peer Group or net.jxta.codat.CodatId.nullCodatId.

doc

protected Document doc
A Jxta Document which contains the data held by this Codat.
Constructor Detail

Codat

public Codat(PeerGroupID groupID,
             CodatID about,
             Document document)
      throws java.lang.OutOfMemoryError
Makes a new Codat with a new CodatId given a PeerGroupID and a document.
Parameters:
groupID - PeerGroupID the group to which this codat will belong.
about - CodatId for which this Codat is metadata
document - Document held by this codat.
Throws:
OutOfMemoryException - not enough memory to create the codat
Since:
JXTA 1.0

Codat

public Codat(CodatID id,
             CodatID about,
             Document document)
      throws java.lang.OutOfMemoryError
Makes a new Codat instance from an existing Codat, with a given CodatID and a document.
Parameters:
id - CodatId of the new codat
about - CodatID for which this Codat is metadata
document - Document hold by this codat
Throws:
OutOfMemoryException - not enough memory to create the codat
Since:
JXTA 1.0
Method Detail

getCodatID

public CodatID getCodatID()
Returns the CodatId associated with this Codat.
Returns:
CodateID associated with this codat
Since:
JXTA 1.0

getMetaID

public CodatID getMetaID()
Returns Codat id of related codat associated with this metadata Codat.
Returns:
CodateID associated with this codat
Since:
JXTA 1.0

getDocument

public Document getDocument()
Returns the Document associated with this Codat.
Since:
JXTA 1.0

Project JXTA