Class BatchRecord
java.lang.Object
com.broadleafcommerce.common.dataimport.messaging.BatchRecord
A logical record from the a flat file. This could have spanned multiple records from the flat
file if the logical "parent" record has dependents located within.
- Author:
- Phillip Verheyden (phillipuniverse)
-
Constructor Summary
ConstructorsConstructorDescriptionBatchRecord
(long lineNumber, String recordType, OperationType operation, String resourceTierIdentifier, Map<String, String> row) BatchRecord
(long lineNumber, String correlationId, String recordType, OperationType operation, String resourceTierIdentifier, Map<String, String> row) BatchRecord
(long lineNumber, String correlationId, String recordType, OperationType operation, String resourceTierIdentifier, Map<String, String> row, List<BatchRecord> dependents) BatchRecord
(long lineNumber, String recordType, Map<String, String> row) -
Method Summary
Modifier and TypeMethodDescriptionaddDependent
(BatchRecord dependent) Adds a new dependent to this recordprotected boolean
boolean
Identifier that allows the resource tier to map back responses to a record within the batchItems that should be conceptually linked to the parent record that represents this itemlong
The line number in the original data file that this item appears in.What operation should be performed on this record.In a multi-typed record file this holds the specific information of what was parsed out from the line in the file.The identifier for this record at the resource tier In the case of anOperationType.UPDATE
orOperationType.DELETE
then this is supplied up front within the original upload.getRow()
The row of data parsed out from the flat file.int
hashCode()
toString()
-
Constructor Details
-
BatchRecord
-
BatchRecord
-
BatchRecord
-
BatchRecord
-
BatchRecord
public BatchRecord(long lineNumber, String correlationId, String recordType, @Nullable OperationType operation, @Nullable String resourceTierIdentifier, Map<String, String> row, List<BatchRecord> dependents)
-
-
Method Details
-
addDependent
Adds a new dependent to this record- Parameters:
dependent
- record that is a dependent of this one- Returns:
- this parent record
-
getLineNumber
public long getLineNumber()The line number in the original data file that this item appears in. The numbering does not exclude any header lines at the start of the file. For instance, this generally means that all items in a CSV import will have a line number greater than or equal to 2, since line number 1 is the header line. -
getCorrelationId
Identifier that allows the resource tier to map back responses to a record within the batch -
getRecordType
In a multi-typed record file this holds the specific information of what was parsed out from the line in the file. For example in a product import there arePRODUCT
,VARIANT
,INCLUDED_PRODUCT
-
getOperation
What operation should be performed on this record. If this is anOperationType.CREATE
then consultresourceTierIdentifier
for what should be assigned to this record at the resource tier -
getResourceTierIdentifier
The identifier for this record at the resource tier In the case of anOperationType.UPDATE
orOperationType.DELETE
then this is supplied up front within the original upload. In the case ofOperationType.CREATE
then this is a generated id, or something that was mapped in via transformation from a correlation id -
getRow
The row of data parsed out from the flat file. Other pieces of the row in the file (such as record type and correlationId) are parsed out of this row and into other properties of this record -
getDependents
Items that should be conceptually linked to the parent record that represents this item -
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-