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


public interface OptionValue

DOCSIS option value. A DOCSIS option value represents a DOCSIS option that is part of a DOCSIS configuration. There are two kinds of option values: well-defined option values and custom option values.

Well-defined option values are associated with a specific option description. That option description provides the necessary encoding and validation methods for constructing and validating the option value. CSRC provides option descriptions for all options in the DOCSIS 1.0 and DOCSIS 1.1 specifications, as well as option descriptions for a portion of Cisco vendor-specific options.

Custom option values are not associated with an option description. Custom option values are instead associated with a specific option syntax (e.g., hex, ascii, ipaddress). Custom options (with the allowable option syntax) can be added to a CSRC DOCSIS configuration without revising the CSRC option description database.

Option values are composite objects: they can represent single option values (e.g., option 3) or they can represent a hiearchy of sub-option values (e.g., option 4, 4.1, 4.2, etc). To build up a sub-option value hierarchy first create an option value instance for the top level option (e.g., 4) and then use the add() method to add the sub-options (e.g., 4.1, 4.2, etc) to the top level option. The getTLV() method takes care of constructing the top level option TLV from the sub-option TLV's.

Option values are created by calling the OptionManager singleton createOptionValue() methods rather than use the new operator.

See Also:
OptionDesc, OptionSyntax

Method Summary
 void add(OptionValue optionValue)
          Add sub-option option value.
 int getMajorOptionNum()
          Get the major option number value.
 OptionDesc getOptionDesc()
          Get the option description associated with this option value.
 int getOptionNum()
          Get the option number value.
 String getOptionNumString()
          Get the fully qualified option number.
 TLV getTLV()
          Get the binary encoding for this option value.
 boolean isCompound()
          Determines if this option value is a compound option value.
 boolean isTopLevel()
          Determine whether this option is a top level option.
 void setOptionInstCount(int count)
          Set the instance count on a multivalue option
 

Method Detail

add

void add(OptionValue optionValue)
Add sub-option option value. The option value argument must be of the same top-level parent (have the same major option number as the parent) and the argument must be a sub-option (not a top-level option).

Parameters:
optionValue - sub-option value to add
Throws:
IllegalArgumentException

getOptionNumString

String getOptionNumString()
Get the fully qualified option number.

Returns:
String option number

getMajorOptionNum

int getMajorOptionNum()
Get the major option number value.

Returns:
integer major option number

getOptionNum

int getOptionNum()
Get the option number value.

Returns:
integer option number

getTLV

TLV getTLV()
           throws InvalidTLVException
Get the binary encoding for this option value. If the option value is a top-level option with no sub-options the TLV passed to the constructor is returned. If the the option value contains sub-options then the TLV encoding of the top-level is generated from the aggregrate of the sub-options TLV's.

Returns:
TLV encoding for option value
Throws:
InvalidTLVException

getOptionDesc

OptionDesc getOptionDesc()
Get the option description associated with this option value. May return null if the option value is custom.

Returns:
option description or null if custom option value

isCompound

boolean isCompound()
Determines if this option value is a compound option value. Compound option values have sub-options.

Returns:
true if sub-options present on option value

isTopLevel

boolean isTopLevel()
Determine whether this option is a top level option.

Returns:
true if top level, otherwise false

setOptionInstCount

void setOptionInstCount(int count)
Set the instance count on a multivalue option

Parameters:
count - set instance count to.