Class DefaultImportProcessor
- java.lang.Object
-
- de.hybris.platform.impex.jalo.imp.DefaultImportProcessor
-
- All Implemented Interfaces:
ImportProcessor
- Direct Known Subclasses:
ConditionalImportProcessor
,ImpExImportJob.MyImportProcessor
,ImpExModifierTest.TestImportProcessor
,MultiThreadedImportProcessor
,TestImportProcessor
public class DefaultImportProcessor extends java.lang.Object implements ImportProcessor
-
-
Constructor Summary
Constructors Constructor Description DefaultImportProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected void
adjustSessionSettings()
protected void
assertTargetTypePermitted(HeaderDescriptor header, ComposedType targetType, ValueLine valueLine)
protected ImpExImportCUDHandler
createCUDHandler(ImpExImportReader reader)
protected ExistingItemResolver
createExistingItemsResolver(HeaderDescriptor header, boolean useCache)
protected void
debug(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.debug(Object)
method directprotected void
enableLegacyFlagWhenLineIsUsingJaloOnlyFeatures(ValueLine line)
protected void
error(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.error(Object)
method directprotected SessionContext
getCreationContext(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)
protected ExistingItemResolver
getExistingItemResolver(ValueLine valueLine)
ImpExImportCUDHandler
getHandlerForLine(ValueLine line)
protected Language
getLanguage(StandardColumnDescriptor columnDescriptor)
ImpExImportReader
getReader()
protected java.lang.String
getSavedValuesMessage(SavedValues savedValues, Item existingItem, ValueLine valueLine)
protected ValueLineTranslator
getValueLineTranslator(ValueLine valueLine)
protected void
handleExceptionDuringImport(ValueLine valueLine, java.lang.Exception e, ImpExProcessModeEnum mode, java.lang.String message)
protected boolean
hasUnresolvedMandatoryOrInitialColumns(java.util.Collection<StandardColumnDescriptor> columns, ValueLine valueLine)
protected void
info(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.info(Object)
method directvoid
init(ImpExImportReader reader)
protected boolean
isDebugEnabled()
Deprecated.since ages - use the loggerCategory.isDebugEnabled()
method directprotected boolean
isInfoEnabled()
Deprecated.since ages - use the loggerCategory.isInfoEnabled()
method directprotected void
logExceptionDuringImport(java.lang.Exception e, java.lang.String message)
protected Item
processInsertLine(ValueLine valueLine, HeaderDescriptor header, ComposedType targetType)
protected Item
processInsertLine(java.util.Collection<Item> existingItems, ValueLine valueLine, ComposedType targetType)
protected Item
processInsertLineInternal(java.util.Collection<Item> existingItems, ValueLine valueLine, ComposedType targetType)
protected Item
processItemCreation(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)
Item
processItemData(ValueLine valueLine)
Item
processItemData_Impl(ValueLine valueLine)
Item
processItemData_TX(ValueLine valueLine)
protected void
processItemRemoval(Item toRemove, ValueLine valueLine)
protected void
processItemUpdate(Item toUpdate, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)
protected void
processRemoveLine(Item item, ValueLine valueLine, HeaderDescriptor header)
protected Item
processRemoveLine(java.util.Collection<Item> existingItems, ValueLine valueLine)
protected void
processUpdateLine(Item item, ValueLine valueLine, HeaderDescriptor header, ComposedType targetType)
protected void
restoreSessionSettings()
protected boolean
shouldRetryAfterException(java.lang.Exception exception, ImpExProcessModeEnum mode)
protected void
throwImpExOrRuntimeException(java.lang.Exception e)
protected java.util.Map<java.lang.String,java.lang.Object>
translateValueMappings(Item existingItem, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings)
protected void
warn(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.warn(Object)
method direct
-
-
-
Method Detail
-
init
public void init(ImpExImportReader reader)
- Specified by:
init
in interfaceImportProcessor
-
createCUDHandler
protected ImpExImportCUDHandler createCUDHandler(ImpExImportReader reader)
-
getHandlerForLine
public ImpExImportCUDHandler getHandlerForLine(ValueLine line)
-
enableLegacyFlagWhenLineIsUsingJaloOnlyFeatures
protected void enableLegacyFlagWhenLineIsUsingJaloOnlyFeatures(ValueLine line)
-
getReader
public ImpExImportReader getReader()
-
adjustSessionSettings
protected void adjustSessionSettings()
-
restoreSessionSettings
protected void restoreSessionSettings()
-
processItemData
public Item processItemData(ValueLine valueLine) throws ImpExException
- Specified by:
processItemData
in interfaceImportProcessor
- Throws:
ImpExException
-
processItemData_TX
public Item processItemData_TX(ValueLine valueLine) throws ImpExException
- Throws:
ImpExException
-
processItemData_Impl
public Item processItemData_Impl(ValueLine valueLine) throws ImpExException
- Throws:
ImpExException
-
assertTargetTypePermitted
protected void assertTargetTypePermitted(HeaderDescriptor header, ComposedType targetType, ValueLine valueLine) throws InsufficientDataException
- Throws:
InsufficientDataException
-
processRemoveLine
protected Item processRemoveLine(java.util.Collection<Item> existingItems, ValueLine valueLine) throws ImpExException
- Throws:
ImpExException
-
processInsertLine
protected Item processInsertLine(java.util.Collection<Item> existingItems, ValueLine valueLine, ComposedType targetType) throws ImpExException
- Throws:
ImpExException
-
processInsertLineInternal
protected Item processInsertLineInternal(java.util.Collection<Item> existingItems, ValueLine valueLine, ComposedType targetType) throws ImpExException
- Throws:
ImpExException
-
processInsertLine
protected Item processInsertLine(ValueLine valueLine, HeaderDescriptor header, ComposedType targetType) throws ImpExException
- Throws:
ImpExException
-
throwImpExOrRuntimeException
protected void throwImpExOrRuntimeException(java.lang.Exception e) throws ImpExException
- Throws:
ImpExException
-
handleExceptionDuringImport
protected void handleExceptionDuringImport(ValueLine valueLine, java.lang.Exception e, ImpExProcessModeEnum mode, java.lang.String message) throws ImpExException
- Throws:
ImpExException
-
logExceptionDuringImport
protected void logExceptionDuringImport(java.lang.Exception e, java.lang.String message)
-
shouldRetryAfterException
protected boolean shouldRetryAfterException(java.lang.Exception exception, ImpExProcessModeEnum mode)
-
processUpdateLine
protected void processUpdateLine(Item item, ValueLine valueLine, HeaderDescriptor header, ComposedType targetType) throws InsufficientDataException, ImpExException
-
processRemoveLine
protected void processRemoveLine(Item item, ValueLine valueLine, HeaderDescriptor header) throws ImpExException
- Throws:
ImpExException
-
hasUnresolvedMandatoryOrInitialColumns
protected boolean hasUnresolvedMandatoryOrInitialColumns(java.util.Collection<StandardColumnDescriptor> columns, ValueLine valueLine)
-
getSavedValuesMessage
protected java.lang.String getSavedValuesMessage(SavedValues savedValues, Item existingItem, ValueLine valueLine)
-
processItemRemoval
protected void processItemRemoval(Item toRemove, ValueLine valueLine) throws ConsistencyCheckException
- Throws:
ConsistencyCheckException
-
processItemUpdate
protected void processItemUpdate(Item toUpdate, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine) throws ImpExException
- Throws:
ImpExException
-
getCreationContext
protected SessionContext getCreationContext(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)
-
processItemCreation
protected Item processItemCreation(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine) throws ImpExException
- Throws:
ImpExException
-
translateValueMappings
protected java.util.Map<java.lang.String,java.lang.Object> translateValueMappings(Item existingItem, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings) throws ImpExException
- Throws:
ImpExException
-
isDebugEnabled
@Deprecated protected boolean isDebugEnabled()
Deprecated.since ages - use the loggerCategory.isDebugEnabled()
method directChecks if the debug method of the reader is enabled or if no reader set the logger will be checked.- Returns:
- is debug mode enabled?
-
debug
@Deprecated protected void debug(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.debug(Object)
method directDebugs a message with the reader or the current logger instance.- Parameters:
msg
- debug message
-
isInfoEnabled
@Deprecated protected boolean isInfoEnabled()
Deprecated.since ages - use the loggerCategory.isInfoEnabled()
method directChecks if the info method of the reader is enabled or if no reader set the logger will be checked.- Returns:
- is info mode enabled?
-
info
@Deprecated protected void info(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.info(Object)
method directLogs an info message with the reader or the current logger instance.- Parameters:
msg
- info message
-
warn
@Deprecated protected void warn(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.warn(Object)
method directLogs an warn message with the reader or the current logger instance.- Parameters:
msg
- warn message
-
error
@Deprecated protected void error(java.lang.String msg)
Deprecated.since ages - use the loggerCategory.error(Object)
method directLogs an error message with the reader or the current logger instance.- Parameters:
msg
- error message
-
getLanguage
protected Language getLanguage(StandardColumnDescriptor columnDescriptor) throws InsufficientDataException, HeaderValidationException
-
getValueLineTranslator
protected ValueLineTranslator getValueLineTranslator(ValueLine valueLine)
-
getExistingItemResolver
protected ExistingItemResolver getExistingItemResolver(ValueLine valueLine) throws HeaderValidationException
- Throws:
HeaderValidationException
-
createExistingItemsResolver
protected ExistingItemResolver createExistingItemsResolver(HeaderDescriptor header, boolean useCache) throws HeaderValidationException
- Throws:
HeaderValidationException
-
-