Package de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.messagemapping
Class BackendMessageMapperImpl
java.lang.Object
de.hybris.platform.sap.sapordermgmtbol.transaction.salesdocument.backend.impl.messagemapping.BackendMessageMapperImpl
- All Implemented Interfaces:
BackendMessageMapper
Maps backend messages to BOL messages (with a replaced text or a replaced severity). Refer to messages.xml
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final charIndicates that message reflects a fatal errorprotected static final charIndicates that message reflects an errorprotected static final charIndicates that message reflects an informationprotected static final charIndicates that message reflects a success informationprotected static final charIndicates that message reflects a warningprotected GenericFactoryFactory to access SAP session beansprotected MessageMappingRulesContainerContainer for message mapping rules, parsed from messages.xmlprotected static final Log4JWrapperLogging instance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BackendMessagecreateBackendMessage(com.sap.conn.jco.JCoRecord struct) Creates new message based on a JCO structureprotected BusinessObjectfindReferredBO(BusinessObject rootBo, BackendMessage msg) Find BO a message belongs toprotected booleanDoes message belong to a child BO?protected booleanDoes message refer to the root BO?map(BusinessObject rootBo, com.sap.conn.jco.JCoRecord struct) Maps messages contained in the provided table structure to a BO.voidmap(BusinessObject rootBo, com.sap.conn.jco.JCoRecord singleMsg, com.sap.conn.jco.JCoTable msgTable) Maps messages contained in the provided table and/or structure to a BO.protected static intmsgTypeBe2Java(String msgType) Convert external message type to internal.protected OrderMgmtMessagepassMessage(BackendMessage beMsg) Parses messagevoidsetGenericFactory(GenericFactory genericFactory) protected static intseverityScale(char beSeverity) Returns a relative scale of severity.protected voidTransfers attributes from a backend message to a transformed one (reference key, parameters)protected OrderMgmtMessagetransformMessageByRule(BackendMessage beMsg, MessageMappingRule rule) Transforms a message from backend applying the rules from messages.xml
-
Field Details
-
sapLogger
Logging instance -
genericFactory
Factory to access SAP session beans -
BAPI_RETURN_ERROR
protected static final char BAPI_RETURN_ERRORIndicates that message reflects an error- See Also:
-
BAPI_RETURN_WARNING
protected static final char BAPI_RETURN_WARNINGIndicates that message reflects a warning- See Also:
-
BAPI_RETURN_INFO
protected static final char BAPI_RETURN_INFOIndicates that message reflects an information- See Also:
-
BAPI_RETURN_ABORT
protected static final char BAPI_RETURN_ABORTIndicates that message reflects a fatal error- See Also:
-
BAPI_RETURN_SUCCESS
protected static final char BAPI_RETURN_SUCCESSIndicates that message reflects a success information- See Also:
-
messageMappingRulesContainer
Container for message mapping rules, parsed from messages.xml
-
-
Constructor Details
-
BackendMessageMapperImpl
public BackendMessageMapperImpl()Default constructor
-
-
Method Details
-
msgTypeBe2Java
Convert external message type to internal. Returns '0' if the message could not being converted.- Parameters:
msgType- message type external- Returns:
- message type internal
-
setGenericFactory
- Parameters:
genericFactory- Factory to access SAP session beans
-
map
public void map(BusinessObject rootBo, com.sap.conn.jco.JCoRecord singleMsg, com.sap.conn.jco.JCoTable msgTable) throws BackendException Description copied from interface:BackendMessageMapperMaps messages contained in the provided table and/or structure to a BO. Mapping is according to the rules defined in messages.xml- Specified by:
mapin interfaceBackendMessageMapper- Parameters:
rootBo- BO which gets the messagessingleMsg- Error structuremsgTable- Error table, typically of structure BAPIRET2- Throws:
BackendException
-
map
public Message map(BusinessObject rootBo, com.sap.conn.jco.JCoRecord struct) throws BackendException Description copied from interface:BackendMessageMapperMaps messages contained in the provided table structure to a BO. Mapping is according to the rules defined in messages.xml- Specified by:
mapin interfaceBackendMessageMapper- Parameters:
rootBo- BO which gets the messages- Returns:
- A BOL message
- Throws:
BackendException
-
createBackendMessage
Creates new message based on a JCO structure- Parameters:
struct- JCO structure- Returns:
- Backend message
-
transformMessageByRule
Transforms a message from backend applying the rules from messages.xml- Parameters:
beMsg- Backend messagerule- Rule- Returns:
- Transformed message
-
passMessage
Parses message- Parameters:
beMsg-- Returns:
- Transformed message
-
takeOverAllwaysPassedAttributes
Transfers attributes from a backend message to a transformed one (reference key, parameters)- Parameters:
beMsg- Backend messagemsg- Transformed message
-
isMessageReferRootBO
Does message refer to the root BO?- Parameters:
bo- Business object which might contain childsmsg- Backend message- Returns:
- Belongs to root?
-
isMessageReferChildBO
Does message belong to a child BO?- Parameters:
bo- Business object, might contain childsmsg- Backend message- Returns:
- Belongs to a child?
-
findReferredBO
Find BO a message belongs to- Parameters:
rootBo- Business object, might contain childsmsg- Backend message- Returns:
- The BO a message belongs to (either root or a child)
-
severityScale
protected static int severityScale(char beSeverity) Returns a relative scale of severity.Concrete value is unimportant. Defined for severity comparison.
- Parameters:
beSeverity- Severity- Returns:
- Scale
-