Project JXTA

net.jxta.protocol
Class ModuleSpecAdvertisement

java.lang.Object
  |
  +--net.jxta.document.Advertisement
        |
        +--net.jxta.protocol.ModuleSpecAdvertisement
All Implemented Interfaces:
java.lang.Cloneable

public abstract class ModuleSpecAdvertisement
extends Advertisement
implements java.lang.Cloneable

A ModuleSpecAdvertisement describes a module specification. Its main purpose is to provide references to the documentation needed in order to create conforming implementations of that specification. A secondary use is, optionaly, 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 of the java 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 paramter. Alternatively if the proxy version is completely dedicated to the specification that it proxies, both sides may have the PipeID and type hardcoded.

See Also:
ModuleSpecID, PipeAdvertisement, ModuleImplAdvertisement, Advertisement

Constructor Summary
ModuleSpecAdvertisement()
           
 
Method Summary
 java.lang.Object clone()
          Clone this ModuleSpecAdvertisement
static java.lang.String getAdvertisementType()
          returns the advertisement type
 ModuleSpecID getAuthSpecID()
          returns the specID of an authenticator module.
 java.lang.String getCreator()
          Returns the creator of the module spec, in case someone cares.
 java.lang.String getDescription()
          returns the keywords/description associated with this class
 ID getID()
          returns a unique id for that adv for the purpose of indexation.
 ModuleSpecID getModuleSpecID()
          returns the id of the spec
 java.lang.String getName()
          returns the name of the module spec
 StructuredDocument getParam()
          returns the param element.
 PipeAdvertisement getPipeAdvertisement()
          returns the embedded pipe advertisement if any.
 ModuleSpecID getProxySpecID()
          returns the specID of a proxy module.
 java.lang.String getSpecURI()
          returns the uri.
 java.lang.String getVersion()
          returns the specification version number
 void setAuthSpecID(ModuleSpecID authSpecID)
          sets an authenticator module specID
 void setCreator(java.lang.String creator)
          Sets the creator of this module spec.
 void setDescription(java.lang.String description)
          sets the description associated with this class
 void setModuleSpecID(ModuleSpecID id)
          sets the id of the class
 void setName(java.lang.String name)
          sets the name of the module spec
 void setParam(StructuredDocument 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(java.lang.String uri)
          sets the uri
 void setVersion(java.lang.String version)
          sets the version of the module
 
Methods inherited from class net.jxta.document.Advertisement
getDocument
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModuleSpecAdvertisement

public ModuleSpecAdvertisement()
Method Detail

getAdvertisementType

public static java.lang.String getAdvertisementType()
returns the advertisement type
Returns:
string type
Since:
JXTA 1.0

clone

public java.lang.Object clone()
Clone this ModuleSpecAdvertisement
Overrides:
clone in class Advertisement
Returns:
Object an object of class ModuleSpecAdvertisement that is a deep-enough copy of this one.

getModuleSpecID

public ModuleSpecID getModuleSpecID()
returns the id of the spec
Returns:
ModuleSpecID the spec id
Since:
JXTA 1.0

setModuleSpecID

public void setModuleSpecID(ModuleSpecID id)
sets the id of the class
Parameters:
id - The id of the spec
Since:
JXTA 1.0

getID

public ID getID()
returns a unique id for that adv for the purpose of indexation. The spec id uniquely identifies this advertisement.
Overrides:
getID in class Advertisement
Returns:
ID the spec id as a basic ID.
Since:
JXTA 1.0

getName

public java.lang.String getName()
returns the name of the module spec
Returns:
String name of the module spec
Since:
JXTA 1.0

setName

public void setName(java.lang.String name)
sets the name of the module spec
Parameters:
name - name of the module spec to be set
Since:
JXTA 1.0

getCreator

public java.lang.String getCreator()
Returns the creator of the module spec, in case someone cares.
Returns:
String the creator.
Since:
JXTA 1.0

setCreator

public void setCreator(java.lang.String creator)
Sets the creator of this module spec. Note: the usefullness of this is unclear.
Parameters:
creator - name of the creator of the module
Since:
JXTA 1.0

getSpecURI

public java.lang.String getSpecURI()
returns the uri. This uri normally points at the actual specification that this advertises.
Returns:
String uri
Since:
JXTA 1.0

setSpecURI

public void setSpecURI(java.lang.String uri)
sets the uri
Parameters:
uri - string uri
Since:
JXTA 1.0

getVersion

public java.lang.String getVersion()
returns the specification version number
Returns:
String version number
Since:
JXTA 1.0

setVersion

public void setVersion(java.lang.String version)
sets the version of the module
Parameters:
version - version number
Since:
JXTA 1.0

getDescription

public java.lang.String getDescription()
returns the keywords/description associated with this class
Returns:
String keywords/description associated with the class
Since:
JXTA 1.0

setDescription

public void setDescription(java.lang.String description)
sets the description associated with this class
Parameters:
description -  
Since:
JXTA 1.0

getParam

public StructuredDocument getParam()
returns the param element.
Returns:
Element parameters as an Element of unspecified content.
Since:
JXTA 1.0

setParam

public void setParam(StructuredDocument param)
sets the param element.
Parameters:
param - Element of an unspecified content.
Since:
JXTA 1.0

getPipeAdvertisement

public PipeAdvertisement getPipeAdvertisement()
returns the embedded pipe advertisement if any.
Returns:
PipeAdvertisement the Pipe Advertisement. null if none exists.
Since:
JXTA 1.0

setPipeAdvertisement

public void setPipeAdvertisement(PipeAdvertisement pipeAdv)
sets an embedded pipe advertisement.
Parameters:
pipeAdv - the Pipe Advertisement. null is authorized.
Since:
JXTA 1.0

getProxySpecID

public ModuleSpecID getProxySpecID()
returns the specID of a proxy module.
Returns:
ModuleSpecID the spec id
Since:
JXTA 1.0

setProxySpecID

public void setProxySpecID(ModuleSpecID proxySpecID)
sets a proxy module specID
Parameters:
proxySpecID - The spec id
Since:
JXTA 1.0

getAuthSpecID

public ModuleSpecID getAuthSpecID()
returns the specID of an authenticator module.
Returns:
ModuleSpecID the spec id
Since:
JXTA 1.0

setAuthSpecID

public void setAuthSpecID(ModuleSpecID authSpecID)
sets an authenticator module specID
Parameters:
authSpecID - The spec id
Since:
JXTA 1.0

Project JXTA