com.cisco.provisioning.cpe.extensions.configuration
Interface DHCPConfig


public interface DHCPConfig

The DHCPConfig interface defines the methods that are used to mainpulate the DHCP configuration data associated with a device. The DHCPConfig contains two distinct categories of information: the operations that are to be performed by the CNR extension point (e.g., put, remove, or get), and the inform data which is additional data that can be used by the provisioning group.

The options are grouped into "dictionaries" that correspond to the CNR/DHCP extension dictionaries: request, response, environment, pre-dns-environment, and inform. The inform dictionary is a BAC specific dictionary used to communicate information to/from the BAC CNR extension point.

The DHCP options are identified by a String option name and have a corresponding value that can be either a single-valued (String or binary BLOB byte[]) or multivalued (a List of Strings). The option names for the request, response, and environment dictionaries must conform to the CNR/DHCP option name syntax as defined in the Network Registrar CLI Reference Guide, Appendix D.

See Also:
DHCPDict

Method Summary
 void addCommand(DHCPCmd command)
          Add the given DHCPCmd to the list of operations to perform.
 boolean containsCommand(DHCPCmd command)
          Search the list of operations to perform for the given operation.
 boolean containsCommandForOption(DHCPDict dictionary, CNRNames optionName)
          Return true if the list of operations to perform contains an operation that operates on the specified option, otherwise false is returned.
 boolean containsCommandForOption(DHCPDict dictionary, String optionName)
          Return true if the list of operations to perform contains an operation that operates on the specified option, otherwise false is returned.
 List<DHCPCmd> getCommandList(CNRExtPt extension)
          Return an unmodifiable command list.
 com.cisco.bac.type.DeviceIdentifier getDeviceID()
          Get the device ID for this DHCP configuration.
 String getInformOption(String optionName)
          Get a property from the INFORM dictionary.
 void removeCommand(DHCPCmd command)
          Remove the given DHCPCmd from the list of operations to perform.
 void setInformOption(String optionName, String optionValue)
          Add a property to the INFORM dictionary.
 

Method Detail

getDeviceID

com.cisco.bac.type.DeviceIdentifier getDeviceID()
Get the device ID for this DHCP configuration.

Returns:
device ID

addCommand

void addCommand(DHCPCmd command)
Add the given DHCPCmd to the list of operations to perform.

Parameters:
command - the operation to add
Throws:
IllegalArgumentException - if the given command is null.
FeatureNotEnabledException - if this DHCP configuration will be sent to servers running older versions of BPR that do not support the features being used.

removeCommand

void removeCommand(DHCPCmd command)
Remove the given DHCPCmd from the list of operations to perform.

Parameters:
command - the DHCP command operation to remove

containsCommand

boolean containsCommand(DHCPCmd command)
Search the list of operations to perform for the given operation. If found return true, otherwise return false.

Parameters:
command - the DHCP command operation to search for
Returns:
true if command found

containsCommandForOption

boolean containsCommandForOption(DHCPDict dictionary,
                                 CNRNames optionName)
Return true if the list of operations to perform contains an operation that operates on the specified option, otherwise false is returned.

Parameters:
dictionary - The dictionary to restrict the search to.
optionName - The name of the option to search for.
Returns:
True if operations for the specified option in the specified dictionary are present.

containsCommandForOption

boolean containsCommandForOption(DHCPDict dictionary,
                                 String optionName)
Return true if the list of operations to perform contains an operation that operates on the specified option, otherwise false is returned.

Parameters:
dictionary - The dictionary to restrict the search to.
optionName - The name of the option to search for.
Returns:
True if operations for the specified option in the specified dictionary are present.

getCommandList

List<DHCPCmd> getCommandList(CNRExtPt extension)
Return an unmodifiable command list. It is recommended that the list be synchronized during iterations if it is possible for commands to be added or removed during iteration. Use of the List get() method will result in better performance that using an iterator.

Parameters:
extension - The CNR extension point for which commands will execute
Returns:
unmodifiable command list of DHCPCmd instances
See Also:
CNRExtPt

getInformOption

String getInformOption(String optionName)
Get a property from the INFORM dictionary. If the option name is not present in the dictionary then a null is returned.

Parameters:
optionName - the option name
Returns:
the option value corresponding to the option name
Throws:
IllegalArgumentException - if null option name specified

setInformOption

void setInformOption(String optionName,
                     String optionValue)
Add a property to the INFORM dictionary. If the option already exists the current option value is replaced with the new option value.

Parameters:
optionName - the option name
optionValue - the option value
Throws:
IllegalArgumentException - if any of the input parameters are null