|
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.RelayConfigAdv
public final class RelayConfigAdv
Contains parameters for configuration of the Reference Implemenation Relay Service.
Nested Class Summary | |
---|---|
static class |
RelayConfigAdv.Instantiator
Instantiator for RelayConfigAdv |
Method Summary | |
---|---|
void |
addSeedingURI(String addr)
|
void |
addSeedingURI(URI addr)
|
void |
addSeedRelay(EndpointAddress addr)
|
void |
addSeedRelay(String addr)
|
void |
clearSeedingURIs()
|
void |
clearSeedRelays()
|
RelayConfigAdv |
clone()
|
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 |
getAnnounceInterval()
The interval in relative milliseconds at which relay server will announce its presence. |
String |
getBaseAdvType()
Returns the base type of this advertisement hierarchy. |
long |
getClientLeaseDuration()
The interval in relative milliseconds of leases accepted by clients. |
int |
getClientMessageQueueSize()
Return the client message queue length size. |
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. |
int |
getMaxClients()
Return the maximum number of relay clients. |
int |
getMaxRelays()
Return the maximum number of relay clients. |
long |
getMessengerPollInterval()
The interval in relative milliseconds of at which clients will poll for messengers |
URI[] |
getSeedingURIs()
|
EndpointAddress[] |
getSeedRelays()
|
long |
getServerLeaseDuration()
The interval in relative milliseconds of leases offered by servers. |
long |
getStallTimeout()
The interval in relative milliseconds after which a client is assumed to no longer be connected if it fails to request messages. |
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 |
isClientEnabled()
If true then this peer will act as a relay client. |
boolean |
isServerEnabled()
If true then this peer will act as a relay server. |
boolean |
removeSeedingURI(URI addr)
|
boolean |
removeSeedRelay(EndpointAddress addr)
|
void |
setAclUri(URI uri)
Sets ACL URI |
void |
setAnnounceInterval(long newvalue)
Sets interval in relative milliseconds at which relay server will announce its presence or -1 for default value. |
void |
setClientEnabled(boolean enabled)
If true then this peer will act as a relay client. |
void |
setClientLeaseDuration(long newvalue)
Sets interval in relative milliseconds of leases accepted by clients. |
void |
setClientMessageQueueSize(int newvalue)
Sets the client message queue length size. |
void |
setMaxClients(int newvalue)
Sets he maximum number of relay clients. |
void |
setMaxRelays(int newvalue)
Sets the maximum number of relay clients. |
void |
setMessengerPollInterval(long newvalue)
Sets interval in relative milliseconds of at which clients will poll for messengers. |
void |
setServerEnabled(boolean enabled)
If true then this peer will act as a relay server. |
void |
setServerLeaseDuration(long newvalue)
Sets interval in relative milliseconds of leases offered by servers. |
void |
setStallTimeout(long newvalue)
Sets interval in relative milliseconds after which a client is assumed to no longer be connected if it fails to request messages. |
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 |
---|
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
Advertiement.getAdvertisementType() no matter what the real type of the
advertisment.
public RelayConfigAdv clone()
clone
in class 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 boolean isClientEnabled()
public void setClientEnabled(boolean enabled)
enabled
- If true then this peer will act as a relay client.public int getMaxRelays()
-1
for
default value.public void setMaxRelays(int newvalue)
newvalue
- The maximum number of relay clients or -1
for default value or -1
for default value.public long getClientLeaseDuration()
-1
for default value.public void setClientLeaseDuration(long newvalue)
newvalue
- The interval in relative milliseconds of leases accepted
by clients or -1
for default value.public long getMessengerPollInterval()
-1
for default value.public void setMessengerPollInterval(long newvalue)
newvalue
- The interval in relative milliseconds of at which clients
will poll for messengers or -1
for default value.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 EndpointAddress[] getSeedRelays()
public void addSeedRelay(EndpointAddress addr)
public void addSeedRelay(String addr)
public boolean removeSeedRelay(EndpointAddress addr)
public void clearSeedRelays()
public URI[] getSeedingURIs()
public void addSeedingURI(URI addr)
public void addSeedingURI(String addr)
public boolean removeSeedingURI(URI addr)
public void clearSeedingURIs()
public boolean isServerEnabled()
public void setServerEnabled(boolean enabled)
enabled
- If true then this peer will act as a relay server.public int getMaxClients()
-1
for
default value.public void setMaxClients(int newvalue)
newvalue
- The maximum number of relay clients or -1
for default value.public int getClientMessageQueueSize()
-1
for default value.public void setClientMessageQueueSize(int newvalue)
newvalue
- The client message queue length size or -1
for default value.public long getServerLeaseDuration()
public void setServerLeaseDuration(long newvalue)
newvalue
- The interval in relative milliseconds of leases offered
by servers or -1
for default value.public long getStallTimeout()
-1
for default value.public void setStallTimeout(long newvalue)
newvalue
- The interval in relative milliseconds after which a
client is assumed to no longer be connected if it fails to request
messages or -1
for default value.public long getAnnounceInterval()
-1
for default value.public void setAnnounceInterval(long newvalue)
-1
for default value.
newvalue
- The interval in relative milliseconds at which relay server will
announce its presence.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 |