Class MessageOriginator
- All Implemented Interfaces:
XMLMarshallable
Java class represents the originator of a message sent via the HCI technical interface
to a connected SAP CC Core Server system. It is the identifier of an SAP CC user
or the identifier of a user session.
If the user session management function is enabled in the SAP CC system (see the system parameter USER_SESSION_ENABLED), the
originator must contain both a user session ID and the ID of the SAP CC user. This identifier is generated by the SAP CC system
in response to a AuthenticateUserOp operation.
This identifies the enclosing envelope as being part of a user session.
Assignment Scope
The optional <onSystem/> or <onClient number="..."/> child element specifies
which user assignment to use for the request:
- Absent: backward compatible mode -- assignment inferred from the user's single assignment
<onSystem/>: explicit system scope<onClient number="100"/>: explicit client scope
Error Management
If an envelope is received by the SAP CC system with a user session identifier which does not correspond to any running user session,
an AuthenticationFailedException with the reason
invalid_session_id will be thrown.
If the user session identifier set in the originator corresponds to an existing user session, but the user specified in the
originator is not the same as the one recorded in the user session,
an AuthenticationFailedException with the reason
invalid_session_user will be thrown.
- See Also:
XML API for HCI
The XML APIs specify the following XSD fragment:
XSD Fragment
<xs:element name="originator">
<xs:complexType>
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element ref="auth"/>
<xs:element ref="authDelegated"/>
<xs:element ref="authToken"/>
<xs:element ref="authUserSession"/>
</xs:choice>
<xs:choice minOccurs="0" maxOccurs="1">
<xs:element ref="onSystem"/>
<xs:element ref="onClient"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="sessionId" type="xs:string"/>
</xs:complexType>
</xs:element>
-
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.Gets the authentication that this originator has provided.getName()The name of the message originator.Returns the<onClient>element, ornullif not specified.Gets the user session identifier.booleanReturns whether the originator requested system scope.booleanReturns whether an assignment scope (<onSystem/>or<onClient/>) was provided.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 authentication for this originator.voidSets the name of the message originator.voidsetOnClient(OnClientModel onClient) Sets the client scope.voidsetOnSystem(OnSystemModel onSystem) Sets the system scope.voidsetSessionId(String sessionId) Sets the user session identifier.
-
Constructor Details
-
MessageOriginator
public MessageOriginator()
-
-
Method Details
-
getName
The name of the message originator.- Returns:
- The name of the message originator
-
setName
Sets the name of the message originator.- Parameters:
n- The name of the message originator
-
getSessionId
-
setSessionId
Sets the user session identifier.- Parameters:
sessionId- The new user session identifier
-
getAuthentication
Gets the authentication that this originator has provided.- Returns:
- The authentication of this originator
-
setAuthentication
Sets the authentication for this originator.- Parameters:
auth- The authentication for this originator
-
isScopeProvided
public boolean isScopeProvided()Returns whether an assignment scope (<onSystem/>or<onClient/>) was provided.- Returns:
- true if an explicit scope was specified
-
isOnSystem
public boolean isOnSystem()Returns whether the originator requested system scope.- Returns:
- true if
<onSystem/>was specified
-
getOnClient
Returns the<onClient>element, ornullif not specified.- Returns:
- the OnClientModel element, or null
-
setOnSystem
Sets the system scope.- Parameters:
onSystem- the OnSystemModel element
-
setOnClient
Sets the client scope.- Parameters:
onClient- the OnClientModel element
-
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
-