|
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.RdvConfigAdv
public final class RdvConfigAdv
Contains parameters for configuration of the Reference Implementation Rendezvous Service.
<xs:complexType name="RdvConfig">
<xs:sequence>
<xs:element name="seeds" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:sequence>
<xs:element name="addr" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="jxta:JXTAID">
<xs:attribute name="seeding" type="xs:boolean" default="false"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="useOnlySeeds" type="xs:boolean" default="false"/>
<xs:attribute name="connectDelay" type="xs:unsignedLong"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="config" type="jxta:RdvConfiguration"/>
<xs:attribute name="maxTTL" type="xs:unsignedInt"/>
<xs:attribute name="autoRendezvousInterval" type="xs:unsignedInt"/>
<xs:attribute name="probeRelays" type="xs:boolean" default="true"/>
<xs:attribute name="maxClients" type="xs:unsignedInt"/>
<xs:attribute name="leaseDuration" type="xs:unsignedLong"/>
<xs:attribute name="leaseMargin" type="xs:unsignedLong"/>
<xs:attribute name="minHappyPeerView" type="xs:unsignedInt"/>
</xs:complexType>
Nested Class Summary | |
---|---|
static class |
RdvConfigAdv.Instantiator
Instantiator for RdvConfigAdv |
static class |
RdvConfigAdv.RendezVousConfiguration
Possible Rendezvous configurations. |
Method Summary | |
---|---|
void |
addSeedingURI(String addr)
|
void |
addSeedingURI(URI addr)
|
void |
addSeedRendezvous(String addr)
|
void |
addSeedRendezvous(URI addr)
|
void |
clearSeedingURIs()
|
void |
clearSeedRendezvous()
|
URI |
getAclUri()
Return ACL URI if set |
static String |
getAdvertisementType()
Returns the identifying type of this Advertisement. |
String |
getAdvType()
Returns the identifying type of this Advertisement. |
long |
getAutoRendezvousCheckInterval()
The interval in relative milliseconds at which this peer will re-evaluate it's state as a rendezvous. |
String |
getBaseAdvType()
Returns the base type of this advertisement hierarchy. |
RdvConfigAdv.RendezVousConfiguration |
getConfiguration()
True if this peer is to default to act as a rendezvous. |
Document |
getDocument(MimeMediaType encodeAs)
Write this advertisement into a document of the requested type. |
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. |
long |
getLeaseDuration()
The interval in relative milliseconds of leases offered by rendezvous peers. |
long |
getLeaseMargin()
The interval in relative milliseconds of leases offered by rendezvous peers. |
int |
getMaxClients()
Return the maximum number of clients. |
int |
getMaxTTL()
Returns the maximum TTL for messages propagated by this peer or -1 for the default value. |
int |
getMinHappyPeerView()
Returns the minimum peerview size which the rendezvous service will find sufficient. |
boolean |
getProbeRelays()
If true then rendezvous clients will probe relay servers for rendezvous. |
URI[] |
getSeedingURIs()
|
URI[] |
getSeedRendezvous()
|
long |
getSeedRendezvousConnectDelay()
The interval in relative milliseconds before which this peer will attempt to contact the the seed peers. |
boolean |
getUseOnlySeeds()
If true then this peer will use only seed rendezvous when configured as an edge peer. |
protected boolean |
handleElement(Element raw)
Process an individual element from the document during parse. |
boolean |
removeSeedingURI(URI addr)
|
boolean |
removeSeedRendezvous(URI addr)
|
void |
setAclUri(URI uri)
Sets ACL URI |
void |
setAutoRendezvousCheckInterval(long newvalue)
Sets the interval in relative milliseconds at which this peer will re-evaluate it's state as a rendezvous. |
void |
setConfiguration(RdvConfigAdv.RendezVousConfiguration newstate)
Set the default rendezvous state of this peer. |
void |
setLeaseDuration(long newvalue)
Sets interval in relative milliseconds of leases to be offered by rendezvous peers. |
void |
setLeaseMargin(long newvalue)
Sets interval in relative milliseconds of leases to be offered by rendezvous peers. |
void |
setMaxClients(int newvalue)
Sets he maximum number of clients. |
void |
setMaxTTL(int newvalue)
Sets the maximum TTL for messages propagated by this peer. |
void |
setMinHappyPeerView(int newvalue)
Sets the minimum peerview size which the rendezvous service will find sufficient. |
void |
setProbeRelays(boolean doProbe)
Set whether rendezvous clients will probe relay servers for rendezvous. |
void |
setSeedRendezvousConnectDelay(long newvalue)
Sets the interval in relative milliseconds before which this peer will attempt to contact the the seed peers. |
void |
setUseOnlySeeds(boolean onlySeeds)
Set whether this peer will use only seed rendezvous when configured as an edge peer. |
Methods inherited from class net.jxta.document.ExtendableAdvertisement |
---|
handleAttribute |
Methods inherited from class net.jxta.document.Advertisement |
---|
clone, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method 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
Advertisement.getAdvertisementType() no matter what the real type of the
advertisement.
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.protected boolean handleElement(Element raw)
protected boolean handleElement(Element elem) {
if (super.handleElement()) {
// it's been handled.
return true;
}
... handle elements here ...
// we don't know how to handle the element
return false;
}
handleElement
in class ExtendableAdvertisement
raw
- The element to be processed.
true
if the element was recognized, otherwise false.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 RdvConfigAdv.RendezVousConfiguration getConfiguration()
public void setConfiguration(RdvConfigAdv.RendezVousConfiguration newstate)
newstate
- if true then this peer should default to acting as a
rendezvous.public long getAutoRendezvousCheckInterval()
0
(zero), the default, then
the peer will remain in the state of isRendezvous
.
0
(zero), the default, then
the peer will remain in the state of isRendezvous
.public void setAutoRendezvousCheckInterval(long newvalue)
0
(zero), the default, then
the peer will remain in the state of isRendezvous
.
newvalue
- The interval in relative milliseconds at which this peer
will re-evaluate it's state as a rendezvous. If 0
(zero),
the default, then the peer will remain in the state of
isRendezvous
.public boolean getProbeRelays()
public void setProbeRelays(boolean doProbe)
doProbe
- If true then rendezvous clients will probe relay servers for rendezvous.public URI[] getSeedRendezvous()
public void addSeedRendezvous(URI addr)
public void addSeedRendezvous(String addr)
public boolean removeSeedRendezvous(URI addr)
public void clearSeedRendezvous()
public URI[] getSeedingURIs()
public void addSeedingURI(URI addr)
public void addSeedingURI(String addr)
public boolean removeSeedingURI(URI addr)
public void clearSeedingURIs()
public boolean getUseOnlySeeds()
public void setUseOnlySeeds(boolean onlySeeds)
onlySeeds
- If true then this peer will use only seed rendezvous
when configured as an edge peer.public long getSeedRendezvousConnectDelay()
public void setSeedRendezvousConnectDelay(long newvalue)
newvalue
- The interval in relative milliseconds before which this peer will
attempt to contact the the seed peers or
-1
for the default value.public long getLeaseDuration()
public void setLeaseDuration(long newvalue)
newvalue
- The interval in relative milliseconds of leases to be offered by rendezvous
peers or -1
for the default value.public long getLeaseMargin()
public void setLeaseMargin(long newvalue)
newvalue
- The interval in relative milliseconds of leases to be offered by rendezvous
peers or
-1
for the default value.public int getMaxClients()
public void setMaxClients(int newvalue)
newvalue
- The maximum number of clients or
-1
for the default value.public int getMaxTTL()
public void setMaxTTL(int newvalue)
newvalue
- the maximum TTL for messages propagated by this peer or
-1
for the default value.public int getMinHappyPeerView()
public void setMinHappyPeerView(int newvalue)
newvalue
- the minimum peerview size, which must be > 0 or
-1
for the default value.public URI getAclUri()
public void setAclUri(URI uri)
uri
- URI if set, null otherwise
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |