java.lang.Object
com.northconcepts.datapipeline.foundations.datamapping.DataMappingEditor

public class DataMappingEditor extends Object
Applies a DataMapping to records from a DataReaderFactory and pages through the mapped results in memory, keeping a sample of the records that failed.
  • Field Details

  • Constructor Details

    • DataMappingEditor

      public DataMappingEditor(DataReaderFactory source)
      Creates an editor that reads the source with a new reader each time a mapping is applied.
  • Method Details

    • close

      public DataMappingEditor close()
      Closes the dataset of mapped records; applying a mapping again loads a new one.
    • applyDataMapping

      public DataMappingEditor applyDataMapping(DataMapping dataMapping)
      Applies a new DataMapping on the source dataset along with the existing sorting and page number.
    • applyDataMapping

      public DataMappingEditor applyDataMapping()
      Re-applies an existing DataMapping on the source dataset along with the existing sorting and page number.
    • applyPagination

      public DataMappingEditor applyPagination(int pageNumber)
      Applies a new sorting and page number to the existing mapped data from the source dataset. This method does not cause a reload or re mapping of the source, it uses the data currently loaded and mapped.
    • applyPagination

      public DataMappingEditor applyPagination()
      Re-applies the existing sorting and page number to the existing mapped data from the source dataset. This method does not cause a reload or re mapping of the source, it uses the data currently loaded and mapped.
    • getSource

      public DataReaderFactory getSource()
    • getDatasetAfterDataMapping

      public Dataset getDatasetAfterDataMapping()
      Returns the dataset containing the mapped data that hasn't been sorted. Sorting occurs on the target RecordList -- see getTarget().
    • getDataMapping

      public DataMapping getDataMapping()
    • getPageNumber

      public int getPageNumber()
      Returns the current 0-based page number.
    • getMaxPagedRecordCount

      public int getMaxPagedRecordCount()
      Returns the number of records needed to fill every page up to and including the current one.
    • getTarget

      public RecordList getTarget()
      Returns all of the mapped and sorted data.
    • getFailedRecords

      public RecordList getFailedRecords()
      Returns the records which failed mapping along with the failure details in a sess\ion property (limited to
      invalid reference
      #getMaxSavedFailedRecords()
      records). The session property key is
      invalid reference
      #DATA_MAPPING_RESULT_SESSION_KEY
      and the type is DataMappingResult.
    • getTotalFailedRecordCount

      public long getTotalFailedRecordCount()
      Returns total failed record count during mapping.
    • getTargetPage

      public RecordList getTargetPage()
      Returns the mapped records on the current page (PAGE_SIZE per page), or an empty list before a mapping is applied.