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

All Superinterfaces:
DiscoveredData

public interface DHCPData
extends DiscoveredData

The DHCPData encapsulates data extracted from a CNR dictionary by the BAC CNR extension point. The command consists of: dictionary, option name, and option value. The option value can consist of either single value (String or byte[]), or multiple values (String[], byte[][]).

See Also:
DHCPDict

Method Summary
 boolean equalsOption(DHCPData data)
          Determines if another DHCPData object references the same dictionary and option name.
 boolean equalsOption(DHCPDict dictionary, String optionName)
          Determines if dictionary/option name data matches this DHCPData object This is support method for simplifying the iteration/comparison of DHCPData objects.
 DHCPDict getDictionary()
          Return the dictionary to which the command is to be applied.
 String getOptionName()
          Return the option name.
 Object getOptionObject()
          Return the option value as an Object.
 String getOptionValue()
          Return the single-valued option value as a String.
 com.cisco.provisioning.cpe.base.net.dhcp.DhcpOption getOptionValueAsDhcpOption()
          Return the singled-valued option value as a DhcpOption.
 com.cisco.provisioning.cpe.base.net.dhcp.DhcpOption getOptionValueAsDhcpOption(com.cisco.provisioning.cpe.base.net.dhcp.DhcpOptionDefinitionRegistry registry)
          Return the singled-valued option value as a DhcpOption.
 byte[] getOptionValueBytes()
          Return the singled-valued option value as bytes.
 String[] getOptionValues()
          Return the multi-valued option value.
 byte[][] getOptionValuesBytes()
          Return the multi-valued option value.
 boolean isMultivalued()
          Indicate whether the DHCP option is single-valued or multi-valued.
 boolean isString()
          Indicate whether the DHCP option is a string value (either single or multi-valued), or a binary value.
 String toStringOptionValue()
          Return a string containing the DHCPData option value in human-readable form.
 String toStringOptionValue(com.cisco.provisioning.cpe.base.net.dhcp.DhcpOptionDefinitionRegistry registry)
          Return a string containing the DHCPData option value in human-readable form.
 String toStringOptionValueRaw()
          Return a string containing the DHCPData option value.
 
Methods inherited from interface com.cisco.provisioning.cpe.extensions.services.DiscoveredData
getDiscoveredDataType
 

Method Detail

getDictionary

DHCPDict getDictionary()
Return the dictionary to which the command is to be applied.

Returns:
the dictionary to which the command is to be applied.
See Also:
DHCPDict

getOptionName

String getOptionName()
Return the option name.

Returns:
the option name

getOptionObject

Object getOptionObject()
Return the option value as an Object.

Returns:
the option value as an Object.

getOptionValue

String getOptionValue()
Return the single-valued option value as a String.

Returns:
the single-valued option value as a String.

getOptionValueBytes

byte[] getOptionValueBytes()
Return the singled-valued option value as bytes.

Returns:
the singled-valued option value as bytes.

getOptionValueAsDhcpOption

com.cisco.provisioning.cpe.base.net.dhcp.DhcpOption getOptionValueAsDhcpOption()
Return the singled-valued option value as a DhcpOption.

Returns:
the singled-valued option value as DhcpOption, or null if option value is not DHCP option

getOptionValueAsDhcpOption

com.cisco.provisioning.cpe.base.net.dhcp.DhcpOption getOptionValueAsDhcpOption(com.cisco.provisioning.cpe.base.net.dhcp.DhcpOptionDefinitionRegistry registry)
Return the singled-valued option value as a DhcpOption.

Parameters:
registry - the DHCP Option Registry
Returns:
the singled-valued option value as DhcpOption, or null if option value is not DHCP option

getOptionValues

String[] getOptionValues()
Return the multi-valued option value. If the option value is single- valued, an array is created with the single value added.

Returns:
the multi-valued option value as String array

getOptionValuesBytes

byte[][] getOptionValuesBytes()
Return the multi-valued option value. If the option value is single- valued, an array is created with the single value added.

Returns:
the multi-valued option value as array of byte arrays

isMultivalued

boolean isMultivalued()
Indicate whether the DHCP option is single-valued or multi-valued. This is useful during iteration of a list of DHCPData objects.

Returns:
true if multi-valued option or false if single-valued option

isString

boolean isString()
Indicate whether the DHCP option is a string value (either single or multi-valued), or a binary value.

Returns:
true if the option value is string based.

equalsOption

boolean equalsOption(DHCPData data)
Determines if another DHCPData object references the same dictionary and option name. This is support method for simplifying the iteration/comparison of DHCPData objects. This is identical to the equals() method except that it does not compare the option value.

Parameters:
data - the DHCPData object to compare
Returns:
true if DHCPData object refers to the same option

equalsOption

boolean equalsOption(DHCPDict dictionary,
                     String optionName)
Determines if dictionary/option name data matches this DHCPData object This is support method for simplifying the iteration/comparison of DHCPData objects. The functionality is identical to the equals() method except that it does not compare the option value.

Parameters:
dictionary - to compare for equality
optionName - to compare for equality
Returns:
true if parameters refers to this

toStringOptionValue

String toStringOptionValue()
Return a string containing the DHCPData option value in human-readable form. This is used for logging and tracing where a human-readable form of the option value is more desirable. The string output is equivalent to the "value=" content of toString().

Returns:
String containing human-readable option value

toStringOptionValue

String toStringOptionValue(com.cisco.provisioning.cpe.base.net.dhcp.DhcpOptionDefinitionRegistry registry)
Return a string containing the DHCPData option value in human-readable form. This is used for logging and tracing where a human-readable form of the option value is more desirable. The string output is equivalent to the "value=" content of toString().

Parameters:
registry - the DHCP Option Registry
Returns:
String containing human-readable option value

toStringOptionValueRaw

String toStringOptionValueRaw()
Return a string containing the DHCPData option value. If the underlying value is a string, it will be returned as is. If it is a byte[], it will be converted to a hex string.

Returns:
a string containing the DHCPData option value.