Skip to content

Commit

Permalink
Merge pull request #39 from Comcast/UpdateDictionary
Browse files Browse the repository at this point in the history
***Fixes***
* Issue-38
* Updated TLV Dictionary
  • Loading branch information
Maurice Garcia committed Jun 26, 2015
2 parents 10d2d4b + d184701 commit 75a7291
Show file tree
Hide file tree
Showing 9 changed files with 427 additions and 293 deletions.
Binary file modified db/dictionary.sqlite
Binary file not shown.
Binary file modified res/dictionary.sqlite
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,15 @@ private void tlvToDictionary () {

}

//Sort by TopLevel TLVs via List<byte[]>
/***************************************************************************
* Sort by TopLevel TLVs via List<byte[]>
***************************************************************************/
for (byte[] bTopLevelTLV : tbTLV.sortByTopLevelTlv(miiTopLevelTLV)) {

//Search TLV List
if (debug|localDebug)
System.out.println("ConfigrationFileExport.tlvToDictionary() -> Sort by TopLevel" + miiTopLevelTLV);

//Get TLV Type
iTlvType = BinaryConversion.byteToUnsignedInteger(bTopLevelTLV[0]);

Expand Down Expand Up @@ -1021,6 +1027,8 @@ private void tlvToDictionary () {
* @throws JSONException */
private StringBuilder topLevelTLVCodeBlock (JSONObject joTopLevelTLV, int iIndentation) throws JSONException {

Boolean localDebug = Boolean.FALSE;

StringBuilder sbTopLevelTLVCodeBlock = new StringBuilder();

StringBuilder sbIndentation = new StringBuilder();
Expand Down Expand Up @@ -1070,6 +1078,9 @@ private StringBuilder topLevelTLVCodeBlock (JSONObject joTopLevelTLV, int iInden
.append("*/\n");
}

if (debug|localDebug)
System.out.println("topLevelTLVCodeBlock(jo,i): " + sbTopLevelTLVCodeBlock);

//Top Level TLV Only
} else {

Expand Down Expand Up @@ -1101,6 +1112,9 @@ private StringBuilder topLevelTLVCodeBlock (JSONObject joTopLevelTLV, int iInden
.append("*/\n");
}

if (debug|localDebug)
System.out.println("topLevelTLVCodeBlock(jo,i): " + sbTopLevelTLVCodeBlock);

}

return sbTopLevelTLVCodeBlock;
Expand Down
2 changes: 1 addition & 1 deletion src/com/comcast/oscar/constants/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Constants {

private static final String TAB = "\t";

public static final String OSCAR_VERSION = "2.1.3";
public static final String OSCAR_VERSION = "2.1.3.2";
public static final String OSCAR_CLI_USAGE = "java -jar oscar.jar -k <key> -i <.txt> -o <.bin> -c";
public static final String OSCAR_CLI_HEADER = "/* OSCAR -> OpenSource Cable modem file AssembleR v" + OSCAR_VERSION + " */";
public static final String OSCAR_CLI_NO_ARGS = "Type --help for information";
Expand Down
4 changes: 4 additions & 0 deletions src/com/comcast/oscar/dictionary/Dictionary.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

public interface Dictionary {

public final static String DB_TBL_COL_ID = "ID";
public final static String DB_TBL_COL_TYPE = "TYPE";
public final static String DB_TBL_COL_PARENT_ID = "PARENT_ID";
public final static String DB_TBL_COL_TLV_NAME = "TLV_NAME";
Expand Down Expand Up @@ -74,6 +75,9 @@ public interface Dictionary {
public final static Integer PACKET_CABLE = 1;
public final static Integer DPOE = 2;

/* Needed to Fix an Issue where More than 1 SubTLV is found */
public final static String MULTI_SUB_TLV_INSTANCE = "MULTI_SUB_TLV_INSTANCE";

/* *****************************************************************************
* Methods
******************************************************************************/
Expand Down
55 changes: 55 additions & 0 deletions src/com/comcast/oscar/examples/issues/Issue38NoMaxInstance.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.comcast.oscar.examples.issues;

import com.comcast.oscar.configurationfile.ConfigurationFileExport;
import com.comcast.oscar.tlv.TlvBuilder;
import com.comcast.oscar.tlv.TlvException;
import com.comcast.oscar.utilities.HexString;

public class Issue38NoMaxInstance {

@SuppressWarnings("deprecation")
public static void main(String[] args) throws TlvException {

String sConfigFileHex =
"03:01:01:12:01:01:18:25:01:02:00:01:06:01:07:07:01:01:09:04:00:00:0B:E4:0C:02:00:00:0D:02:00:C8:0E:02:0B:E4:0F:01:02:10:04:00:00:00:80:19:24:01:02:00:65:06:01:07:07:01:01:08:04:00:0F:42:40:09:04:00:00:05:F2:0C:02:00:00:0D:02:00:C8:0E:04:00:00:00:00:1D:01:01:11:36:01:04:00:00:00:0A:02:04:00:00:00:0A:03:04:00:00:02:58:04:04:00:00:00:0A:05:04:00:00:00:0A:06:04:00:00:02:58:07:04:00:00:00:3C:08:04:00:00:00:01:09:04:00:00:00:04:1C:02:00:14:19:4C:01:02:00:0D:06:01:07:07:01:05:08:04:00:0F:A0:00:0C:02:00:00:0D:02:00:C8:0E:04:00:00:00:00:2B:11:08:03:00:00:CA:30:10:01:08:00:00:00:1E:00:00:00:01:2B:0F:08:03:00:00:0C:04:08:00:00:00:14:00:00:00:01:04:08:65:4D:54:41:2D:44:53:00:18:4F:01:02:00:17:06:01:07:07:01:05:08:04:00:01:F4:00:0C:02:00:00:0D:02:00:C8:0F:01:02:10:04:00:00:00:80:2B:11:08:03:00:00:CA:30:10:01:08:00:00:00:1E:00:00:00:01:2B:0F:08:03:00:00:0C:04:08:00:00:00:14:00:00:00:01:04:08:65:4D:54:41:2D:55:53:00:17:1A:01:01:0D:03:02:00:0D:06:01:01:0A:0E:01:0C:00:15:D1:7A:64:BA:FF:FF:FF:FF:FF:FF:16:14:01:01:17:03:02:00:17:06:01:01:0A:08:02:06:00:15:D1:7A:64:BA:06:10:F9:83:CC:02:72:3B:0D:56:BB:D0:1A:9F:76:28:98:B0:07:10:7D:64:75:80:0A:6C:45:A7:DF:D8:A3:D7:35:35:3E:07:FF";

String sConfigFileHexTLV25 =
"19:4C:"
+ "01:02:00:0D:"
+ "06:01:07:"
+ "07:01:05:"
+ "08:04:00:0F:A0:00:"
+ "0C:02:00:00:"
+ "0D:02:00:C8:"
+ "0E:04:00:00:00:00:"
+ "2B:11:08:03:00:00:CA:30:10:01:08:00:00:00:1E:00:00:00:01:"
+ "2B:0F:08:03:00:00:0C:04:08:00:00:00:14:00:00:00:01:"
+ "04:08:65:4D:54:41:2D:44:53:00:"
+ "FF";
sConfigFileHexTLV25 =
"19:13:"
+ "2B:11:08:03:00:00:CA:30:10:01:08:00:00:00:1E:00:00:00:01:"
+ "FF";
sConfigFileHexTLV25 =
"19:35:"
+ "2B:11:08:03:00:00:CA:30:10:01:08:00:00:00:1E:00:00:00:01:"
+ "2B:0F:08:03:00:00:0C:04:08:00:00:00:14:00:00:00:01:"
+ "2B:0F:08:03:00:00:0C:04:08:00:00:00:14:00:00:00:02:"
+ "FF";



HexString hs = new HexString(HexString.toByteArray(sConfigFileHex));

TlvBuilder tb = new TlvBuilder();

tb.add(hs);

ConfigurationFileExport cfe = new ConfigurationFileExport (tb,ConfigurationFileExport.DOCSIS_VER_30);

System.out.println(cfe.toPrettyPrint(ConfigurationFileExport.EXPORT_FOUND_TLV));


}

}
53 changes: 25 additions & 28 deletions src/com/comcast/oscar/sql/queries/DocsisSqlQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -378,17 +378,16 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare

tlvJsonObj = new JSONObject();

tlvJsonObj.put(Dictionary.TYPE, resultSetGetRowDefinition.getString("TYPE"));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetGetRowDefinition.getString("TLV_NAME"));
// tlvJsonObj.put(DocsisSqlQueryConstants.TLV_DESCRIPTION, resultSetGetRowDefinition.getString("TLV_DESCRIPTION"));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetGetRowDefinition.getInt("LENGTH_MIN"));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetGetRowDefinition.getInt("LENGTH_MAX"));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetGetRowDefinition.getString("MIN_SUPPORTED_VERSION"));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetGetRowDefinition.getString("DATA_TYPE"));
tlvJsonObj.put(Dictionary.TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TLV_NAME));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MIN));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MAX));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_SUPPORTED_VERSIONS));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_DATA_TYPE));
tlvJsonObj.put(Dictionary.ARE_SUBTYPES, false);
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetGetRowDefinition.getString("BYTE_LENGTH"));
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_BYTE_LENGTH));

aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt("TYPE"));
aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(Dictionary.PARENT_TYPE_LIST, aliTlvEncodeHistory);

if (debug)
Expand All @@ -415,15 +414,14 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare

tlvJsonObj = new JSONObject();

tlvJsonObj.put(Dictionary.TYPE, resultSetGetRowDefinition.getString("TYPE"));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetGetRowDefinition.getString("TLV_NAME"));
// tlvJsonObj.put(DocsisSqlQueryConstants.TLV_DESCRIPTION, resultSetGetRowDefinition.getString("TLV_DESCRIPTION"));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetGetRowDefinition.getInt("LENGTH_MIN"));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetGetRowDefinition.getInt("LENGTH_MAX"));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetGetRowDefinition.getString("MIN_SUPPORTED_VERSION"));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetGetRowDefinition.getString("DATA_TYPE"));
tlvJsonObj.put(Dictionary.TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TLV_NAME));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MIN));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MAX));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_SUPPORTED_VERSIONS));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_DATA_TYPE));
tlvJsonObj.put(Dictionary.ARE_SUBTYPES, false);
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetGetRowDefinition.getString("BYTE_LENGTH"));
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_BYTE_LENGTH));

aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt("TYPE"));
tlvJsonObj.put(Dictionary.PARENT_TYPE_LIST, aliTlvEncodeHistory);
Expand Down Expand Up @@ -452,7 +450,7 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare

while (resultSetParentCheck.next()) {

iParentIdTemp = resultSetParentCheck.getInt("PARENT_ID");
iParentIdTemp = resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_PARENT_ID);

ArrayList<Integer> aliTlvEncodeHistoryNext = new ArrayList<Integer>();

Expand All @@ -464,7 +462,7 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare
aliTlvEncodeHistoryNext.remove(aliTlvEncodeHistoryNext.size()-1);

//Keep processing each row using recursion until you get to to the bottom of the tree
tlvJsonArray.put(recursiveTlvDefinitionBuilder( resultSetParentCheck.getInt("ID"),
tlvJsonArray.put(recursiveTlvDefinitionBuilder(resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_ID),
iParentIdTemp ,
aliTlvEncodeHistoryNext));
}
Expand Down Expand Up @@ -571,16 +569,15 @@ private JSONObject getRowDefinitionViaRowId (Integer iRowID) throws JSONExceptio

tlvJsonObj = new JSONObject();

tlvJsonObj.put(Dictionary.TYPE, resultSetParentCheck.getString("TYPE"));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetParentCheck.getString("TLV_NAME"));
// tlvJsonObj.put(DocsisSqlQueryConstants.TLV_DESCRIPTION, resultSetParentCheck.getString("TLV_DESCRIPTION"));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetParentCheck.getInt("LENGTH_MIN"));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetParentCheck.getInt("LENGTH_MAX"));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetParentCheck.getString("MIN_SUPPORTED_VERSION"));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetParentCheck.getString("DATA_TYPE"));
tlvJsonObj.put(Dictionary.TYPE, resultSetParentCheck.getString(Dictionary.TYPE));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_TLV_NAME));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_LENGTH_MIN));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_LENGTH_MAX));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_SUPPORTED_VERSIONS));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_DATA_TYPE));
tlvJsonObj.put(Dictionary.ARE_SUBTYPES, true);
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetParentCheck.getString("BYTE_LENGTH"));

tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_BYTE_LENGTH));
if (debug)
System.out.println(tlvJsonObj.toString());

Expand Down
62 changes: 30 additions & 32 deletions src/com/comcast/oscar/sql/queries/PacketCableSqlQuery.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

import com.comcast.oscar.cablelabsdefinitions.Constants;
import com.comcast.oscar.configurationfile.ConfigurationFileTypeConstants;
import com.comcast.oscar.dictionary.Dictionary;
import com.comcast.oscar.sql.SqlConnection;

/**
Expand Down Expand Up @@ -354,17 +355,16 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare

tlvJsonObj = new JSONObject();

tlvJsonObj.put(PacketCableSqlQueryConstants.TYPE, resultSetGetRowDefinition.getString("TYPE"));
tlvJsonObj.put(PacketCableSqlQueryConstants.TLV_NAME, resultSetGetRowDefinition.getString("TLV_NAME"));
// tlvJsonObj.put(DocsisSqlQueryConstants.TLV_DESCRIPTION, resultSetGetRowDefinition.getString("TLV_DESCRIPTION"));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MIN, resultSetGetRowDefinition.getInt("LENGTH_MIN"));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MAX, resultSetGetRowDefinition.getInt("LENGTH_MAX"));
tlvJsonObj.put(PacketCableSqlQueryConstants.SUPPORTED_DOCSIS_VERSIONS, resultSetGetRowDefinition.getString("MIN_SUPPORTED_DOCSIS_VERSION"));
tlvJsonObj.put(PacketCableSqlQueryConstants.DATA_TYPE, resultSetGetRowDefinition.getString("DATA_TYPE"));
tlvJsonObj.put(PacketCableSqlQueryConstants.ARE_SUBTYPES, false);
tlvJsonObj.put(PacketCableSqlQueryConstants.BYTE_LENGTH, resultSetGetRowDefinition.getString("BYTE_LENGTH"));

aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt("TYPE"));
tlvJsonObj.put(Dictionary.TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TLV_NAME));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MIN));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MAX));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_SUPPORTED_VERSIONS));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_DATA_TYPE));
tlvJsonObj.put(Dictionary.ARE_SUBTYPES, false);
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_BYTE_LENGTH));

aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(PacketCableSqlQueryConstants.PARENT_TYPE_LIST, aliTlvEncodeHistory);

if (debug)
Expand All @@ -391,17 +391,16 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare

tlvJsonObj = new JSONObject();

tlvJsonObj.put(PacketCableSqlQueryConstants.TYPE, resultSetGetRowDefinition.getString("TYPE"));
tlvJsonObj.put(PacketCableSqlQueryConstants.TLV_NAME, resultSetGetRowDefinition.getString("TLV_NAME"));
// tlvJsonObj.put(DocsisSqlQueryConstants.TLV_DESCRIPTION, resultSetGetRowDefinition.getString("TLV_DESCRIPTION"));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MIN, resultSetGetRowDefinition.getInt("LENGTH_MIN"));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MAX, resultSetGetRowDefinition.getInt("LENGTH_MAX"));
tlvJsonObj.put(PacketCableSqlQueryConstants.SUPPORTED_DOCSIS_VERSIONS, resultSetGetRowDefinition.getString("MIN_SUPPORTED_DOCSIS_VERSION"));
tlvJsonObj.put(PacketCableSqlQueryConstants.DATA_TYPE, resultSetGetRowDefinition.getString("DATA_TYPE"));
tlvJsonObj.put(PacketCableSqlQueryConstants.ARE_SUBTYPES, false);
tlvJsonObj.put(PacketCableSqlQueryConstants.BYTE_LENGTH, resultSetGetRowDefinition.getString("BYTE_LENGTH"));

aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt("TYPE"));
tlvJsonObj.put(Dictionary.TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(Dictionary.TLV_NAME, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_TLV_NAME));
tlvJsonObj.put(Dictionary.LENGTH_MIN, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MIN));
tlvJsonObj.put(Dictionary.LENGTH_MAX, resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_LENGTH_MAX));
tlvJsonObj.put(Dictionary.SUPPORTED_VERSIONS, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_SUPPORTED_VERSIONS));
tlvJsonObj.put(Dictionary.DATA_TYPE, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_DATA_TYPE));
tlvJsonObj.put(Dictionary.ARE_SUBTYPES, false);
tlvJsonObj.put(Dictionary.BYTE_LENGTH, resultSetGetRowDefinition.getString(Dictionary.DB_TBL_COL_BYTE_LENGTH));

aliTlvEncodeHistory.add(resultSetGetRowDefinition.getInt(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(PacketCableSqlQueryConstants.PARENT_TYPE_LIST, aliTlvEncodeHistory);

if (debug)
Expand Down Expand Up @@ -440,7 +439,7 @@ private JSONObject recursiveTlvDefinitionBuilder (Integer iRowID , Integer iPare
aliTlvEncodeHistoryNext.remove(aliTlvEncodeHistoryNext.size()-1);

//Keep processing each row using recursion until you get to to the bottom of the tree
tlvJsonArray.put(recursiveTlvDefinitionBuilder( resultSetParentCheck.getInt("ID"),
tlvJsonArray.put(recursiveTlvDefinitionBuilder( resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_ID),
iParentIdTemp ,
aliTlvEncodeHistoryNext));
}
Expand Down Expand Up @@ -546,16 +545,15 @@ private JSONObject getRowDefinitionViaRowId (Integer iRowID) throws JSONExceptio

tlvJsonObj = new JSONObject();

tlvJsonObj.put(PacketCableSqlQueryConstants.TYPE, resultSetParentCheck.getString("TYPE"));
tlvJsonObj.put(PacketCableSqlQueryConstants.TLV_NAME, resultSetParentCheck.getString("TLV_NAME"));
// tlvJsonObj.put(DocsisSqlQueryConstants.TLV_DESCRIPTION, resultSetParentCheck.getString("TLV_DESCRIPTION"));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MIN, resultSetParentCheck.getInt("LENGTH_MIN"));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MAX, resultSetParentCheck.getInt("LENGTH_MAX"));
tlvJsonObj.put(PacketCableSqlQueryConstants.SUPPORTED_DOCSIS_VERSIONS, resultSetParentCheck.getString("MIN_SUPPORTED_DOCSIS_VERSION"));
tlvJsonObj.put(PacketCableSqlQueryConstants.DATA_TYPE, resultSetParentCheck.getString("DATA_TYPE"));
tlvJsonObj.put(PacketCableSqlQueryConstants.TYPE, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_TYPE));
tlvJsonObj.put(PacketCableSqlQueryConstants.TLV_NAME, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_TLV_NAME));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MIN, resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_LENGTH_MIN));
tlvJsonObj.put(PacketCableSqlQueryConstants.LENGTH_MAX, resultSetParentCheck.getInt(Dictionary.DB_TBL_COL_LENGTH_MAX));
tlvJsonObj.put(PacketCableSqlQueryConstants.SUPPORTED_DOCSIS_VERSIONS, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_SUPPORTED_VERSIONS));
tlvJsonObj.put(PacketCableSqlQueryConstants.DATA_TYPE, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_DATA_TYPE));
tlvJsonObj.put(PacketCableSqlQueryConstants.ARE_SUBTYPES, true);
tlvJsonObj.put(PacketCableSqlQueryConstants.BYTE_LENGTH, resultSetParentCheck.getString("BYTE_LENGTH"));

tlvJsonObj.put(PacketCableSqlQueryConstants.BYTE_LENGTH, resultSetParentCheck.getString(Dictionary.DB_TBL_COL_BYTE_LENGTH));
if (debug)
System.out.println(tlvJsonObj.toString());

Expand Down
Loading

0 comments on commit 75a7291

Please sign in to comment.