|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.cisco.provisioning.cpe.extensions.configuration.AbstractTFTPFile
com.cisco.provisioning.cpe.extensions.configuration.DOCSISTFTPFile
public class DOCSISTFTPFile
DOCSIS TFTP file. This class provides an implementation of a TFTPFile interface for named or unamed DOCSIS files. This file provides for the ability to build a DOCSIS file dynamically by adding top-level OptionValue instances. During the generation() method the OptionValue instances are processed into a binary configuration. The mix() method provides for the dynamic mixing of a DOCSIS configuration file (TFTP Modem address, TFTP timestamp address, CMTS MIC, and CM MIC). The mix algorithm is controlled by the presence of device-specific properties in either the DOCSISTFTPFile properties map or global properties set in the map given on the mix() method invocation.
The properties that influence the mixing are defined in the Prov API constants interface DocsisDefaultsKeys:
Multiple constructors are provided, but the expected use case is that the null-arg constructor is used, followed by multiple calls to the add() method to build the DOCSISTFTPFile dynamically.
AbstractTFTPFile,
TFTPFile,
OptionValue,
Serialized Form| Constructor Summary | |
|---|---|
DOCSISTFTPFile()
No-arg constructor. |
|
DOCSISTFTPFile(byte[] fileBytes)
Use this constructor when no filename tag is used and the configuration file bytes is known at construction time. |
|
DOCSISTFTPFile(String filename)
Use this constructor when the filename is known at construction time, but the configuration file contents are created later. |
|
DOCSISTFTPFile(String filename,
byte[] fileBytes)
Use this constructor when the filename and configuration file bytes are known at construction time. |
|
| Method Summary | |
|---|---|
void |
add(List<OptionValue> optionValueList)
Add the option values contained in the given list to the DOCSIS configuration. |
void |
add(OptionValue optionValue)
Add the specified option value to the DOCSIS configuration. |
static byte[] |
calcCMTSmicUsingMD5(byte[] key,
byte[] data)
Calculate the HMAC-MD5 digest (the CMTS MIC). |
static byte[] |
calcCMTSmicUsingMMH(byte[] secret,
byte[] data)
Calculate the MMH digest for extended CMTS MIC. |
static byte[] |
catByteArrays(byte[] one,
byte[] two)
Concatanate two byte arrays returning a third |
void |
clear()
Clear the OptionValue list. |
void |
decode(ByteArrayInputStream in,
com.cisco.csrc.encode.DataDecoder decoder)
Decodes object's data and sets object's variables. |
void |
display(PrintWriter output,
String prefix,
List<String> options,
boolean verbose)
Display the contents of this object for debugging. |
void |
encode(ByteArrayOutputStream out,
com.cisco.csrc.encode.DataEncoder encoder)
Encodes object's data. |
boolean |
equals(Object object)
Indicates whether some other object is "equal to" this one. |
void |
generate()
Perform post-processing on DOCSIS configuration data. |
List<OptionValue> |
getOptionValueList()
Get the list of OptionValue objects in this DOCSISTFTPFile. |
int |
hashCode()
Returns the hashcode for this DOCSISTFTPFile. |
void |
mix(String ipAddress,
CSRCProperties csrcProp)
Perform DPE mixing. |
String |
paramString()
Returns a string representing the state of the TFTPFile object. |
void |
readExternal(ObjectInput in)
Externalizable interface. |
int |
size()
Get the number of OptionValue objects in the DOCSISTFTPFile. |
void |
validate()
Validate the TFTP file. |
void |
writeExternal(ObjectOutput out)
Externalizable interface. |
| Methods inherited from class com.cisco.provisioning.cpe.extensions.configuration.AbstractTFTPFile |
|---|
getFile, getFilename, getProperties, getProperty, setProperty, toString |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DOCSISTFTPFile()
public DOCSISTFTPFile(String filename)
filename - public DOCSISTFTPFile(byte[] fileBytes)
fileBytes -
public DOCSISTFTPFile(String filename,
byte[] fileBytes)
filename - fileBytes - | Method Detail |
|---|
public void add(OptionValue optionValue)
optionValue - option value
IllegalArgumentException - if OptionValue is null or if OptionValue
is not a top-level optionpublic void add(List<OptionValue> optionValueList)
optionValueList - list of option values
IllegalArgumentException - if list is null, list contains something
other than top-level OptionValue instancespublic int size()
public void clear()
public List<OptionValue> getOptionValueList()
public void validate()
throws InvalidConfigException
validate in interface TFTPFilevalidate in class AbstractTFTPFileInvalidConfigException - if any errors are encountered during the
validation.
public void generate()
throws InvalidConfigException
generate in interface TFTPFilegenerate in class AbstractTFTPFileInvalidConfigException - if any errors are encountered during the
generation.
public void mix(String ipAddress,
CSRCProperties csrcProp)
throws InvalidConfigException
mix in interface TFTPFilemix in class AbstractTFTPFileipAddress - of the device requesting the TFTP filecsrcProp - relevant to mixing operation
InvalidConfigException - if any errors are encountered during the
mixing.public String paramString()
null.
paramString in class AbstractTFTPFile
public void display(PrintWriter output,
String prefix,
List<String> options,
boolean verbose)
The output from this method is expected to be easier to read, with
possibly less detail than is produced by toString. The
output can be multi-line if that makes it easier to read.
display in interface com.cisco.csrc.util.Displayabledisplay in class AbstractTFTPFileoutput - the resulting output is written to this parameter.prefix - string to output before each line, usually blanks to indent
this output to show association with parent object.options - list of string options to control output.verbose - true indicates detailed output desired.public int hashCode()
hashCode in class AbstractTFTPFilepublic boolean equals(Object object)
equals in class AbstractTFTPFileobject - to compare
public void readExternal(ObjectInput in)
throws IOException,
ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class AbstractTFTPFilein - the stream to read data from in order to restore the object
IOException - if I/O errors occur
ClassNotFoundException - If the class for an object being restored
cannot be found.
public void writeExternal(ObjectOutput out)
throws IOException
writeExternal in interface ExternalizablewriteExternal in class AbstractTFTPFileout - the stream to write the object to
IOException - Includes any I/O exceptions that may occur
public void encode(ByteArrayOutputStream out,
com.cisco.csrc.encode.DataEncoder encoder)
encode in interface com.cisco.csrc.encode.Encodableencode in class AbstractTFTPFileout - the output stream to write toencoder - the encoder to use
public void decode(ByteArrayInputStream in,
com.cisco.csrc.encode.DataDecoder decoder)
decode in interface com.cisco.csrc.encode.Encodabledecode in class AbstractTFTPFilein - the input stream to write todecoder - the decoder to use
public static byte[] catByteArrays(byte[] one,
byte[] two)
one - the first byte arraytwo - the second byte array
public static byte[] calcCMTSmicUsingMMH(byte[] secret,
byte[] data)
secret - the shared secret key.data - the data to be processed.
InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
public static byte[] calcCMTSmicUsingMD5(byte[] key,
byte[] data)
throws InvalidKeyException,
NoSuchAlgorithmException,
NoSuchProviderException
key - the shared secret key.data - the data to be processed.
InvalidKeyException
NoSuchAlgorithmException
NoSuchProviderException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||