Peer locator v1.0

com.unet.warmachine.peerlocator
Class Configuration

java.lang.Object
  |
  +--com.unet.warmachine.peerlocator.Configuration

public class Configuration
extends java.lang.Object

This is a simple data object that configures agent system settings at startup. An instance of this class should be created by client code, which is then read by the agent and discarded. Subsequent changes are ignored.


Constructor Summary
Configuration(java.lang.String agentName)
          Constructor.
 
Method Summary
 java.lang.String getAgentName()
          Returns agent name.
 int getConnectTimeout()
          Returns connection timeout.
 int getInactiveTimeout()
          Returns connection inactive timeout.
 int getMaxMemberConnections()
          Returns maximum no of connections that may be open per unlocated member when searching.
 int getMaxMemberSearches()
          Returns maximum no of member searches that may be running at any one time.
 int getSearchRetryWait()
          Returns search retry wait.
 java.lang.String getStatus()
          Returns initial status value of agent.
 boolean getUseConfigIPAddress()
          Whether agent should use configured IP address, rather than choose an arbitary local address of the appropriate type.
 boolean getUsePrivateNetwork()
          Whether agent should use an IP address reserved for private networks as the local address, rather than a global, IANA assigned address.
 void setConnectTimeout(int value)
          Sets connection timeout.
 void setInactiveTimeout(int value)
          Sets connection inactive timeout.
 void setMaxMemberConnections(int value)
          Sets maximum no of connections that may be open per unlocated member when searching.
 void setMaxMemberSearches(int value)
          Sets maximum no of member searches that may be running at any one time.
 void setSearchRetryWait(int value)
          Sets search retry wait.
 void setStatus(java.lang.String value)
          Sets initial status value.
 void setUseConfigIPAddress(boolean value)
          Sets whether agent should use configured IP address, rather than choose an arbitary local address of the appropriate type.
 void setUsePrivateNetwork(boolean value)
          Sets whether agent should use an IP address reserved for private networks as the local address, rather than a global, IANA assigned address.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(java.lang.String agentName)
Constructor. Defaults connect timeout to 3 seconds, connect retry wait to 5 minutes and max connections per member locator to 10.
Parameters:
agentName - Name of member in membership list.
Method Detail

getAgentName

public java.lang.String getAgentName()
Returns agent name.
Returns:
Agent name.

getStatus

public java.lang.String getStatus()
Returns initial status value of agent. This has no meaning to the agent but is expected to be used by remote clients.
Returns:
Initial status value.

setStatus

public void setStatus(java.lang.String value)
Sets initial status value. This has no meaning to the agent but is expected to be used by remote clients. This is ignored if this configuration has been passed to the agent.

getConnectTimeout

public int getConnectTimeout()
Returns connection timeout. This is the expiry time of an open socket for a connection acknowledgement message before giving up and closing it. Default is 3 seconds.
Returns:
Connection acknowledgement timeout in seconds.

setConnectTimeout

public void setConnectTimeout(int value)
Sets connection timeout. This is the expiry time of an open socket for a connection acknowledgement message before giving up and closing it. This is ignored if this configuration has been passed to the agent or value is less than 1 second.
Parameters:
value - Connection acknowledgement timeout in seconds.

getInactiveTimeout

public int getInactiveTimeout()
Returns connection inactive timeout. This is the expiry time of a connection since the last received message, including keep alive messages, before regarding it as dead, closing it and regarding the member as offline. Default is 5 minutes.
Returns:
Connection inactivity timeout in seconds.

setInactiveTimeout

public void setInactiveTimeout(int value)
Sets connection inactive timeout. This is the expiry time of a connection since the last received message, including keep alive messages, before regarding it as dead, closing it and regarding the member as offline. This is ignored if this configuration has been passed to the agent or value is less than 1 minute.
Parameters:
value - Connection inactivity timeout in seconds.

getSearchRetryWait

public int getSearchRetryWait()
Returns search retry wait. This is the sleep time after an unsuccessful search for a member before restarting the search. Default is 30 minutes.
Returns:
Search retry wait in seconds.

setSearchRetryWait

public void setSearchRetryWait(int value)
Sets search retry wait. This is the sleep time after an unsuccessful search for a member before restarting the search. This is ignored if this configuration has been passed to the agent or value is less than 1 minute.
Parameters:
value - Search retry wait in seconds.

getMaxMemberConnections

public int getMaxMemberConnections()
Returns maximum no of connections that may be open per unlocated member when searching.
Returns:
Maximum connections per unlocated member.

setMaxMemberConnections

public void setMaxMemberConnections(int value)
Sets maximum no of connections that may be open per unlocated member when searching. This is ignored if this configuration has been passed to the agent.
Parameters:
value - Maximum connections per unlocated member.
Throws:
java.lang.IllegalArgumentException - Value is less than 1.

getMaxMemberSearches

public int getMaxMemberSearches()
Returns maximum no of member searches that may be running at any one time.
Returns:
Maximum no of member searches.

setMaxMemberSearches

public void setMaxMemberSearches(int value)
                          throws java.lang.IllegalArgumentException
Sets maximum no of member searches that may be running at any one time. This is ignored if this configuration has been passed to the agent.
Parameters:
value - Maximum no of member searches.
Throws:
java.lang.IllegalArgumentException - Value is less than 1.

getUsePrivateNetwork

public boolean getUsePrivateNetwork()
Whether agent should use an IP address reserved for private networks as the local address, rather than a global, IANA assigned address. Default is false. Private IP addresses are defined by RFC 1918 as 10.*.*.*, 172.16.*.* to 172.31.*.* and 192.168.*.*.
Returns:
Whether agent should use private IP address as local address.

setUsePrivateNetwork

public void setUsePrivateNetwork(boolean value)
Sets whether agent should use an IP address reserved for private networks as the local address, rather than a global, IANA assigned address. Default is false. Private IP addresses are defined by RFC 1918 as 10.*.*.*, 172.16.*.* to 172.31.*.* and 192.168.*.*. This is ignored if this configuration has been passed to the agent.
Parameters:
value - Whether agent should use private IP address as local address.

getUseConfigIPAddress

public boolean getUseConfigIPAddress()
Whether agent should use configured IP address, rather than choose an arbitary local address of the appropriate type. See also getUsePrivateNetwork(). Multiple addresses can be assigned if more than one NIC is installed. Default is false. If set for a statically assigned IP address, the configured address must be an address assigned to the local host. If set for a dynamically assigned address, an address assigned to the local host must be within the configured range.
Returns:
Whether agent should use configured IP address.

setUseConfigIPAddress

public void setUseConfigIPAddress(boolean value)
Sets whether agent should use configured IP address, rather than choose an arbitary local address of the appropriate type. See also setUsePrivateNetwork(boolean). Multiple addresses can be assigned if more than one NIC is installed. Default is false. If set for a statically assigned IP address, the configured address must be an address assigned to the local host. If set for a dynamically assigned address, an address assigned to the local host must be within the configured range. This is ignored if this configuration has been passed to the agent.
Parameters:
value - Whether agent should use configured IP address.

Peer locator v1.0