AdventNet CLI 2.0 API Specification

com.adventnet.cli.terminal
Interface TransformationHandler

All Known Implementing Classes:
TransformationHandlerImpl

public interface TransformationHandler

This interface is used for performing Transformation of terminal data. The user has to implement the method for reading the transformation tables, perform the transformation.


Method Summary
 java.lang.String[] getTransformationTableNames()
          This method returns the table names that are present in the Transformation table list.
 void readTransformationTables(java.lang.String fileName)
          This method reads the transformation tables (e.g in a XML file or a simple Text file).
 byte[] transform(byte[] data)
          This method is called to perform the actual transformation.
 void useTransformationTable(java.lang.String tableName)
          This method sets the Transformation Table to use among the different tables read.
 

Method Detail

readTransformationTables

public void readTransformationTables(java.lang.String fileName)
                              throws TerminalException
This method reads the transformation tables (e.g in a XML file or a simple Text file). The format in which the tables are stored and read are left to user implementation of this method.
Parameters:
fileName - the file in which the Table entries are present
Throws:
TerminalException - thrown when an error occurs during reading of the file.

useTransformationTable

public void useTransformationTable(java.lang.String tableName)
                            throws TerminalException
This method sets the Transformation Table to use among the different tables read. The transformation table is identified by the table name.
Parameters:
tableName - the table name indicates the table which should be used for the transformation.
Throws:
TerminalException - thrown when an error occurs during setting the Transformation table

transform

public byte[] transform(byte[] data)
                 throws TerminalException
This method is called to perform the actual transformation. It takes the untransformed data in a byte array and returns the transformed data after performing look up operations in the table.
Parameters:
data - the data to be transformed
Returns:
the byte array containing the transformed data
Throws:
TerminalException - thrown when an error occurs during the transformation operation

getTransformationTableNames

public java.lang.String[] getTransformationTableNames()
                                               throws TerminalException
This method returns the table names that are present in the Transformation table list. Typical implementation of this method should return the list of names of all the various tables defined.
Returns:
the list of table names defined.
Throws:
TerminalExcption - thrown when an error occurs while retreiving the table names.

AdventNet CLI 2.0 API Specification