JXTA

net.jxta.protocol
Class ModuleClassAdvertisement

java.lang.Object
  extended by net.jxta.document.Advertisement
      extended by net.jxta.document.ExtendableAdvertisement
          extended by net.jxta.protocol.ModuleClassAdvertisement
All Implemented Interfaces:
Cloneable

public abstract class ModuleClassAdvertisement
extends ExtendableAdvertisement
implements Cloneable

Formally documents the existence of a module class (identified by the ModuleClassID and may provide additional descriptive metadata about the Module Class.

See Also:
ModuleClassID

Constructor Summary
ModuleClassAdvertisement()
           
 
Method Summary
 ModuleClassAdvertisement clone()
          
static String getAdvertisementType()
          Returns the identifying type of this Advertisement.
 String getBaseAdvType()
          Returns the base type of this advertisement hierarchy.
 StructuredDocument getDesc()
          returns the description
 String getDescription()
          returns the description
 ID getID()
          Returns an ID which identifies this Advertisement as uniquely as possible.
 ModuleClassID getModuleClassID()
          returns the id of the class
 String getName()
          returns the name of the class
 void setDesc(Element desc)
          sets the description
 void setDescription(String description)
          sets the description
 void setModuleClassID(ModuleClassID id)
          sets the id of the class
 void setName(String name)
          sets the name of the class
 
Methods inherited from class net.jxta.document.ExtendableAdvertisement
getDocument, handleAttribute, handleElement
 
Methods inherited from class net.jxta.document.Advertisement
getAdvType, getIndexFields, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ModuleClassAdvertisement

public ModuleClassAdvertisement()
Method Detail

getAdvertisementType

public static String getAdvertisementType()
Returns the identifying type of this Advertisement.

Returns:
The type of advertisement.

getBaseAdvType

public final String getBaseAdvType()
Returns the base type of this advertisement hierarchy. Typically, only the most basic advertisement of a type will implement this method and declare it as final.

Specified by:
getBaseAdvType in class ExtendableAdvertisement
Returns:
String the base type of advertisements in this hierarchy.

clone

public ModuleClassAdvertisement clone()

Overrides:
clone in class Advertisement

getID

public ID getID()
Returns an ID which identifies this Advertisement as uniquely as possible. This ID is typically used as the primary key for indexing of the Advertisement within databases.

Each advertisement sub-class must choose an appropriate implementation which returns canonical and relatively unique ID values for it's instances. Since this ID is commonly used for indexing, the IDs returned must be as unique as possible to avoid collisions. The value for the ID returned can either be:

For Advertisement types which normally return non-ID.nullID values no ID should be returned when asked to generate an ID while the Advertisement is an inconsistent state (example: uninitialized index fields). Instead IllegalStateException should be thrown.

Specified by:
getID in class Advertisement
Returns:
An ID that relatively uniquely identifies this advertisement or ID.nullID if this advertisement is of a type that is not normally indexed.

getName

public String getName()
returns the name of the class

Returns:
String name of the class

setName

public void setName(String name)
sets the name of the class

Parameters:
name - name of the class to be set

getDescription

public String getDescription()
returns the description

Returns:
String the description

setDescription

public void setDescription(String description)
sets the description

Parameters:
description - the description

getDesc

public StructuredDocument getDesc()
returns the description

Returns:
the description

setDesc

public void setDesc(Element desc)
sets the description

Parameters:
desc - the description

getModuleClassID

public ModuleClassID getModuleClassID()
returns the id of the class

Returns:
ModuleClassID the class id

setModuleClassID

public void setModuleClassID(ModuleClassID id)
sets the id of the class

Parameters:
id - The id of the class

JXSE