Interface Smf2JsonCLI.Client

Enclosing class:
Smf2JsonCLI

public static interface Smf2JsonCLI.Client
Interface for a class to use Smf2JsonCLI.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<?>
    This method is called after all records have been processed, allowing you to optionally provide additional objects to be written to the JSON output.
    List<?>
    Process a SMF record and optionally return objects to be written out as JSON.
  • Method Details

    • processRecord

      List<?> processRecord(SmfRecord record)
      Process a SMF record and optionally return objects to be written out as JSON. This method will be called for each SMF record read.

      The return value is a List<?> which allows zero or more JSON records to be generated from a single SMF record.

      To return only 1 or zero objects you can return Collections.singletonList(Object) or Collections.emptyList(), or construct a List with 1 or zero members.

      Return Smf2JsonCLI.FINISHED directly or as a member of the returned List to terminate processing.

      The Smf2JsonCLI class can use multiple threads with the --parallel command line option, however the calls to processRecord will be synchronized so that it is only called from one thread at a time. The implementation of Smf2JsonCLI.Client does not need to do its own synchronization. Only the JSON generation runs in parallel.

      If your SMF record processing is resource intensive, e.g. CICS records with lots of fields and/or needing decompression, you can implement a thread safe processRecord(SmfRecord) method and set Smf2JsonCLI.processRecordIsThreadSafe(boolean) to true. If Smf2JsonCLI.processRecordIsThreadSafe(boolean) is true, the processRecord function will also be called from multiple threads in parallel.

      Parameters:
      record - the SMF record to process
      Returns:
      A list (possibly empty) of objects to be written as JSON records, or null
    • onEndOfData

      List<?> onEndOfData()
      This method is called after all records have been processed, allowing you to optionally provide additional objects to be written to the JSON output. You can use it to e.g. return a summary of the data.
      Returns:
      A list (possibly empty) of objects to be written as JSON records, or null