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

All Known Implementing Classes:
AbstractTFTPFile, CableHomeTFTPFile, DOCSISTFTPFile, PacketCableTFTPFile, SimpleTFTPFile

public interface TFTPFile

TFTP File interface. The TFTPFile represents a configuration file that is created at the RDU, mixed at the DPE, and delivered to a device via TFTP. The TFTPFile can have an optional filename tag that distinquishes it from other TFTPFile objects contained in the TFTPConfig. The TFTPFile object contains the configuration file that is sent to the device in response to a DPE TFTP "get" operation. The TFTPFile object contains this configuration file, a property map, and performs validation, generation and mixing of the configuration file. The TFTPFile object must be serializable.

The TFTPFile is created by an RDU configuration extension. After all the RDU configuration extension points are executed for a given device configuration the RDU configuration engine will call the validate() and generate() methods to perform any TFTPFile-specific validation and post-processing that are required prior to sending the configuration to the DPE. When the DPE TFTP server receives a request from the device for the file it will first call the mix() method and then call the getFile() method to retrieve the configuration bytes to send in the TFTP response.

See Also:
TFTPConfig

Method Summary
 void generate()
          Generate the TFTP file.
 byte[] getFile()
          Get the configuration file to be delivered to the device.
 String getFilename()
          Get the filename identifier for the TFTPFile.
 Map<String,Object> getProperties()
          Get the property map.
 Object getProperty(String key)
          Get the named property from the property map.
 void mix(String ipAddress, CSRCProperties properties)
          Perform DPE mixing.
 void setProperty(String key, Object value)
          Set the named property in the property map.
 void validate()
          Validate the TFTP file.
 

Method Detail

getFilename

String getFilename()
Get the filename identifier for the TFTPFile. It is possible there is no filename identifier, in which case null is returned.

Returns:
filename or null if no filename defined

getFile

byte[] getFile()
Get the configuration file to be delivered to the device. This method is invoked by the DPE when the TFTP file is requested by the device.

Returns:
the configuration file

getProperty

Object getProperty(String key)
Get the named property from the property map.

Parameters:
key - property name
Returns:
property value, or null if no property matching key found

setProperty

void setProperty(String key,
                 Object value)
Set the named property in the property map. If the property key already exists it is replaced with the given property value.

Parameters:
key - property name
value - property value

getProperties

Map<String,Object> getProperties()
Get the property map. The property map returned is write-through to the property map contained in the TFTP File object.

Returns:
property map

validate

void validate()
              throws InvalidConfigException
Validate the TFTP file. This method implements any validation of the TFTP file that is required during RDU configuration generation. Optional.

Throws:
InvalidConfigException - if any errors are encountered during the validation.

generate

void generate()
              throws InvalidConfigException
Generate the TFTP file. This method implements any post-processing of the TFTP file that is required during RDU configuration generation. Optional.

Throws:
InvalidConfigException - if any errors are encountered during the generation.

mix

void mix(String ipAddress,
         CSRCProperties properties)
         throws InvalidConfigException
Perform DPE mixing. This method is invoked prior to the file being sent to the device. Perform any mixing operations required. Optional.

Parameters:
ipAddress - of the device requesting the TFTP file
properties - relevant to mixing operation
Throws:
InvalidConfigException - if any errors are encountered during the mixing.