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 voidadjustSessionSettings()protected voidassertTargetTypePermitted(HeaderDescriptor header, ComposedType targetType, ValueLine valueLine)protected ImpExImportCUDHandlercreateCUDHandler(ImpExImportReader reader)protected ExistingItemResolvercreateExistingItemsResolver(HeaderDescriptor header, boolean useCache)protected voiddebug(java.lang.String msg)Deprecated.since ages - use the loggerCategory.debug(Object)method directprotected voidenableLegacyFlagWhenLineIsUsingJaloOnlyFeatures(ValueLine line)protected voiderror(java.lang.String msg)Deprecated.since ages - use the loggerCategory.error(Object)method directprotected SessionContextgetCreationContext(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)protected ExistingItemResolvergetExistingItemResolver(ValueLine valueLine)ImpExImportCUDHandlergetHandlerForLine(ValueLine line)protected LanguagegetLanguage(StandardColumnDescriptor columnDescriptor)ImpExImportReadergetReader()protected java.lang.StringgetSavedValuesMessage(SavedValues savedValues, Item existingItem, ValueLine valueLine)protected ValueLineTranslatorgetValueLineTranslator(ValueLine valueLine)protected voidhandleExceptionDuringImport(ValueLine valueLine, java.lang.Exception e, ImpExProcessModeEnum mode, java.lang.String message)protected booleanhasUnresolvedMandatoryOrInitialColumns(java.util.Collection<StandardColumnDescriptor> columns, ValueLine valueLine)protected voidinfo(java.lang.String msg)Deprecated.since ages - use the loggerCategory.info(Object)method directvoidinit(ImpExImportReader reader)protected booleanisDebugEnabled()Deprecated.since ages - use the loggerCategory.isDebugEnabled()method directprotected booleanisInfoEnabled()Deprecated.since ages - use the loggerCategory.isInfoEnabled()method directprotected voidlogExceptionDuringImport(java.lang.Exception e, java.lang.String message)protected ItemprocessInsertLine(ValueLine valueLine, HeaderDescriptor header, ComposedType targetType)protected ItemprocessInsertLine(java.util.Collection<Item> existingItems, ValueLine valueLine, ComposedType targetType)protected ItemprocessInsertLineInternal(java.util.Collection<Item> existingItems, ValueLine valueLine, ComposedType targetType)protected ItemprocessItemCreation(ComposedType targetType, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)ItemprocessItemData(ValueLine valueLine)ItemprocessItemData_Impl(ValueLine valueLine)ItemprocessItemData_TX(ValueLine valueLine)protected voidprocessItemRemoval(Item toRemove, ValueLine valueLine)protected voidprocessItemUpdate(Item toUpdate, java.util.Map<StandardColumnDescriptor,java.lang.Object> attributeValueMappings, ValueLine valueLine)protected voidprocessRemoveLine(Item item, ValueLine valueLine, HeaderDescriptor header)protected ItemprocessRemoveLine(java.util.Collection<Item> existingItems, ValueLine valueLine)protected voidprocessUpdateLine(Item item, ValueLine valueLine, HeaderDescriptor header, ComposedType targetType)protected voidrestoreSessionSettings()protected booleanshouldRetryAfterException(java.lang.Exception exception, ImpExProcessModeEnum mode)protected voidthrowImpExOrRuntimeException(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 voidwarn(java.lang.String msg)Deprecated.since ages - use the loggerCategory.warn(Object)method direct
-
-
-
Method Detail
-
init
public void init(ImpExImportReader reader)
- Specified by:
initin 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:
processItemDatain 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
-
-