|
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.protocol.TransportAdvertisement
net.jxta.impl.protocol.TCPAdv
public class TCPAdv
Provides configuration parameters for the JXTA TCP Message Transport.
Nested Class Summary | |
---|---|
static class |
TCPAdv.Instantiator
Our instantiator |
Field Summary |
---|
Fields inherited from class net.jxta.protocol.TransportAdvertisement |
---|
protocol |
Method Summary | |
---|---|
static String |
getAdvertisementType()
Returns the identifying type of this Advertisement. |
String |
getAdvType()
Returns the identifying type of this Advertisement. |
String |
getConfigMode()
returns the config mode. |
Document |
getDocument(MimeMediaType encodeAs)
Write this advertisement into a document of the requested type. |
int |
getEndPort()
Return the highest port on which the TCP Transport will listen if configured to do so. |
String[] |
getIndexFields()
Returns the element names on which this advertisement should be indexed. |
String |
getInterfaceAddress()
Returns the interface which the TCP transport will use. |
String |
getMulticastAddr()
returns the multicastaddr |
int |
getMulticastPort()
returns the multicastport |
int |
getMulticastSize()
returns the multicastsize |
boolean |
getMulticastState()
Determine whether multicast if off or not |
int |
getPort()
Returns the port on which the TCP Transport will listen if configured to do so. |
boolean |
getPublicAddressOnly()
Returns the state of whether to only use public address |
String |
getServer()
Returns the public address |
int |
getStartPort()
Return the lowest port on which the TCP Transport will listen if configured to do so. |
protected boolean |
handleElement(Element raw)
Process an individual element from the document during parse. |
boolean |
isClientEnabled()
Returns the configuration for outbound connections. |
boolean |
isServerEnabled()
Returns the configuration for inbound connections. |
void |
setClientEnabled(boolean enabled)
Sets the configuration for outbound connections. |
void |
setConfigMode(String mode)
set the config mode. |
void |
setEndPort(int end)
Sets the highest port on which the TCP Transport will listen if configured to do so. |
void |
setInterfaceAddress(String ia)
Sets the interface which the TCP transport will use. |
void |
setMulticastAddr(String multicastaddr)
set the multicastaddr |
void |
setMulticastPort(int multicastport)
set the multicastport |
void |
setMulticastSize(int multicastsize)
set the multicastsize |
void |
setMulticastState(boolean newState)
Enable or disable multicast. |
void |
setPort(int port)
Sets the port on which the TCP Transport will listen if configured to do so. |
void |
setPublicAddressOnly(boolean only)
Sets the state of whether to only use public address |
void |
setServer(String address)
Set the public address. |
void |
setServerEnabled(boolean enabled)
Sets the configuration for inbound connections. |
void |
setStartPort(int start)
Sets the lowest port on which the TCP Transport will listen if configured to do so. |
Methods inherited from class net.jxta.protocol.TransportAdvertisement |
---|
getBaseAdvType, getID, getProtocol, setProtocol |
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 String getInterfaceAddress()
public void setInterfaceAddress(String ia)
ia
- The interface to use. May be a DNS name or an IP Address.public int getPort()
-1
, 0
and 1-65535
.
The -1
value is used to signify that there is no port
preference and any port in range will be used. The 0
specifies that the Socket API dynamic port allocation should be used.
For values 1-65535
the value specifies the required port on
which the TCP transport will listen.
public void setPort(int port)
-1
, 0
and 1-65535
.
The -1
value is used to signify that there is no port
preference and any port in range will be used. The 0
specifies that the Socket API dynamic port allocation should be used.
For values 1-65535
the value specifies the required port on
which the TCP transport will listen.
port
- the port on which to listen.public int getStartPort()
-1
, 0
and
1-65535
. The -1
value is used to signify that
the port range feature should be disabled. The 0
specifies
that the Socket API dynamic port allocation should be used. For values
1-65535
the value must be equal to or less than the value
used for end port.
public void setStartPort(int start)
-1
, 0
and
1-65535
. The -1
value is used to signify that
the port range feature should be disabled. The 0
specifies
that the Socket API dynamic port allocation should be used. For values
1-65535
the value must be equal to or less than the value
used for end port.
start
- the lowest port on which to listen.public int getEndPort()
-1
, 0
and
1-65535
. The -1
value is used to signify that
the port range feature should be disabled. The 0
specifies
that the Socket API dynamic port allocation should be used. For values
1-65535
the value must be equal to or greater than the value
used for start port.
public void setEndPort(int end)
-1
, 0
and
1-65535
. The -1
value is used to signify that
the port range feature should be disabled. The 0
specifies
that the Socket API dynamic port allocation should be used. For values
1-65535
the value must be equal to or greater than the value
used for start port.
end
- the highest port on which to listen.public boolean getMulticastState()
public void setMulticastState(boolean newState)
newState
- the desired state.public String getMulticastAddr()
public void setMulticastAddr(String multicastaddr)
multicastaddr
- set multicastaddrpublic int getMulticastPort()
public void setMulticastPort(int multicastport)
multicastport
- set multicastportpublic int getMulticastSize()
public void setMulticastSize(int multicastsize)
multicastsize
- set multicast sizepublic String getServer()
public void setServer(String address)
address
- addresspublic boolean isClientEnabled()
true
if outbound connections are allowed otherwise
false
public void setClientEnabled(boolean enabled)
enabled
- true
if outbound connections are allowed otherwise
false
public boolean isServerEnabled()
true
if inbound connections are allowed otherwise
false
public void setServerEnabled(boolean enabled)
enabled
- true
if inbound connections are allowed otherwise
false
public String getConfigMode()
public void setConfigMode(String mode)
mode
- Can be "auto", "manual" other settings will act as the default
which is "auto".public boolean getPublicAddressOnly()
public void setPublicAddressOnly(boolean only)
only
- true to use "Public Address Only"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
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |