org.opennms.netmgt.config.dhcpd
Class DhcpdConfiguration

java.lang.Object
  extended by org.opennms.netmgt.config.dhcpd.DhcpdConfiguration
All Implemented Interfaces:
Serializable

public class DhcpdConfiguration
extends Object
implements Serializable

Top-level element for the dhcpd-configuration.xml configuration file.

Version:
$Revision$ $Date$
See Also:
Serialized Form

Constructor Summary
DhcpdConfiguration()
           
 
Method Summary
 void deletePort()
           
 String getExtendedMode()
          Returns the value of field 'extendedMode'.
 String getMacAddress()
          Returns the value of field 'macAddress'.
 String getMyIpAddress()
          Returns the value of field 'myIpAddress'.
 int getPort()
          Returns the value of field 'port'.
 String getRequestIpAddress()
          Returns the value of field 'requestIpAddress'.
 boolean hasPort()
          Method hasPort.
 boolean isValid()
          Method isValid.
 void marshal(ContentHandler handler)
           
 void marshal(Writer out)
           
 void setExtendedMode(String extendedMode)
          Sets the value of field 'extendedMode'.
 void setMacAddress(String macAddress)
          Sets the value of field 'macAddress'.
 void setMyIpAddress(String myIpAddress)
          Sets the value of field 'myIpAddress'.
 void setPort(int port)
          Sets the value of field 'port'.
 void setRequestIpAddress(String requestIpAddress)
          Sets the value of field 'requestIpAddress'.
static DhcpdConfiguration unmarshal(Reader reader)
          Method unmarshal.
 void validate()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DhcpdConfiguration

public DhcpdConfiguration()
Method Detail

deletePort

public void deletePort()

getExtendedMode

public String getExtendedMode()
Returns the value of field 'extendedMode'. The field 'extendedMode' has the following description: Set extended DHCP polling mode. When extendedMode is false (the default), the DHCP poller will send a DISCOVER and expect an OFFER in return. When extendedMode is true, the DHCP poller will first send a DISCOVER. If no valid response is received it will send an INFORM. If no valid response is received it will then send a REQUEST. OFFER, ACK, and NAK are all considered valid responses in extendedMode. Caution on usage: If in extended mode, the time required to complete the poll for an unresponsive node is increased by a factor of 3. Thus it is a good idea to limit the number of retries to a small number.

Returns:
the value of field 'ExtendedMode'.

getMacAddress

public String getMacAddress()
Returns the value of field 'macAddress'. The field 'macAddress' has the following description: Ethernet MAC address used as the client MAC address in DHCP DISCOVER packets sent by OpenNMS. The MAC address is set to 00:06:0D:BE:9C:B2 in the default configuration file.

Returns:
the value of field 'MacAddress'.

getMyIpAddress

public String getMyIpAddress()
Returns the value of field 'myIpAddress'. The field 'myIpAddress' has the following description: IP address used as the relay IP address in DHCP DISCOVER packets sent by OpenNMS. Setting this attribute to "broadcast" places the DHCP poller Setting this attribute places the DHCP poller in "relay" mode instead of the default "broadcast" mode. In "relay" mode, the DHCP server being polled will unicast its responses directly back to the specified ip address rather than broadcasting its responses. This allows DHCP servers to be polled even though they are not on the same subnet as the OpenNMS server, and without the aid of an external relay. This is usually set to the IP address of the OpenNMS server.

Returns:
the value of field 'MyIpAddress'.

getPort

public int getPort()
Returns the value of field 'port'. The field 'port' has the following description: TCP port number used for internal communication within OpenNMS between the DHCP poller and other OpenNMS daemons. The port is set to 5818 in the default configuration file.

Returns:
the value of field 'Port'.

getRequestIpAddress

public String getRequestIpAddress()
Returns the value of field 'requestIpAddress'. The field 'requestIpAddress' has the following description: Set the IP address to be requested in DHCP REQUEST queries. This attribute is only used when the extendedMode attribute is set to "true". If an IP address is specified, it will be requested in the query. If the string "targetHost" is specified, the DHCP server's own ip address will be requested. Since a well-managed server will probably not respond to a request for its own IP address, this parameter can also be set to the string "targetSubnet". This is similar to "targetHost", except the last octet of the DHCP server's IP address is incremented or decremented by 1 to obtain an IP address that is on the same subnet. The resulting address will not be on the same subnet if the DHCP server's subnet length is 31 or 32. Otherwise, the algorithm used should be reliable.

Returns:
the value of field 'RequestIpAddress'.

hasPort

public boolean hasPort()
Method hasPort.

Returns:
true if at least one Port has been added

isValid

public boolean isValid()
Method isValid.

Returns:
true if this object is valid according to the schema

marshal

public void marshal(Writer out)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
out -
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

marshal

public void marshal(ContentHandler handler)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Parameters:
handler -
Throws:
IOException - if an IOException occurs during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling

setExtendedMode

public void setExtendedMode(String extendedMode)
Sets the value of field 'extendedMode'. The field 'extendedMode' has the following description: Set extended DHCP polling mode. When extendedMode is false (the default), the DHCP poller will send a DISCOVER and expect an OFFER in return. When extendedMode is true, the DHCP poller will first send a DISCOVER. If no valid response is received it will send an INFORM. If no valid response is received it will then send a REQUEST. OFFER, ACK, and NAK are all considered valid responses in extendedMode. Caution on usage: If in extended mode, the time required to complete the poll for an unresponsive node is increased by a factor of 3. Thus it is a good idea to limit the number of retries to a small number.

Parameters:
extendedMode - the value of field 'extendedMode'.

setMacAddress

public void setMacAddress(String macAddress)
Sets the value of field 'macAddress'. The field 'macAddress' has the following description: Ethernet MAC address used as the client MAC address in DHCP DISCOVER packets sent by OpenNMS. The MAC address is set to 00:06:0D:BE:9C:B2 in the default configuration file.

Parameters:
macAddress - the value of field 'macAddress'.

setMyIpAddress

public void setMyIpAddress(String myIpAddress)
Sets the value of field 'myIpAddress'. The field 'myIpAddress' has the following description: IP address used as the relay IP address in DHCP DISCOVER packets sent by OpenNMS. Setting this attribute to "broadcast" places the DHCP poller Setting this attribute places the DHCP poller in "relay" mode instead of the default "broadcast" mode. In "relay" mode, the DHCP server being polled will unicast its responses directly back to the specified ip address rather than broadcasting its responses. This allows DHCP servers to be polled even though they are not on the same subnet as the OpenNMS server, and without the aid of an external relay. This is usually set to the IP address of the OpenNMS server.

Parameters:
myIpAddress - the value of field 'myIpAddress'.

setPort

public void setPort(int port)
Sets the value of field 'port'. The field 'port' has the following description: TCP port number used for internal communication within OpenNMS between the DHCP poller and other OpenNMS daemons. The port is set to 5818 in the default configuration file.

Parameters:
port - the value of field 'port'.

setRequestIpAddress

public void setRequestIpAddress(String requestIpAddress)
Sets the value of field 'requestIpAddress'. The field 'requestIpAddress' has the following description: Set the IP address to be requested in DHCP REQUEST queries. This attribute is only used when the extendedMode attribute is set to "true". If an IP address is specified, it will be requested in the query. If the string "targetHost" is specified, the DHCP server's own ip address will be requested. Since a well-managed server will probably not respond to a request for its own IP address, this parameter can also be set to the string "targetSubnet". This is similar to "targetHost", except the last octet of the DHCP server's IP address is incremented or decremented by 1 to obtain an IP address that is on the same subnet. The resulting address will not be on the same subnet if the DHCP server's subnet length is 31 or 32. Otherwise, the algorithm used should be reliable.

Parameters:
requestIpAddress - the value of field 'requestIpAddress'

unmarshal

public static DhcpdConfiguration unmarshal(Reader reader)
                                    throws org.exolab.castor.xml.MarshalException,
                                           org.exolab.castor.xml.ValidationException
Method unmarshal.

Parameters:
reader -
Returns:
the unmarshaled org.opennms.netmgt.config.dhcpd.DhcpdConfiguration
Throws:
org.exolab.castor.xml.MarshalException - if object is null or if any SAXException is thrown during marshaling
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema

validate

public void validate()
              throws org.exolab.castor.xml.ValidationException
Throws:
org.exolab.castor.xml.ValidationException - if this object is an invalid instance according to the schema


Copyright © 2008. All Rights Reserved.