Package com.highdeal.hci
Class MessageHeader
java.lang.Object
com.highdeal.hci.MessageHeader
- All Implemented Interfaces:
XMLMarshallable
This
Java class represents the header of a message sent via HCI sent by your client application to a connected SAP CC Core Server system; It
includes information about the message originator and specifies the processing mode (TRANSACTION_ALL)
of the operation requests that are included in the sent message body.
The message header MessageHeader contains:
- A
message originator, that is who (or what) sends the message, and the mean to authenticate it. - A transaction mode (all, first fail, most, or try), that describes how the service operations contained in the body should be executed by the connected SAP CC system. This processing mode is very important and changes the behavior of the connected SAP CC system.
Important Note
Make sure you specify the transaction mode that is relevant with your business requirements.
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="header">
<xs:complexType>
<xs:sequence>
<xs:element ref="originator" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="transaction" type="TransactionBehaviorType" default="all"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="TransactionBehaviorType">
<xs:restriction base="xs:string">
<xs:enumeration value="all"/>
<xs:enumeration value="firstFail"/>
<xs:enumeration value="most"/>
<xs:enumeration value="try"/>
</xs:restriction>
</xs:simpleType>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThisenumerationlists the transaction modes used by the SAP CC system to process the received operation messages and the service operations that are included in thesemessage envelopes. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MessageHeader.TransactionModeIn this transaction mode, all or none of the operations are executed by the SAP CC system.static final MessageHeader.TransactionModeIn this transaction mode, all operations are executed until the first that fails.static final MessageHeader.TransactionModeIn this transaction mode, the operations are executed even if some of them failed.static final MessageHeader.TransactionModeIn this transaction model, no operation is executed, they are only tried. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharacterData(String cData) Adds character data to the content element.voidaddChild(String tagName, XMLMarshallable child) Adds a child to the objects, thechildrepresents the marshallable object to be added into the content tree.Returns the originator of this header.Returns the processing mode of the operation requests included in the message body.voidmarshal(XMLOutputter output) Gives an XML representation of this object, and of its children.voidsetAttributes(XMLAttributes atts) Sets the attributes of the XML representation of the tag being processed.voidSets the originator (your client application) for this message.voidSets the processing mode of the operation requests included in the message body; The connected SAP CC system receives the message and manages the requests depending on this execution mode.final StringtoString()
-
Field Details
-
TRANSACTION_ALL
In this transaction mode, all or none of the operations are executed by the SAP CC system. -
TRANSACTION_FIRST_FAIL
In this transaction mode, all operations are executed until the first that fails. -
TRANSACTION_MOST
In this transaction mode, the operations are executed even if some of them failed. -
TRANSACTION_TRY
In this transaction model, no operation is executed, they are only tried.
-
-
Constructor Details
-
MessageHeader
public MessageHeader()
-
-
Method Details
-
getTransactionMode
Returns the processing mode of the operation requests included in the message body.- Returns:
- The transaction mode specified in this header
-
setTransactionMode
Sets the processing mode of the operation requests included in the message body; The connected SAP CC system receives the message and manages the requests depending on this execution mode.The available operation processing modes are:
all, that means that all the operations should be executed, or none if one of them fails,firstFail, that means that the operations are executed until one of them fails,most, that means that all the operations that can be done should be done,try, that means that all the operations are not done, but only attempted.
- Parameters:
mode- The execution mode for the operation requests- See Also:
-
getOriginator
Returns the originator of this header.- Returns:
- The originator of this message
-
setOriginator
Sets the originator (your client application) for this message.- Parameters:
o- The originator of this message
-
setAttributes
Sets the attributes of the XML representation of the tag being processed.- Specified by:
setAttributesin interfaceXMLMarshallable- Parameters:
atts- The XML attributes of the current tag
-
addChild
Adds a child to the objects, thechildrepresents the marshallable object to be added into the content tree.- Specified by:
addChildin interfaceXMLMarshallable- Parameters:
tagName- The name of tag for the childchild- The child to be added
-
addCharacterData
Adds character data to the content element.- Specified by:
addCharacterDatain interfaceXMLMarshallable- Parameters:
cData- The character data to be added
-
marshal
Gives an XML representation of this object, and of its children.- Specified by:
marshalin interfaceXMLMarshallable- Parameters:
output- The XML output to marshal the object into
-
toString
-