Carries the shared state for one table import run, from the first row to the last, including the field mappings, request parameters, accumulated extended stats, skipped and invalid rows, and the before/after and sanity check action handlers configured for the upload. A single instance is created via one of the static init methods when a table upload begins and is then passed to the TableUploader and to each row's RowContext for the duration of the import, giving row processors a place to read shared configuration and record cross-row results such as running totals or invalid rows.


Properties

PropertyReturnsDescription
actionHandlersList<ActionHandlerConfig>The before/after and sanity check action handlers configured for this import, resolved from the request parameters against the handlers registered with the TableUploadManager.
adminDomainOrganisationThe tenant organisation this import is running for, resolved lazily from the current root folder on first use.
attributesMap<String,Object>Free-form attributes a TableUploader or action handler can use to carry state across rows for the duration of this import. Never null.
cancelledbooleanWhether this import has been cancelled, either by the user or by the processable running it.
columnInfoList<ColumnInfo>The mapped source columns for this import, one entry per mapped column index, sorted by column index. Each entry carries the column's index, its destination field name and the field's display title. Resolved lazily on first use and cached for the rest of the import.
currentProfileProfileThe profile of the user who initiated this import, resolved lazily from the current security context on first use.
destFieldsList<DestFieldV2>The destination fields a source row can be mapped to for this import, resolved lazily from the TableUploader on first use and cached for the rest of the import.
extendedStatsMap<String,Object>Custom statistics accumulated during this import, keyed by stat name, such as running totals or earliest/latest dates recorded via incrementStat, checkEarliestStat or checkLatestStat. Never null.
fieldMappingsMap<String,List<Integer>>The column mappings for this import, keyed by destination field name, with each value the list of zero-based source column indexes mapped to that field.
invalidRowsList<List>Rows that failed validation during this import, with a header row (if any rows were added) followed by each invalid row prefixed with its error message. Never null.
parametersMap<String,String>The raw request parameters this import was initiated with, including options such as before/after and sanity check action handler configuration.
skippedRowsList<List>Rows that were skipped entirely during this import, for example by a skip-rows action handler. Never null.
startTimeLongThe time this import started, as milliseconds since the epoch.
tableUploaderTableUploaderThe TableUploader implementation driving this import, providing the destination fields and row processing logic.

Methods

cancel() · isCancelled() · getTableUploader() · getCurrentProfile() · getFieldMappings() · getParameters() · getAttributes() · getExtendedStats() · getSkippedRows() · getStartTime() · getInvalidRows() · getAdminDomain() · incrementStat(String statName, Integer statAmount) · incrementStat(String statName, Double statAmount) · checkEarliestStat(String statName, Date date) · checkLatestStat(String statName, Date date) · attribute(String name) · setAttribute(String name, Object val) · getOrCreateSet(String name) · hasConflictingVal(String setName, String value) · getActionHandlers() · addInvalidRow(List row, String errMsg) · getDestFields() · findDestField(String name) · getColumnInfo()

cancel()

Returns: void

Marks this import as cancelled, so the processor stops handing it further rows.

isCancelled()

Returns: boolean

Whether this import has been cancelled, either by the user or by the processable running it.

getTableUploader()

Returns: TableUploader

The TableUploader implementation driving this import, providing the destination fields and row processing logic.

getCurrentProfile()

Returns: Profile

The profile of the user who initiated this import, resolved lazily from the current security context on first use.

getFieldMappings()

Returns: Map<String,List<Integer>>

The column mappings for this import, keyed by destination field name, with each value the list of zero-based source column indexes mapped to that field.

getParameters()

Returns: Map<String,String>

The raw request parameters this import was initiated with, including options such as before/after and sanity check action handler configuration.

getAttributes()

Returns: Map<String,Object>

Free-form attributes a TableUploader or action handler can use to carry state across rows for the duration of this import. Never null.

getExtendedStats()

Returns: Map<String,Object>

Custom statistics accumulated during this import, keyed by stat name, such as running totals or earliest/latest dates recorded via incrementStat, checkEarliestStat or checkLatestStat. Never null.

getSkippedRows()

Returns: List<List>

Rows that were skipped entirely during this import, for example by a skip-rows action handler. Never null.

getStartTime()

Returns: Long

The time this import started, as milliseconds since the epoch.

getInvalidRows()

Returns: List<List>

Rows that failed validation during this import, with a header row (if any rows were added) followed by each invalid row prefixed with its error message. Never null.

getAdminDomain()

Returns: Organisation

The tenant organisation this import is running for, resolved lazily from the current root folder on first use.

incrementStat(String statName, Integer statAmount)

Returns: void

Adds the given amount to a named integer statistic in this import's extended stats, treating a missing stat as zero. Does nothing if the amount is null.

ParameterDescription
statNamethe extended stat's name
statAmountthe amount to add, or null to do nothing

incrementStat(String statName, Double statAmount)

Returns: void

Adds the given amount to a named double statistic in this import's extended stats, treating a missing stat as zero. Does nothing if the amount is null.

ParameterDescription
statNamethe extended stat's name
statAmountthe amount to add, or null to do nothing

checkEarliestStat(String statName, Date date)

Returns: void

Records the given date as a named statistic if it is earlier than the value currently stored for that stat, or if no value is stored yet. Does nothing if the date is null.

ParameterDescription
statNamethe extended stat's name
datethe date to compare and possibly record, or null to do nothing

checkLatestStat(String statName, Date date)

Returns: void

Records the given date as a named statistic if it is later than the value currently stored for that stat, or if no value is stored yet. Does nothing if the date is null.

ParameterDescription
statNamethe extended stat's name
datethe date to compare and possibly record, or null to do nothing

attribute(String name)

Returns: Object

Reads a previously stored attribute value by name.

ParameterDescription
namethe attribute name

setAttribute(String name, Object val)

Returns: void

Stores an attribute value under the given name, for later retrieval by attribute.

ParameterDescription
namethe attribute name
valthe value to store

getOrCreateSet(String name)

Returns: Set<String>

Reads the named attribute as a set of strings, creating and storing an empty set under that name first if none exists yet.

ParameterDescription
namethe attribute name

hasConflictingVal(String setName, String value)

Returns: boolean

Checks whether the given value has already been seen for the named set during this import, recording it if not. Used to detect duplicate values, such as a unique identifier column, across the rows of an import.

ParameterDescription
setNamethe name of the set of previously seen values to check against
valuethe value to check and record

getActionHandlers()

Returns: List<ActionHandlerConfig>

The before/after and sanity check action handlers configured for this import, resolved from the request parameters against the handlers registered with the TableUploadManager.

addInvalidRow(List row, String errMsg)

Returns: void

Records a row that failed validation, prefixing it with the given error message and the row's mapped column values. Adds a header row first if this is the first invalid row recorded for the import.

ParameterDescription
rowthe raw row that failed validation
errMsgthe validation error message for this row

getDestFields()

Returns: List<DestFieldV2>

The destination fields a source row can be mapped to for this import, resolved lazily from the TableUploader on first use and cached for the rest of the import.

findDestField(String name)

Returns: DestFieldV2

Looks up a destination field by its name.

ParameterDescription
namethe destination field's name

getColumnInfo()

Returns: List<ColumnInfo>

The mapped source columns for this import, one entry per mapped column index, sorted by column index. Each entry carries the column's index, its destination field name and the field's display title. Resolved lazily on first use and cached for the rest of the import.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.