test_class.file: OpenSOC-Pcap_Service/src/test/java/com/opensoc/pcapservice/PcapHelperTest.java
test_class.identifier: PcapHelperTest
test_case.body: @Test
    public void test_reverseKey_valid_withFragment() {
      String key = "162.242.152.24-162.242.153.12-TCP-38190-9092-fragmentId";
      String reversekey = PcapHelper.reverseKey(key);
      Assert.isTrue("162.242.153.12-162.242.152.24-TCP-9092-38190"
          .equals(reversekey));
    }
test_case.class_method_signature: PcapHelperTest.test_reverseKey_valid_withFragment()
test_case.full_signature: @Test public void test_reverseKey_valid_withFragment()
test_case.identifier: test_reverseKey_valid_withFragment
test_case.invocations: reverseKey isTrue equals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_reverseKey_valid_withFragment()
focal_class.declarator: LOGGER = Logger.getLogger(PcapHelper.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = Logger.getLogger(PcapHelper.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: CELL_TIMESTAMP_COMPARATOR = new CellTimestampComparator()
focal_class.modifier: private static
focal_class.original_string: private static CellTimestampComparator CELL_TIMESTAMP_COMPARATOR = new CellTimestampComparator();
focal_class.type: CellTimestampComparator
focal_class.var_name: CELL_TIMESTAMP_COMPARATOR
focal_class.file: OpenSOC-Pcap_Service/src/main/java/com/opensoc/pcapservice/PcapHelper.java
focal_class.identifier: PcapHelper
focal_class.class_method_signature: PcapHelper.convertToDataCreationTimeUnit(long inputTime)
focal_class.full_signature: public static long convertToDataCreationTimeUnit(long inputTime)
focal_class.identifier: convertToDataCreationTimeUnit
focal_class.modifiers: public static
focal_class.parameters: (long inputTime)
focal_class.return: long
focal_class.signature: long convertToDataCreationTimeUnit(long inputTime)
focal_class.class_method_signature: PcapHelper.getDataCreationTimeUnit()
focal_class.full_signature: @VisibleForTesting public static TimeUnit getDataCreationTimeUnit()
focal_class.identifier: getDataCreationTimeUnit
focal_class.modifiers: @VisibleForTesting public static
focal_class.parameters: ()
focal_class.return: TimeUnit
focal_class.signature: TimeUnit getDataCreationTimeUnit()
focal_class.class_method_signature: PcapHelper.convertSecondsToDataCreationTimeUnit(long inputTime)
focal_class.full_signature: @VisibleForTesting public static long convertSecondsToDataCreationTimeUnit(long inputTime)
focal_class.identifier: convertSecondsToDataCreationTimeUnit
focal_class.modifiers: @VisibleForTesting public static
focal_class.parameters: (long inputTime)
focal_class.return: long
focal_class.signature: long convertSecondsToDataCreationTimeUnit(long inputTime)
focal_class.class_method_signature: PcapHelper.reverseKey(String key)
focal_class.full_signature: public static String reverseKey(String key)
focal_class.identifier: reverseKey
focal_class.modifiers: public static
focal_class.parameters: (String key)
focal_class.return: String
focal_class.signature: String reverseKey(String key)
focal_class.class_method_signature: PcapHelper.reverseKey(List<String> keys)
focal_class.full_signature: public static List<String> reverseKey(List<String> keys)
focal_class.identifier: reverseKey
focal_class.modifiers: public static
focal_class.parameters: (List<String> keys)
focal_class.return: List<String>
focal_class.signature: List<String> reverseKey(List<String> keys)
focal_class.class_method_signature: PcapHelper.getCellTimestampComparator()
focal_class.full_signature: public static CellTimestampComparator getCellTimestampComparator()
focal_class.identifier: getCellTimestampComparator
focal_class.modifiers: public static
focal_class.parameters: ()
focal_class.return: CellTimestampComparator
focal_class.signature: CellTimestampComparator getCellTimestampComparator()
focal_class.class_method_signature: PcapHelper.convertMillisToDataCreationTimeUnit(long inputTime)
focal_class.full_signature: @VisibleForTesting private static long convertMillisToDataCreationTimeUnit(long inputTime)
focal_class.identifier: convertMillisToDataCreationTimeUnit
focal_class.modifiers: @VisibleForTesting private static
focal_class.parameters: (long inputTime)
focal_class.return: long
focal_class.signature: long convertMillisToDataCreationTimeUnit(long inputTime)
focal_class.class_method_signature: PcapHelper.convertMicrosToDataCreationTimeUnit(long inputTime)
focal_class.full_signature: @VisibleForTesting private static long convertMicrosToDataCreationTimeUnit(long inputTime)
focal_class.identifier: convertMicrosToDataCreationTimeUnit
focal_class.modifiers: @VisibleForTesting private static
focal_class.parameters: (long inputTime)
focal_class.return: long
focal_class.signature: long convertMicrosToDataCreationTimeUnit(long inputTime)
focal_method.body: public static String reverseKey(String key) {
      Assert.hasText(key, "key must not be null or empty");
      String delimeter = HBaseConfigConstants.PCAP_KEY_DELIMETER;
      String regex = "\\" + delimeter;
      StringBuffer sb = new StringBuffer();
      try {
        String[] tokens = key.split(regex);
        Assert
            .isTrue(
                (tokens.length == 5 || tokens.length == 6 || tokens.length == 7),
                "key is not in the format : 'srcAddr-dstAddr-protocol-srcPort-dstPort-{ipId-fragment identifier}'");
        sb.append(tokens[1]).append(delimeter).append(tokens[0])
            .append(delimeter).append(tokens[2]).append(delimeter)
            .append(tokens[4]).append(delimeter).append(tokens[3]);
      } catch (Exception e) {
        Log.warn("Failed to reverse the key. Reverse scan won't be performed.", e);
      }
      return sb.toString();
    }
focal_method.class_method_signature: PcapHelper.reverseKey(String key)
focal_method.full_signature: public static String reverseKey(String key)
focal_method.identifier: reverseKey
focal_method.invocations: hasText split isTrue append append append append append append append append append warn toString
focal_method.modifiers: public static
focal_method.parameters: (String key)
focal_method.return: String
focal_method.signature: String reverseKey(String key)