JXTA

net.jxta.protocol
Class ModuleSpecAdvertisement

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

public abstract class ModuleSpecAdvertisement
extends ExtendableAdvertisement
implements Cloneable

Provides the references that describe a module specification. Typically this includes references to the documentation needed in order to create conforming implementations of the specification. A secondary use is, optionally, to make running instances usable remotely, by publishing any or all of the following:

Not all modules are usable remotely, it is up to the specification creator to make that choice. However, if the specification dictates it, all implementations can be expected to support it.

Note that the Standard PeerGroup implementation included with the JXSE reference implementation does not support replacing a group service with a pipe to a remote instance. However, nothing prevents a particular implementation of a group from using a proxy module in place of the fully version; provided that the API (and therefore the ClassIDs) of the proxy and local versions are identical.

Note also that in the case of the local+proxy style, it is up to the implementation of both sides to figure-out which pipe to listen to or connect to. The safest method is probably for the full version to seek its own ModuleSpecAdvertisement, and for the proxy version to accept the full version's ModuleSpecAdvertisement as a parameter. Alternatively, if the proxy version is completely dedicated to the specification that it proxies, both sides may have the PipeID and type hard-coded.

See Also:
ModuleSpecID, PipeAdvertisement, ModuleClassAdvertisement, ModuleImplAdvertisement, Advertisement

Constructor Summary
ModuleSpecAdvertisement()
           
 
Method Summary
 ModuleSpecAdvertisement clone()
          
static String getAdvertisementType()
          Returns the identifying type of this Advertisement.
 ModuleSpecID getAuthSpecID()
          returns the specID of an authenticator module.
 String getBaseAdvType()
          Returns the base type of this advertisement hierarchy.
 String getCreator()
          Returns the creator of the module spec, in case someone cares.
 StructuredDocument getDesc()
          returns the description
 String getDescription()
          returns the description
 ID getID()
          returns a unique id for that adv for the purpose of indexing.
 ModuleSpecID getModuleSpecID()
          returns the id of the spec
 String getName()
          returns the name of the module spec
 StructuredDocument getParam()
          returns the param element.
protected  StructuredDocument getParamPriv()
          Privileged version of getParam() that does not clone the elements.
 PipeAdvertisement getPipeAdvertisement()
          returns the embedded pipe advertisement if any.
 ModuleSpecID getProxySpecID()
          returns the specID of a proxy module.
 String getSpecURI()
          returns the uri.
 String getVersion()
          returns the specification version number
 void setAuthSpecID(ModuleSpecID authSpecID)
          sets an authenticator module specID
 void setCreator(String creator)
          Sets the creator of this module spec.
 void setDesc(Element desc)
          sets the description
 void setDescription(String description)
          sets the description
 void setModuleSpecID(ModuleSpecID id)
          sets the id of the spec
 void setName(String name)
          sets the name of the module spec
 void setParam(Element param)
          sets the param element.
 void setPipeAdvertisement(PipeAdvertisement pipeAdv)
          sets an embedded pipe advertisement.
 void setProxySpecID(ModuleSpecID proxySpecID)
          sets a proxy module specID
 void setSpecURI(String uri)
          sets the uri
 void setVersion(String version)
          sets the version of the module
 
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

ModuleSpecAdvertisement

public ModuleSpecAdvertisement()
Method Detail

getAdvertisementType

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

Returns:
String 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 ModuleSpecAdvertisement clone()

Overrides:
clone in class Advertisement

getID

public ID getID()
returns a unique id for that adv for the purpose of indexing. The spec id uniquely identifies this advertisement.

Specified by:
getID in class Advertisement
Returns:
ID the spec id as a basic ID.

getModuleSpecID

public ModuleSpecID getModuleSpecID()
returns the id of the spec

Returns:
ModuleSpecID the spec id

setModuleSpecID

public void setModuleSpecID(ModuleSpecID id)
sets the id of the spec

Parameters:
id - The id of the spec

getName

public String getName()
returns the name of the module spec

Returns:
String name of the module spec

setName

public void setName(String name)
sets the name of the module spec

Parameters:
name - name of the module spec 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

getCreator

public String getCreator()
Returns the creator of the module spec, in case someone cares.

Returns:
String the creator.

setCreator

public void setCreator(String creator)
Sets the creator of this module spec. Note: the usefulness of this is unclear.

Parameters:
creator - name of the creator of the module

getSpecURI

public String getSpecURI()
returns the uri. This uri normally points at the actual specification that this advertises.

Returns:
String uri

setSpecURI

public void setSpecURI(String uri)
sets the uri

Parameters:
uri - string uri

getVersion

public String getVersion()
returns the specification version number

Returns:
String version number

setVersion

public void setVersion(String version)
sets the version of the module

Parameters:
version - version number

getParam

public StructuredDocument getParam()
returns the param element.

Returns:
Element parameters as an Element of unspecified content.

getParamPriv

protected StructuredDocument getParamPriv()
Privileged version of getParam() that does not clone the elements.

Returns:
StructuredDocument A stand-alone structured document of unspecified content.

setParam

public void setParam(Element param)
sets the param element.

Parameters:
param - Element of an unspecified content.

getPipeAdvertisement

public PipeAdvertisement getPipeAdvertisement()
returns the embedded pipe advertisement if any.

Returns:
PipeAdvertisement the Pipe Advertisement. null if none exists.

setPipeAdvertisement

public void setPipeAdvertisement(PipeAdvertisement pipeAdv)
sets an embedded pipe advertisement.

Parameters:
pipeAdv - the Pipe Advertisement. null is authorized.

getProxySpecID

public ModuleSpecID getProxySpecID()
returns the specID of a proxy module.

Returns:
ModuleSpecID the spec id

setProxySpecID

public void setProxySpecID(ModuleSpecID proxySpecID)
sets a proxy module specID

Parameters:
proxySpecID - The spec id

getAuthSpecID

public ModuleSpecID getAuthSpecID()
returns the specID of an authenticator module.

Returns:
ModuleSpecID the spec id

setAuthSpecID

public void setAuthSpecID(ModuleSpecID authSpecID)
sets an authenticator module specID

Parameters:
authSpecID - The spec id

JXSE