|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.document.Advertisement
net.jxta.document.ExtendableAdvertisement
net.jxta.impl.protocol.DiscoveryConfigAdv
public final class DiscoveryConfigAdv
Contains parameters for configuration of the Reference Implemenation Rendezvous Service.
Nested Class Summary | |
---|---|
static class |
DiscoveryConfigAdv.Instantiator
Instantiator for DiscoveryConfigAdv |
Constructor Summary | |
---|---|
DiscoveryConfigAdv()
Use the Instantiator through the factory |
|
DiscoveryConfigAdv(Element root)
Use the Instantiator through the factory |
Method Summary | |
---|---|
DiscoveryConfigAdv |
clone()
Make a safe clone of this DiscoveryConfigAdv. |
static String |
getAdvertisementType()
Returns the identifying type of this Advertisement. |
String |
getAdvType()
Returns the identifying type of this Advertisement. |
String |
getBaseAdvType()
Returns the base type of this advertisement hierarchy. |
Document |
getDocument(MimeMediaType encodeAs)
Write this advertisement into a document of the requested type. |
boolean |
getForwardAlwaysReplica()
True if this discovery service will forward queries to the replica peer in all cases, rather than only in the absence of local responses. |
boolean |
getForwardBelowTreshold()
True if this discovery service will forward queries when the number of local responses is below the specified treshold, rather than only in the absence of local responses. |
ID |
getID()
Returns an ID which identifies this Advertisement as uniquely as
possible. |
String[] |
getIndexFields()
Returns the element names on which this advertisement should be indexed. |
boolean |
getLocalOnly()
True if this discovery service performs only local discovery. |
void |
setForwardAlwaysReplica(boolean newvalue)
Specifies if this discovery service will forward queries to the replica peer in all cases, rather than only in the absence of local responses. |
void |
setForwardBelowTreshold(boolean newvalue)
Specifies if this discovery service will forward queries when the number of local responses is below the specified treshold, rather than only in the absence of local responses. |
void |
setLocalOnly(boolean newvalue)
Specifies if this discovery service will perform local only discovery. |
Methods inherited from class net.jxta.document.ExtendableAdvertisement |
---|
handleAttribute, handleElement |
Methods inherited from class net.jxta.document.Advertisement |
---|
toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
DiscoveryConfigAdv()
DiscoveryConfigAdv(Element root)
root
- the elementMethod Detail |
---|
public static String getAdvertisementType()
Advertisement adv = module.getSomeAdv();
String advType = adv.getAdvertisementType();
This is wrong and does not work the way you might expect.
This call is not polymorphic and calls
Advertiement.getAdvertisementType() no matter what the real type of the
advertisment.
public DiscoveryConfigAdv clone() throws CloneNotSupportedException
clone
in class Advertisement
CloneNotSupportedException
public String getAdvType()
Advertisement.getAdvertisementType()
this method will return the correct
runtime type of an Advertisement object.
This implementation is provided for existing advertisements which do not
provide their own implementation. In most cases you should provide your
own implementation for efficiency reasons.
getAdvType
in class Advertisement
public final String getBaseAdvType()
final
.
getBaseAdvType
in class ExtendableAdvertisement
public ID getID()
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:
IllegalStateException
should be
thrown.
getID
in class Advertisement
ID.nullID
if this advertisement is of a type that is not
normally indexed.public Document getDocument(MimeMediaType encodeAs)
"text/plain"
encodes
the document in a "pretty-print" format for human viewing and
"text/xml" which provides an XML format.
We don't have any content to add, just build the document instance and
return it to implementations that actually do something with it.
- Overrides:
getDocument
in class ExtendableAdvertisement
- Parameters:
encodeAs
- MimeMediaType format representation requested.
- Returns:
- The
Advertisement
represented as a Document
of
the requested MIME Media Type.
public String[] getIndexFields()
getIndexFields
in class Advertisement
public boolean getForwardAlwaysReplica()
public void setForwardAlwaysReplica(boolean newvalue)
newvalue
- The new setting.public boolean getForwardBelowTreshold()
public void setForwardBelowTreshold(boolean newvalue)
newvalue
- The new setting.public boolean getLocalOnly()
public void setLocalOnly(boolean newvalue)
newvalue
- The new setting.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |