org.eodisp.remote.util
Class NetworkConfigurator

java.lang.Object
  extended by org.eodisp.remote.util.NetworkConfigurator

public class NetworkConfigurator
extends java.lang.Object

NetworkConfigurator provides a simple programmatic interface to the JXTA configuration (i.e. the PlatformConfig). It provides factory methods to create a NetworkConfiguration instance from an existing PlatfromConfig or to create a typical EDGE, RENDEZVOUS or AD_HOC peer configuration from scratch. (edge, rendezvous, ad hoc etc.).

Read the following for an overview of typical types of peers:

1. Edge Peer
A peer which may or may not be behind a firewall or NAT (i.e. Directly addressable or not). It is recommended that this class of peer should always be configured with TCP/IP enabled (both incoming/outgoing, multicast on), and HTTP enabled outgoing only, it should also use a relay, and a rendezvous. It is important to note that the JXTAplatform automatically determines whether directs routes exists between peers, and will prefer such routes over relayed ones (hence the recommended configuration)

2. Rendezvous/Relay Peer
This class of peers is expected to provide infrastructure services and typically is directly reachable on the Internet. It is recommended that this class of peer should always be configured with TCP/IP enabled (both incoming/outgoing, multicast on), and HTTP enabled incoming only, act as a relay, and rendezvous.

3. Ad hoc peer
FIXME:

Important Note:
NetworkConfigurator makes use of classes from the net.jxta.impl.* packages. Applications are very strongly encouraged to avoid importing these classes as their interfaces may change without notice in future JXTA releases. The NetworkConfigurator API abstracts the configuration implementation details and will provide continuity and stability i.e. the NetworkConfigurator API won't change and it will automatically accommodate changes to service configuration.


Nested Class Summary
static class NetworkConfigurator.RendezvousConfig
           
 
Field Summary
static int ADHOC_NODE
          Deprecated. use the newXXX static factory method and the setXXX methods instead
protected  java.util.Properties configProps
           
static int EDGE_NODE
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int HTTP_CLIENT
          HTTP transport client state
static int HTTP_SERVER
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int IP_MULTICAST
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int PROXY_NODE
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int PROXY_SERVER
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RDV_AD_HOC
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RDV_CLIENT
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RDV_NODE
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RDV_RELAY_PROXY_NODE
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RDV_SERVER
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RELAY_CLIENT
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RELAY_NODE
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RELAY_OFF
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int RELAY_SERVER
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int TCP_CLIENT
          Deprecated. use the newXXX static factory method and the setXXX methods instead
static int TCP_SERVER
          Deprecated. use the newXXX static factory method and the setXXX methods instead
 
Constructor Summary
NetworkConfigurator()
          Deprecated. use newNetworkConfiguratorEdge() instead.
NetworkConfigurator(int mode, java.net.URI storeHome)
          Deprecated. use the newXXX static factory methods instead
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list for a specific property.
 void addRdvSeedingURI(java.lang.String seedURIStr)
          Adds a rendezvous seeding URI.
 void addRdvSeedingURI(java.net.URI seedURI)
          Adds a rendezvous seeding URI.
 void addRelaySeedingURI(java.lang.String seedURIStr)
          Sets the new RelayService seeding URI as a string.
 void addRelaySeedingURI(java.net.URI seedURI)
          Adds a relay seeding URI.
 void addSeedRelay(java.net.URI seedURI)
          Adds a relay service peer seed address

A relay service seed is defined as a physical endpoint address.

 void addSeedRendezvous(java.net.URI seedURI)
          Adds rendezvous peer seed, physical endpoint address

A RendezVousService seed is defined as a physical endpoint address Examples are http://192.168.1.1:9700 or tcp://192.168.1.1:9701).

 boolean exists()
          Deprecated.  
 java.lang.String getDescription()
          Returns the description of the peer.
 java.io.File getHome()
          Returns the current directory for configuration and cache persistent store
 java.lang.String getHttpInterfaceAddress()
          Returns the address on which the HTTP transport is listening for incoming messages.
 int getHttpPort()
          Returns the port the HTTP transport is configured to listen on.
 java.lang.String getHttpPublicAddress()
          Returns the public address under which the peer is reachable by peers from the public network.
 int getMode()
          Deprecated. Use getter methods instead (e.g. isHttpEnabled()).
 java.lang.String getMulticastAddress()
          Returns the IP group multicast address.
 int getMulticastPort()
          Returns the multicast port.
 int getMulticastSize()
          Returns the multicast size
 java.lang.String getName()
          Returns the name of the peer.
 java.lang.String getPassword()
          Gets the password used to sign the private key of the root certificate.
 net.jxta.peer.PeerID getPeerID()
          Returns the peer ID of this peer.
 net.jxta.protocol.ConfigParams getPlatformConfig()
          Returns the PlatformConfig (as ConfigParams) that can be used in one of the NetPeerGroupFactory constructors.
 java.lang.String getPrincipal()
          Gets the Principal for the peer root certificate.
 int getRelayMaxClients()
          Sets the maximum number of relay clients of this peer.
 NetworkConfigurator.RendezvousConfig getRendezvousConfig()
           
 int getRendezvousMaxClients()
          FIXME documentation
static java.net.URI getStoreHome()
          Returns the location which will serve as the parent for all stored items used by JXTA.
 int getTcpEndPort()
          Returns the end port on which the TCP transport is configured to listen for messages.
 java.lang.String getTcpInterfaceAddress()
          Returns the address on which the TCP transport is listening for incoming messages.
 int getTcpPort()
          Returns the port the TCP transport is listening.
 java.lang.String getTcpPublicAddress()
          Returns the public address under which the peer is reachable by peers from the public network.
 int getTcpStartPort()
          Returns the start port on which the TCP transport is configured to listen for messages.
 boolean hasChanges()
          Returns a boolean value indicating whether one or more values (fields) have been changed since either loading or the last save.
 boolean isHttpEnabled()
          Returns if HTTP support is enabled
 boolean isHttpIncoming()
          Returns if the HTTP transport is listening for messages or not.
 boolean isHttpOutgoing()
          Returns if the HTTP transport is configured to send messages.
 boolean isHttpPublicAddressExclusive()
          FIXME documentation
 boolean isProxyEnabled()
          Returns if Proxy support is enabled
 boolean isRelayClient()
          Returns if the peer acts as a relay client.
 boolean isRelayEnabled()
          Returns if Relay support is enabled
 boolean isRelayServer()
          Returns if the peer acts as a relay server.
 boolean isRendezvousEnabled()
          Returns if Rendezvous support is enabled
 boolean isTcpEnabled()
          Returns if TCP support is enabled
 boolean isTcpIncoming()
          Returns if the TCP transport is listening for messages or not.
 boolean isTcpOutgoing()
          Returns if the TCP transport is configured to send messages.
 boolean isTcpPublicAddressExclusive()
          Returns if the public address is exclusive FIXME: Better description of what this means in practice.
 boolean isUseMulticast()
          Returns if the peer uses multicast to find other peers (FIXME: Is it really just used to find other peers or is it used to send normal data messages too?)
 boolean isUseOnlyRelaySeeds()
          FIXME documentation
 boolean isUseOnlyRendezvousSeeds()
          FIXME documentation
 void load()
          Deprecated. Use the static method loadPlatformConfig(URI) instead
 void load(net.jxta.protocol.ConfigParams platformConfig)
          Deprecated. use static load methos #loadPlatfromConfig(ConfigParams) instead
 void load(java.net.URI uri)
          Deprecated. use te static loadPlatformConfig(URI) instead
static NetworkConfigurator loadPlatformConfig(net.jxta.protocol.ConfigParams platformConfig)
          Creates a NetworkConfgurator instance that takes the values from the given platform configuration.
static NetworkConfigurator loadPlatformConfig(java.net.URI platfromConfig)
          Creates a NetworkConfgurator instance that takes the values from the given platform configuration.
static NetworkConfigurator newNetworkConfiguratorAdHoc()
          Creates a new NetworkConfigurator instance that is suitable to create a PlatformConfig for a AD_HOC peer.
static NetworkConfigurator newNetworkConfiguratorEdge()
          Creates a new NetworkConfigurator instance that is suitable to create a PlatformConfig for an EDGE peer.
static NetworkConfigurator newNetworkConfiguratorRendezvous()
          Creates a new NetworkConfigurator instance that is suitable to create a PlatformConfig for a RENDEZVOUS peer.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void save()
          Deprecated. use save(File) instead.
 void save(java.io.File file)
          Generates a PlatformConfig (with getPlatformConfig()) and saves it in the file given by parameter file.
 void savePlatformConfig(java.io.OutputStream out)
          Generates a PlatformConfig (with getPlatformConfig()) and streams it to the given output stream.
 void setDescription(java.lang.String description)
          Sets PlaformConfig Peer Description element.
 void setHome(java.io.File home)
          Deprecated. use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams, URI) instead.
 void setHttpEnabled(boolean enabled)
          Enables or disables the HTTP support.
 void setHttpIncoming(boolean incoming)
          Toggles the support to receive messages over HTTP.
 void setHttpInterfaceAddress(java.lang.String address)
          Sets the HTTP interface Address on which the peer listens for incoming HTTP requests.
 void setHttpOutgoing(boolean outgoing)
          Toggles the support to send messages over HTTP.
 void setHttpPort(int port)
          Sets the HTTP listening port (default 9901).
 void setHttpPublicAddress(java.lang.String address)
          Sets the HTTP address the peer is reachable from the public network.
 void setHttpPublicAddress(java.lang.String address, boolean exclusive)
          Deprecated. use setHttpPublicAddress(String) and setHttpPublicAddressExclusive(boolean) instead.
 void setHttpPublicAddressExclusive(boolean exclusive)
          FIXME documentation
 void setInfrastructureDescription(java.lang.String description)
          Deprecated.  
 void setInfrastructureID(net.jxta.id.ID id)
          Deprecated.  
 void setInfrastructureID(java.lang.String idStr)
          Deprecated.  
 void setInfrastructureName(java.lang.String name)
          Deprecated.  
 void setMode(int mode)
          Deprecated. Use the setter methods instead.
 void setMulticastAddress(java.lang.String mcastAddress)
          Sets the IP group multicast address (default: "224.0.1.85").
 void setMulticastPort(int port)
          Sets the IP group multicast port (default 1234).
 void setMulticastSize(int size)
          Sets the multicast size.
 void setName(java.lang.String name)
          Sets the name of the peer (default "unknown").
 void setPassword(java.lang.String password)
          Sets the password used to sign the private key of the root certificate.
 void setPeerID(net.jxta.peer.PeerID peerID)
          Sets the peer ID of this peer.
 void setPeerId(java.lang.String peerID)
          Sets the peer ID of this peer.
 void setPrincipal(java.lang.String principal)
          Sets the Principal for the peer root certificate.
 void setProxyEnabled(boolean enable)
          Enables or disables the Proxy support.
 void setRelayClient(boolean enabled)
          If true then this peer will act as a relay client.
 void setRelayEnabled(boolean enabled)
          Enables or disables Relay support.
 void setRelayMaxClients(int relayMaxClients)
          Sets the maximum number of relay clients of this peer.
 void setRelaySeedURIs(java.util.List<java.lang.String> seedURIs)
          Sets the List relaySeeds represented as Strings

A RelayService seed is defined as a physical endpoint address

e.g.

 void setRelayServer(boolean enabled)
          If true then this peer will act as a relay server.
 void setRendezvousConfig(NetworkConfigurator.RendezvousConfig rendezvousConfig)
           
 void setRendezvousEnabled(boolean enabled)
          Enables or disables the Rendezvous support.
 void setRendezvousMaxClients(int rdvMaxClients)
          Sets the maximum number of rendezvous clients of this peer.
 void setRendezvousSeedURIs(java.util.List<java.lang.String> seedURIs)
          Sets the List of RendezVousService seeds represented as Strings

A RendezvousService seed is defined as a physical endpoint address

e.g.

 void setTcpEnabled(boolean enabled)
          Enables or disables the TCP support.
 void setTcpEndPort(int end)
          Sets the highest port on which the TCP Transport will listen if configured to do so.
 void setTcpIncoming(boolean enabled)
          Toggles the support to receive messages over the TCP transport (default is enabled).
 void setTcpInterfaceAddress(java.lang.String address)
          Sets the TCP interface Address on which the peer listens for incoming requests from the TCP transport.
 void setTcpOutgoing(boolean enabled)
          Toggles the support to send messages over TCP.
 void setTcpPort(int port)
          Sets the TCP listening port (default 9701).
 void setTcpPublicAddress(java.lang.String address)
          Sets the node public address

e.g.

 void setTcpPublicAddress(java.lang.String address, boolean exclusive)
          Deprecated. use setTcpPublicAddress(String) and setTcpPublicAddressExclusive(boolean) instead.
 void setTcpPublicAddressExclusive(boolean exclusive)
          Sets whether the public address is exclusive FIXME: Better description of what this means in practice.
 void setTcpStartPort(int start)
          Sets the lowest port on which the TCP Transport will listen if configured to do so setTcpIncoming(boolean) is set to true.
 void setUseMulticast(boolean enable)
          Toggles whether to use IP group multicast (default is true).
 void setUseOnlyRelaySeeds(boolean useOnlyRelaySeeds)
          Determines whether to restrict RelayService leases to those defined in the seed list that was set by addRelaySeedingURI(String) or addSeedRelay(URI).
 void setUseOnlyRendezvousSeeds(boolean useOnlyRendezvouSeeds)
          Determines whether to restrict RendezvousService leases to those defined in the seed list that was set by #addRendezvousSeedingURI(URI) or addSeedRendezvous(URI).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RELAY_OFF

public static final int RELAY_OFF
Deprecated. use the newXXX static factory method and the setXXX methods instead
Relay client Mode

See Also:
Constant Field Values

RELAY_CLIENT

public static final int RELAY_CLIENT
Deprecated. use the newXXX static factory method and the setXXX methods instead
Relay client Mode

See Also:
Constant Field Values

RELAY_SERVER

public static final int RELAY_SERVER
Deprecated. use the newXXX static factory method and the setXXX methods instead
Relay client Mode

See Also:
Constant Field Values

PROXY_SERVER

public static final int PROXY_SERVER
Deprecated. use the newXXX static factory method and the setXXX methods instead
Proxy Server Mode

See Also:
Constant Field Values

TCP_CLIENT

public static final int TCP_CLIENT
Deprecated. use the newXXX static factory method and the setXXX methods instead
TCP transport client state

See Also:
Constant Field Values

TCP_SERVER

public static final int TCP_SERVER
Deprecated. use the newXXX static factory method and the setXXX methods instead
TCP transport state

See Also:
Constant Field Values

HTTP_CLIENT

public static final int HTTP_CLIENT
HTTP transport client state

See Also:
Constant Field Values

HTTP_SERVER

public static final int HTTP_SERVER
Deprecated. use the newXXX static factory method and the setXXX methods instead
HTTP transport server state

See Also:
Constant Field Values

IP_MULTICAST

public static final int IP_MULTICAST
Deprecated. use the newXXX static factory method and the setXXX methods instead
IP multicast transport state

See Also:
Constant Field Values

RDV_SERVER

public static final int RDV_SERVER
Deprecated. use the newXXX static factory method and the setXXX methods instead
Rendezvous Mode

See Also:
Constant Field Values

RDV_CLIENT

public static final int RDV_CLIENT
Deprecated. use the newXXX static factory method and the setXXX methods instead
RendezVousService Client

See Also:
Constant Field Values

RDV_AD_HOC

public static final int RDV_AD_HOC
Deprecated. use the newXXX static factory method and the setXXX methods instead
RendezVousService Ad-Hoc mode

See Also:
Constant Field Values

ADHOC_NODE

public static final int ADHOC_NODE
Deprecated. use the newXXX static factory method and the setXXX methods instead
Default AD-HOC configuration

See Also:
Constant Field Values

EDGE_NODE

public static final int EDGE_NODE
Deprecated. use the newXXX static factory method and the setXXX methods instead
Default Edge configuration

See Also:
Constant Field Values

RDV_NODE

public static final int RDV_NODE
Deprecated. use the newXXX static factory method and the setXXX methods instead
Default Rendezvous configuration

See Also:
Constant Field Values

RELAY_NODE

public static final int RELAY_NODE
Deprecated. use the newXXX static factory method and the setXXX methods instead
Default Relay configuration

See Also:
Constant Field Values

PROXY_NODE

public static final int PROXY_NODE
Deprecated. use the newXXX static factory method and the setXXX methods instead
Default Proxy configuration

See Also:
Constant Field Values

RDV_RELAY_PROXY_NODE

public static final int RDV_RELAY_PROXY_NODE
Deprecated. use the newXXX static factory method and the setXXX methods instead
Default Rendezvous/Relay/Proxy configuration

See Also:
Constant Field Values

configProps

protected transient java.util.Properties configProps
Constructor Detail

NetworkConfigurator

public NetworkConfigurator()
Deprecated. use newNetworkConfiguratorEdge() instead.

See Also:
newNetworkConfiguratorEdge()

NetworkConfigurator

public NetworkConfigurator(int mode,
                           java.net.URI storeHome)
Deprecated. use the newXXX static factory methods instead

Creates a NetworkConfigurator with the default configuration of the specified mode.

Valid modes include ADHOC_NODE, EDGE_NODE, RDV_NODE PROXY_NODE, RELAY_NODE, RDV_RELAY_PROXY_NODE, or any combination of specific configuration.

e.g. RDV_NODE | HTTP_CLIENT

Parameters:
mode - the new configuration mode
storeHome - the URI to persistent store
See Also:
setMode(int)
Method Detail

setMode

public void setMode(int mode)
Deprecated. Use the setter methods instead.

Sets the current node configuration mode.

The default mode is EDGE, unless modified at construction time. A node configuration mode defined a preset configuration parameters based on a operating mode. i.e. an EDGE mode, enable client/server side tcp, multicast, client side http, RelayService client mode.

Valid modes include EDGE, RDV_SERVER, RELAY_OFF, RELAY_CLIENT, RELAY_SERVER, PROXY_SERVER, or any combination of which.

e.g. RDV_SERVER + RELAY_SERVER

Parameters:
mode - the new configuration mode
See Also:
getMode()

getMode

public int getMode()
Deprecated. Use getter methods instead (e.g. isHttpEnabled()).

Returns the current configuration mode

The default mode is EDGE, unless modified at construction time or through Method setMode(int). A node configuration mode defined a preset configuration parameters based on a operating mode. i.e. an EDGE mode, enable client/server side tcp, multicast, client side http, RelayService client mode.

Returns:
mode the current mode value
See Also:
setMode(int)

newNetworkConfiguratorEdge

public static NetworkConfigurator newNetworkConfiguratorEdge()
Creates a new NetworkConfigurator instance that is suitable to create a PlatformConfig for an EDGE peer. The configuration is provided in detail below:
Peer ID IDFactory.newPeerID(PeerGroupID.defaultNetPeerGroupID)
Name "unknown"
Description "Default Platform Config Advertisement created by NetworkConfigurator"
Tcp enabled true
Tcp incoming true
Tcp outgoing true
Tcp Interface Address null
Tcp Port 9701
Tcp Start Port 9701
Tcp End Port 9799
Use multicast true
Multicast address "224.0.1.85"
Multicast port 1234
Multicast size 16384
Tcp public address null
Tcp public address exclusive false
Http enabled true
Http incoming false
Http outgoing true
Http port 9700
Http public address null
Http public address exclusive false
Rendezvous enabled true
Rendezvous config RendezvousConfig.EDGE
Rendezvous seeds none are configured by default
Use Only Rendezvous Seeds false
Rendezvous max clients -1
Relay enabled true
Relay client true
Relay server false
Relay seeds none are configured by default
Use Only Relay Seeds false
Proxy enabled false
Principal null
Password null

Returns:

newNetworkConfiguratorRendezvous

public static NetworkConfigurator newNetworkConfiguratorRendezvous()
Creates a new NetworkConfigurator instance that is suitable to create a PlatformConfig for a RENDEZVOUS peer. The configuration is the same as the one created for an EDGE peer (newNetworkConfiguratorEdge()) with the following changes:
Rendezvous config RendezvousConfig.RENDEZVOUS
Http incoming true
Http outgoing false
Relay server true

Returns:

newNetworkConfiguratorAdHoc

public static NetworkConfigurator newNetworkConfiguratorAdHoc()
Creates a new NetworkConfigurator instance that is suitable to create a PlatformConfig for a AD_HOC peer. The configuration is the same as the one created for an EDGE peer (newNetworkConfiguratorEdge()) with the following changes (FIXME: Is that configuration suitable for an AD_HOC client?):
Rendezvous config RendezvousConfig.AD_HOC
Relay client false

Returns:

setPeerID

public void setPeerID(net.jxta.peer.PeerID peerID)
Sets the peer ID of this peer.

Parameters:
peerid - the ID of the peer

setPeerId

public void setPeerId(java.lang.String peerID)
Sets the peer ID of this peer. Convenience method to be able to set the peer with a string. Equivalent to: setPeerID((PeerID) ID.create(URI.create(peerID)))

Parameters:
peerid - the ID of the peer

getPeerID

public net.jxta.peer.PeerID getPeerID()
Returns the peer ID of this peer.

Returns:

setName

public void setName(java.lang.String name)
Sets the name of the peer (default "unknown"). The name of a peer does not to be unique.

Parameters:
name - the name of the peer

getName

public java.lang.String getName()
Returns the name of the peer.

Returns:
the name of the peer.

setDescription

public void setDescription(java.lang.String description)
Sets PlaformConfig Peer Description element. Default: "Platform Config Advertisement generated by NetworkConfigurator".

Parameters:
description - Description of the peer.

getDescription

public java.lang.String getDescription()
Returns the description of the peer.

Returns:
the description of the peer.

setTcpEnabled

public void setTcpEnabled(boolean enabled)
Enables or disables the TCP support.

Parameters:
enabled - true to enable TCP support

isTcpEnabled

public boolean isTcpEnabled()
Returns if TCP support is enabled

Returns:
true if TCP support is enabled

setTcpIncoming

public void setTcpIncoming(boolean enabled)
Toggles the support to receive messages over the TCP transport (default is enabled).

Parameters:
enabled - if true, the peer will listen for TCP requests on the port given by setTcpPort(int), otherwise incoming TCP is disabled and the peer does not listen to request from the TCP transport.

isTcpIncoming

public boolean isTcpIncoming()
Returns if the TCP transport is listening for messages or not.

Returns:
true if the TCP transport is configured to listen for messages.

setTcpOutgoing

public void setTcpOutgoing(boolean enabled)
Toggles the support to send messages over TCP.

Parameters:
enabled - if true, the peer can use TCP to send messages to other peers. Other peers must have enabled tcpIncoming to receive data through TCP.

isTcpOutgoing

public boolean isTcpOutgoing()
Returns if the TCP transport is configured to send messages.

Returns:
true if the TCP transport is configured to send messages.

setTcpPort

public void setTcpPort(int port)
Sets the TCP listening port (default 9701). This is meaningful only if setTcpIncoming(boolean) is enabled. To set the port of the HTTP transport use setHttpPort(int).

Parameters:
port - the tcp socket port the peer is listening on for request from the TCP transport

getTcpPort

public int getTcpPort()
Returns the port the TCP transport is listening.

Returns:
the port the TCP transport is listening.
See Also:
isTcpIncoming()

setTcpStartPort

public void setTcpStartPort(int start)
Sets the lowest port on which the TCP Transport will listen if configured to do so setTcpIncoming(boolean) is set to true. Valid values are -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. If the start port is set to -1 the end port must be set to -1 too.

Parameters:
start - the lowest port on which to listen.
See Also:
setTcpEndPort(int)

getTcpStartPort

public int getTcpStartPort()
Returns the start port on which the TCP transport is configured to listen for messages.

Returns:
the start port on which the TCP transport is configured to listen for messages.
See Also:
setTcpStartPort(int)

setTcpEndPort

public void setTcpEndPort(int end)
Sets the highest port on which the TCP Transport will listen if configured to do so. Valid values are -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. If the start port is set to -1 the end port must be set to -1 too.

Parameters:
end - the highest port on which to listen
See Also:
setTcpStartPort(int)

getTcpEndPort

public int getTcpEndPort()
Returns the end port on which the TCP transport is configured to listen for messages.

Returns:
the end port on which the TCP transport is configured to listen for messages.
See Also:
setTcpEndPort(int)

setTcpInterfaceAddress

public void setTcpInterfaceAddress(java.lang.String address)
Sets the TCP interface Address on which the peer listens for incoming requests from the TCP transport. Only meaningful if setTcpIncoming(boolean) is enabled. Please see setTcpPublicAddress(String, boolean) if the peer is not reachable through this address from the public network.

Parameters:
address - An IP address (e.g. "192.168.1.1").

getTcpInterfaceAddress

public java.lang.String getTcpInterfaceAddress()
Returns the address on which the TCP transport is listening for incoming messages.

Returns:
a TCP address or null if the interface address is not set. If the interface address is not set, a peer listens on all interfaces it can find on the computer (FIXME: is that true?).

setTcpPublicAddress

public void setTcpPublicAddress(java.lang.String address,
                                boolean exclusive)
Deprecated. use setTcpPublicAddress(String) and setTcpPublicAddressExclusive(boolean) instead.

Sets the node public address

e.g. "192.168.1.1:9701"

This address is the physical address defined in a node's AccessPointAdvertisement. This often required for NAT'd/FW nodes

Parameters:
address - the TCP transport public address
exclusive - public address advertised exclusively

setTcpPublicAddress

public void setTcpPublicAddress(java.lang.String address)
Sets the node public address

e.g. "192.168.1.1:9701"

This address is the physical address defined in a node's AccessPointAdvertisement. This often required for NAT'd/FW nodes

Parameters:
address - the TCP transport public address

getTcpPublicAddress

public java.lang.String getTcpPublicAddress()
Returns the public address under which the peer is reachable by peers from the public network. This can differ from the interface the peer is listening for messages. Most of the time this will be the address of the public address of a NAT server, that forwards TCP requests to a peer in the local network.

Returns:
a TCP address or null if this address is not explicitely set, that means it is set to the same value as the TCP interface address (getTcpInterfaceAddress()). FIXME: Correct?

setTcpPublicAddressExclusive

public void setTcpPublicAddressExclusive(boolean exclusive)
Sets whether the public address is exclusive FIXME: Better description of what this means in practice.

Parameters:
exclusive - True, if the address is exclusive, false otherwise.

isTcpPublicAddressExclusive

public boolean isTcpPublicAddressExclusive()
Returns if the public address is exclusive FIXME: Better description of what this means in practice.

Returns:
if the public address is exclusive

setUseMulticast

public void setUseMulticast(boolean enable)
Toggles whether to use IP group multicast (default is true).

Parameters:
enable - true to enable multicast for this peer.

isUseMulticast

public boolean isUseMulticast()
Returns if the peer uses multicast to find other peers (FIXME: Is it really just used to find other peers or is it used to send normal data messages too?)

Returns:
true if the peer uses multicast.

setMulticastAddress

public void setMulticastAddress(java.lang.String mcastAddress)
Sets the IP group multicast address (default: "224.0.1.85").

Parameters:
mcastAddress - the new multicast group address
See Also:
setMulticastPort(int)

getMulticastAddress

public java.lang.String getMulticastAddress()
Returns the IP group multicast address.

Returns:
the TCP multicast address or null if not set.

setMulticastPort

public void setMulticastPort(int port)
Sets the IP group multicast port (default 1234).

Parameters:
port - the new IP group multicast port
See Also:
setMulticastAddress(java.lang.String)

getMulticastPort

public int getMulticastPort()
Returns the multicast port.

Returns:
the multicast port.

setMulticastSize

public void setMulticastSize(int size)
Sets the multicast size.

Parameters:
size - the multicast size.

getMulticastSize

public int getMulticastSize()
Returns the multicast size

Returns:
the multicast size

setHttpEnabled

public void setHttpEnabled(boolean enabled)
Enables or disables the HTTP support.

Parameters:
enabled - true to enable HTTP support

isHttpEnabled

public boolean isHttpEnabled()
Returns if HTTP support is enabled

Returns:
true if HTTP support is enabled

setHttpIncoming

public void setHttpIncoming(boolean incoming)
Toggles the support to receive messages over HTTP.

Parameters:
incoming - if true, the peer will listen for HTTP requests on the port given by setHttpPort(int), otherwise incoming HTTP is disabled.

isHttpIncoming

public boolean isHttpIncoming()
Returns if the HTTP transport is listening for messages or not.

Returns:
true if the HTTP transport is configured to listen for messages.

setHttpOutgoing

public void setHttpOutgoing(boolean outgoing)
Toggles the support to send messages over HTTP.

Parameters:
outgoing - if true, the peer can use HTTP to send messages to other peers. Other peers must have enabled httpIncoming to receive data through HTTP. Most of the time, the receiving federate will be a relay peer.

isHttpOutgoing

public boolean isHttpOutgoing()
Returns if the HTTP transport is configured to send messages.

Returns:
true if the HTTP transport is configured to send messages.

setHttpPort

public void setHttpPort(int port)
Sets the HTTP listening port (default 9901). This is meaningful only if setHttpIncoming(boolean) is enabled.

Parameters:
port - the port the peer is listening for HTTP requests.

getHttpPort

public int getHttpPort()
Returns the port the HTTP transport is configured to listen on.

Returns:
the port the HTTP transport is configured to listen on.
See Also:
isTcpIncoming()

setHttpInterfaceAddress

public void setHttpInterfaceAddress(java.lang.String address)
Sets the HTTP interface Address on which the peer listens for incoming HTTP requests. Only meaningful if setHttpIncoming(boolean) is enabled. See setHttpPublicAddress(String, boolean) if the peer is not reachable from the public network by this address.

Parameters:
address - An IP address (e.g. "192.168.1.1").

getHttpInterfaceAddress

public java.lang.String getHttpInterfaceAddress()
Returns the address on which the HTTP transport is listening for incoming messages.

Returns:
a TCP address or null if the interface address is not set. If the interface address is not set, a peer listens on all interfaces it can find on the computer (FIXME: is that true?).

setHttpPublicAddress

public void setHttpPublicAddress(java.lang.String address,
                                 boolean exclusive)
Deprecated. use setHttpPublicAddress(String) and setHttpPublicAddressExclusive(boolean) instead.

Sets the HTTP address the peer is reachable from the public network. This is needed if the peer is not directly reachable on its own address from the public network but is behind a NAT. It is the address that other peers can use to reach the peer configured by this config. The value is in the form host:port, e.g. "209.128.126.120:9700". The NAT servers needs to be configured properly for this to work.

Parameters:
address - the address this peer is reachable from the public network
exclusive - FIXME: What does this do exactly?

setHttpPublicAddress

public void setHttpPublicAddress(java.lang.String address)
Sets the HTTP address the peer is reachable from the public network. This is needed if the peer is not directly reachable on its own address from the public network but is behind a NAT. It is the address that other peers can use to reach the peer configured by this config. The value is in the form host:port, e.g. "209.128.126.120:9700". The NAT servers needs to be configured properly for this to work.

Parameters:
address - the address this peer is reachable from the public network

getHttpPublicAddress

public java.lang.String getHttpPublicAddress()
Returns the public address under which the peer is reachable by peers from the public network. This can differ from the interface the peer is listening for messages. Most of the time this will be the address of the public address of a NAT server, that forwards requests to a peer in the local network.

Returns:
a TCP address or null if this address is not explicitely set, that means it is set to the same value as the HTTP interface address (see getHttpInterfaceAddress()). FIXME: Correct?

setHttpPublicAddressExclusive

public void setHttpPublicAddressExclusive(boolean exclusive)
FIXME documentation

Parameters:
exclusive -

isHttpPublicAddressExclusive

public boolean isHttpPublicAddressExclusive()
FIXME documentation

Returns:

setRelayEnabled

public void setRelayEnabled(boolean enabled)
Enables or disables Relay support.

Parameters:
enabled - true to enable Relay support

isRelayEnabled

public boolean isRelayEnabled()
Returns if Relay support is enabled

Returns:
true if Relay support is enabled

setRelayServer

public void setRelayServer(boolean enabled)
If true then this peer will act as a relay server.

Parameters:
enabled - If true then this peer will act as a relay server.

isRelayServer

public boolean isRelayServer()
Returns if the peer acts as a relay server.

Returns:
true if the peer shall act as a relay server.

setRelayClient

public void setRelayClient(boolean enabled)
If true then this peer will act as a relay client.

Parameters:
enabled - If true then this peer will act as a relay client.

isRelayClient

public boolean isRelayClient()
Returns if the peer acts as a relay client.

Returns:
true if the peer shall act as a relay client, that means if it can send messages to other peers through a relay server.

addRelaySeedingURI

public void addRelaySeedingURI(java.net.URI seedURI)
Adds a relay seeding URI. The URI should return a list of relay peers endpoint addresses separated by line breaks. For an example try http://rdv.jxtahosts.net/cgi-bin/relays.cgi?2

Parameters:
seedURI - relay service seeding URI
Throws:
java.lang.IllegalArgumentException - if parameter seedURI is null

getRelayMaxClients

public int getRelayMaxClients()
Sets the maximum number of relay clients of this peer.

Parameters:
relayMaxClients - -1 means the default maximum of relay client is used, which currently is set to 150.
Throws:
java.lang.IllegalArgumentException - if (relayMaxClients != -1) && (relayMaxClients <= 0).
See Also:
FIXME

setRelayMaxClients

public void setRelayMaxClients(int relayMaxClients)
Sets the maximum number of relay clients of this peer.

Parameters:
relayMaxClients - -1 means the default maximum of relay client is used, which currently is set to 150.
Throws:
java.lang.IllegalArgumentException - if (relayMaxClients != -1) && (relayMaxClients <= 0).
See Also:
FIXME

addRelaySeedingURI

public void addRelaySeedingURI(java.lang.String seedURIStr)
Sets the new RelayService seeding URI as a string.

A seeding URI (when read) is expected to provide a list of physical endpoint address to relay peers

Parameters:
seedURIStr - the new RelayService seed URI as a string

addSeedRelay

public void addSeedRelay(java.net.URI seedURI)
Adds a relay service peer seed address

A relay service seed is defined as a physical endpoint address. Examples are http://192.168.1.1:9700 or tcp://192.168.1.1:9701).

Parameters:
seedURI - the relay seed URI to be added to the list of peer seen endpoints.

isUseOnlyRelaySeeds

public boolean isUseOnlyRelaySeeds()
FIXME documentation


setUseOnlyRelaySeeds

public void setUseOnlyRelaySeeds(boolean useOnlyRelaySeeds)
Determines whether to restrict RelayService leases to those defined in the seed list that was set by addRelaySeedingURI(String) or addSeedRelay(URI).

FIXME: Is this correct? See Javadoc of relayConfig.setUseOnlySeeds(...).

Parameters:
useOnlyRelaySeeds - restrict RelayService lease to seed list

setRendezvousEnabled

public void setRendezvousEnabled(boolean enabled)
Enables or disables the Rendezvous support.

Parameters:
enabled - true to enable Rendezvous support

isRendezvousEnabled

public boolean isRendezvousEnabled()
Returns if Rendezvous support is enabled

Returns:
true if Rendezvous support is enabled

setRendezvousConfig

public void setRendezvousConfig(NetworkConfigurator.RendezvousConfig rendezvousConfig)

getRendezvousConfig

public NetworkConfigurator.RendezvousConfig getRendezvousConfig()

getRendezvousMaxClients

public int getRendezvousMaxClients()
FIXME documentation

Returns:

setRendezvousMaxClients

public void setRendezvousMaxClients(int rdvMaxClients)
Sets the maximum number of rendezvous clients of this peer.

Parameters:
rdvMaxClients - -1 means the default maximum of rendezvous client is used, which currently is set to 150.
Throws:
java.lang.IllegalArgumentException - if (relayMaxClients != -1) && (relayMaxClients <= 0).
See Also:
FIXME:

isUseOnlyRendezvousSeeds

public boolean isUseOnlyRendezvousSeeds()
FIXME documentation

Returns:

setUseOnlyRendezvousSeeds

public void setUseOnlyRendezvousSeeds(boolean useOnlyRendezvouSeeds)
Determines whether to restrict RendezvousService leases to those defined in the seed list that was set by #addRendezvousSeedingURI(URI) or addSeedRendezvous(URI).

FIXME: Is this correct? See Javadoc of rdvConfig.setUseOnlySeeds(...).

Parameters:
useOnlyRendezvouSeeds - restrict RendezvousService lease to seed list

addSeedRendezvous

public void addSeedRendezvous(java.net.URI seedURI)
Adds rendezvous peer seed, physical endpoint address

A RendezVousService seed is defined as a physical endpoint address Examples are http://192.168.1.1:9700 or tcp://192.168.1.1:9701).

Parameters:
seedURI - the rendezvous seed URI to add to the list of peer seed endpoints.

addRdvSeedingURI

public void addRdvSeedingURI(java.lang.String seedURIStr)
Adds a rendezvous seeding URI. Equivalent to: addRdvSeedingURI(URI.create(seedURIStr)). The URI should return a list of rendezvous peer endpoint addresses in the form of an URI separated by line breaks. For an example try http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2

Parameters:
seedURI - rendezvous service seeding URI
Throws:
java.lang.IllegalArgumentException - if parameter seedURI is null

addRdvSeedingURI

public void addRdvSeedingURI(java.net.URI seedURI)
Adds a rendezvous seeding URI. The URI should return a list of rendezvous peer endpoint addresses in the form of an URI separated by line breaks. For an example try http://rdv.jxtahosts.net/cgi-bin/rendezvous.cgi?2

Parameters:
seedURI - rendezvous service seeding URI
Throws:
java.lang.IllegalArgumentException - if parameter seedURI is null

setRelaySeedURIs

public void setRelaySeedURIs(java.util.List<java.lang.String> seedURIs)
Sets the List relaySeeds represented as Strings

A RelayService seed is defined as a physical endpoint address

e.g. http://192.168.1.1:9700, or tcp://192.168.1.1:9701

Parameters:
seedURIs - the List relaySeeds represented as Strings

setRendezvousSeedURIs

public void setRendezvousSeedURIs(java.util.List<java.lang.String> seedURIs)
Sets the List of RendezVousService seeds represented as Strings

A RendezvousService seed is defined as a physical endpoint address

e.g. http://192.168.1.1:9700, or tcp://192.168.1.1:9701

Parameters:
seedURIs - the List rendezvousSeeds represented as Strings

setPrincipal

public void setPrincipal(java.lang.String principal)
Sets the Principal for the peer root certificate. If principal or password is set to null, no new PSE advertisement will be created.

Parameters:
principal - the new principal value

getPrincipal

public java.lang.String getPrincipal()
Gets the Principal for the peer root certificate. Note that if this NetworkConfigurator instance was created by loading it from a PlatfromConfig this will return null, even if the PlatfromConfig contained a PSE configuration.

Returns:
principal if a principal is set, null otherwise

setPassword

public void setPassword(java.lang.String password)
Sets the password used to sign the private key of the root certificate. If principal or password is set to null, no new PSE advertisement will be created.

Parameters:
password - the new password value

getPassword

public java.lang.String getPassword()
Gets the password used to sign the private key of the root certificate. Note that if this NetworkConfigurator instance was created by loading it from a PaltfromConfig this will return null, even if the PlatfromConfig contained a PSE configuration (The password can't be read once it was set).

Returns:
password if a password is set, null otherwise

setProxyEnabled

public void setProxyEnabled(boolean enable)
Enables or disables the Proxy support.

Parameters:
enabled - true to enable Proxy support

isProxyEnabled

public boolean isProxyEnabled()
Returns if Proxy support is enabled

Returns:
true if Proxy support is enabled

setHome

public void setHome(java.io.File home)
Deprecated. use NetPeerGroupFactory.NetPeerGroupFactory(ConfigParams, URI) instead.

Set the current directory for configuration and cache persistent store

(default is $CWD/.jxta)

Simple example :
  
 //Create an application home
 File appHome = new File(System.getProperty("JXTA_HOME", ".cache"));
 //Create an instance home under the application home
 File instanceHome = new File(appHome, instanceName);
 jxtaConfig.setHome(instanceHome);
 
 

Parameters:
home - the new home value
See Also:
getHome()

getHome

public java.io.File getHome()
Returns the current directory for configuration and cache persistent store

Returns:
Returns the current home directory
See Also:
setHome(java.io.File)

getStoreHome

public static java.net.URI getStoreHome()
Returns the location which will serve as the parent for all stored items used by JXTA. This method is intended for use by PeerGroup implementations and is not intended for use by applications. Applications and services should use the PeerGroup method with the same name.

Returns:
The location which will serve as the parent for all stored items used by JXTA.
See Also:
PeerGroup.getStoreHome()

setInfrastructureID

public void setInfrastructureID(net.jxta.id.ID id)
Deprecated. 

Sets the ID which will be used for new net peer group instances.

By Setting an alternate infrastructure PeerGroup ID (aka NetPeerGroup), it prevents heterogeneous infrstructure PeerGroups from intersecting.

This is highly recommended practice foapplicaiton deployment

Parameters:
id - the new infrastructure PeerGroupID as a string
See Also:
PeerGroupFactory.setNetPGID(net.jxta.peergroup.PeerGroupID)

setInfrastructureID

public void setInfrastructureID(java.lang.String idStr)
Deprecated. 

Sets the ID which will be used for new net peer group instances.

By Setting an alternate infrastructure PeerGroup ID (aka NetPeerGroup), it prevents heterogeneous infrstructure PeerGroups from intersecting.

This is highly recommended practice foapplicaiton deployment

Parameters:
idStr - the new infrastructure PeerGroupID as a string
See Also:
PeerGroupFactory.setNetPGID(net.jxta.peergroup.PeerGroupID)

setInfrastructureName

public void setInfrastructureName(java.lang.String name)
Deprecated. 

Sets the infrastructure PeerGroup name meta-data

Parameters:
name - the Infrastructure PeerGroup name
See Also:
PeerGroupFactory.setNetPGName(java.lang.String)

setInfrastructureDescription

public void setInfrastructureDescription(java.lang.String description)
Deprecated. 

Sets the infrastructure PeerGroup description meta-data

Parameters:
description - the infrastructure PeerGroup description
See Also:
PeerGroupFactory.setNetPGDesc(java.lang.String)

load

public void load(java.net.URI uri)
          throws java.io.IOException
Deprecated. use te static loadPlatformConfig(URI) instead

Convenience method to load a PlatformConfig from disk and transform it into a NetworkCongigurator directly. Equivalent to:
                      ConfigParams platfromConfig = .... // load PlatfromConfig from disk
                      networkConfigurator.load(platfromConfig);
 

Parameters:
uri - the URI to PlatformConfig file
Throws:
java.io.IOException - If the PlatformConfig file could not be loaded
java.lang.IllegalArgumentException - if the URI is null . As of now it also throws an exception if the URI can't be transformed into an URL. But this is probably stupid (FIXME)

load

public void load()
          throws java.io.IOException,
                 javax.security.cert.CertificateException
Deprecated. Use the static method loadPlatformConfig(URI) instead

Load a configuration from the specified store home uri

e.g. file:/export/dist/EdgeConfig.xml, e.g. http://configserver.net/configservice?Edge

Throws:
java.io.IOException - if an i/o error occurs
javax.security.cert.CertificateException - if the MemebershipService is invalid

exists

public boolean exists()
Deprecated. 

Returns true if a PlatformConfig file exist under getHome()/PlatfromConfig

Returns:
true if a PlatformConfig file exist under store home

loadPlatformConfig

public static NetworkConfigurator loadPlatformConfig(net.jxta.protocol.ConfigParams platformConfig)
Creates a NetworkConfgurator instance that takes the values from the given platform configuration.

Parameters:
platformConfig - the platform config that shall be wrapped by this network configurator
Returns:
the network configurator instance that represents the values loaded from the platform config. This new instance can be used to modify the loaded PlatfromConfig and to save it again later.
See Also:
#loadPlatfromConfig(URI)

loadPlatformConfig

public static NetworkConfigurator loadPlatformConfig(java.net.URI platfromConfig)
                                              throws java.io.IOException
Creates a NetworkConfgurator instance that takes the values from the given platform configuration.

Parameters:
platformConfig - the platform config file that shall be wrapped by this network configurator
Returns:
the network configurator instance that represents the values loaded from the platform config. This new instance can be used to modify the loaded PlatfromConfig and to save it again later.
Throws:
java.io.IOException
See Also:
#loadPlatfromConfig(ConfigParams)

load

public void load(net.jxta.protocol.ConfigParams platformConfig)
Deprecated. use static load methos #loadPlatfromConfig(ConfigParams) instead

Resets this NetworkConfgurator instance to the values of the given platform configuration.

Parameters:
platformConfig - the platform config that shall be loaded
See Also:
load(URI)

save

public void save(java.io.File file)
          throws java.io.IOException
Generates a PlatformConfig (with getPlatformConfig()) and saves it in the file given by parameter file.

Parameters:
file - the file the PlatfromConfig should be saved to.
Throws:
java.io.IOException - If the file could not be saved to the given file (This also happens if the the path does not yet exist).
See Also:
getPlatformConfig(), load(URI)

save

public void save()
          throws java.io.IOException
Deprecated. use save(File) instead.

Persists a PlatformConfig advertisement under getHome()+"/PlaformConfig"

Home may be overridden by a call to setHome()

Throws:
java.io.IOException - if an i/o error occurs
See Also:
load(java.net.URI)

savePlatformConfig

public void savePlatformConfig(java.io.OutputStream out)
                        throws java.io.IOException
Generates a PlatformConfig (with getPlatformConfig()) and streams it to the given output stream. UTF-8 is used for the encoding.

Parameters:
out - the output stream to stream the platform config file to.
Throws:
java.io.IOException

getPlatformConfig

public net.jxta.protocol.ConfigParams getPlatformConfig()
Returns the PlatformConfig (as ConfigParams) that can be used in one of the NetPeerGroupFactory constructors.

Returns:
a configuration for the JXTA network infrastructure.

addPropertyChangeListener

public final void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public final void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed

addPropertyChangeListener

public final void addPropertyChangeListener(java.lang.String propertyName,
                                            java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list for a specific property. The specified property may be user-defined.

Parameters:
propertyName - one of the property names listed above
listener - the PropertyChangeListener to be added

removePropertyChangeListener

public final void removePropertyChangeListener(java.lang.String propertyName,
                                               java.beans.PropertyChangeListener listener)
Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class.

If listener is null, no exception is thrown and no action is performed.

Parameters:
propertyName - a valid property name
listener - the PropertyChangeListener to be removed

hasChanges

public boolean hasChanges()
Returns a boolean value indicating whether one or more values (fields) have been changed since either loading or the last save.

Returns:
True, if there are changes, otherwise false.