public class MBusinessDocument extends MRegistryObjectWithProperties
When an application sends a message to another application, it could send pure data. In many cases, however, it is useful to include context for the data that allow the receiving and sending application to share information that is not part of the data.
Typically, the application itself defines the context. That means, however, that each sending and receiving application have to agree on the format for the context. This class encapsulates a specification of such a context, which can be used to provide uniformity, for example in integration scenarios where several adapters work together.
You must import BusinessDocument.dat
into the repository. If you use
the MBusinessDocument()
constructor and if the repository
does not contain the MBusinessDocument
class definition at
/tibco/public/class/ae/baseDocument/MBusinessDocument
, the SDK
throws MRuntimeException
.
This class allows applications to include information about the
structure and other aspects of the data that is sent. The
MBusinessDocument
class is useful for complex business events
in a standard format. The class can have data sections which
are accessible with its get()
and set()
methods.
The following static variables describe the confirmation code for
this MBusinessDocument
:
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
M_BD_APPLICATION_CONTEXT |
static java.lang.String |
M_BD_APPLICATION_ID |
static java.lang.String |
M_BD_APPLICATION_INSTANCE_ID |
static java.lang.String |
M_BD_COMPONENT_ID |
static java.lang.String |
M_BD_CONFIRM_CODE |
static java.lang.String |
M_BD_DATA |
static java.lang.String |
M_BD_DATA_SECTION |
static java.lang.String |
M_BD_DATE_TIME_STAMP |
static java.lang.String |
M_BD_ENCRYPTED |
static java.lang.String |
M_BD_ERROR_ADDRESS |
static java.lang.String |
M_BD_LOT_END |
static java.lang.String |
M_BD_LOT_ID |
static java.lang.String |
M_BD_LOT_ITEM |
static java.lang.String |
M_BD_NAME |
static java.lang.String |
M_BD_OPERATION_CODE |
static java.lang.String |
M_BD_REFERENCE_ID |
static java.lang.String |
M_BD_REPLY_ADDRESS |
static java.lang.String |
M_BD_VERBCODE |
static java.lang.String |
M_BD_VERSION |
static java.lang.String |
M_BUSINESS_DOCUMENT |
static java.lang.String |
M_DATA_SECTION |
static int |
M_Delete |
static int |
M_Insert |
static int |
M_Insert_or_Update |
static int |
M_Not_Required |
static int |
M_Required |
static int |
M_Required_on_Error |
static java.lang.String |
M_SEQ_OF_DATA_SECTION |
static int |
M_Update |
Constructor and Description |
---|
MBusinessDocument(MClassRegistry registry)
Create an empty
MBusinessDocument . |
MBusinessDocument(MClassRegistry registry,
MTree data)
Deserialize a previously serialized
MBusinessDocument that
is specified by the reg argument. |
MBusinessDocument(MClassRegistry registry,
java.lang.String className)
Create an
MBusinessDocument with the specified name. |
MBusinessDocument(MInstance instance)
Encapsulate an existing
MInstance as an MBusinessDocument . |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(MBusinessDocument bus) |
java.lang.Object |
get(java.lang.String attribName)
generic get is used for getting userdefined attribs
|
java.lang.Object |
getApplicationContext()
Return the sender context.
|
java.lang.String |
getApplicationId()
Return the application ID, such as R/3 Adapter or Clarify Adapter.
|
java.lang.String |
getApplicationInstanceId()
An application Instance ID that identifies the running instance.
|
java.lang.String |
getComponentId()
Get the component ID for this business document.
|
int |
getConfirmationCode()
Return the input parameter.
|
java.lang.Object |
getDataSection(int index)
Deprecated.
as of Java SDK 3.0
|
int |
getDataSectionCode(int index)
Deprecated.
as of Java SDK 3.0
the new supported method is getVerbCode()
|
int |
getDataSectionCount()
Deprecated.
as of Java SDK 3.0
|
java.util.Date |
getDateTimeStamp()
Return the creation time for this business document.
|
java.lang.Boolean |
getEncryption()
Return the encryption flag, which indicates if the data is encrypted.
|
java.lang.String |
getErrorAddress()
Return the reply subject for communicating errors back.
|
MInstance |
getInstance()
Deprecated.
internal use only - do not document
|
java.lang.Boolean |
getLotEnd()
Return the
LotEnd attribute, a boolean that indicates
whether a message is at the end of a lot. |
java.lang.String |
getLotId()
Return the lot ID.
|
int |
getLotItem()
Return the lot item from this document.
|
java.lang.String |
getName()
Return the name of the business document instance.
|
java.lang.String |
getReferenceId()
Return the unique identifier (GUID) for this business document instance.
|
java.lang.String |
getReplyAddress()
Return the reply subject for communicating results back to
the business document.
|
MTrackingInfo |
getTrackingInfo() |
int |
getVerbCode()
Retrieve the
verbCode attribute from this business document. |
int |
getVersion()
Return the version information for this business document.
|
MTree |
serialize()
Serialize this
MBusinessDocument instance for network transmission. |
MTree |
serialize(int formatHint)
Serialize this
MBusinessDocument instance for network transmission. |
void |
set(java.lang.String attribName,
java.lang.Object value)
generic set is used for setting userdefined attribs
|
void |
setApplicationContext(java.lang.Object data)
Set the sender context/closure.
|
void |
setApplicationId(java.lang.String applicationId)
Set the application ID, for example, R/3 adapter.
|
void |
setApplicationInstanceId(java.lang.String applicationInstanceId)
Set the instance id (incarnation id) of the process creating the business
document.
|
void |
setComponentId(java.lang.String componentId)
Set the component ID for this business document.
|
void |
setConfirmationCode(int confirmCode)
Allow you to specify whether confirmation is required.
|
void |
setDataSection(int vcode,
java.lang.Object mdata)
Deprecated.
as of TIBCO Adapter SDK 3.0
|
void |
setDateTimeStamp(java.util.Date datetime)
Set the business document creation time.
|
void |
setEncryption(boolean encrypted)
Set the encryption flag which indicates if data is encrypted.
|
void |
setErrorAddress(java.lang.String errorAddress)
Set the reply subject for communicating errors back.
|
void |
setLotEnd(java.lang.Boolean lotEnd)
Set the lot end attribute in this document.
|
void |
setLotId(java.lang.String lotId)
Allow grouping of related events by using the same lot ID.
|
void |
setLotItem(int lotItem)
Set the lot item.
|
void |
setName(java.lang.String name)
Set the name of the business document instance.
|
void |
setReferenceId(java.lang.String referenceId)
Set a unique identifier (GUID) for this business document.
|
void |
setReplyAddress(java.lang.String replyAddress)
Set the reply subject for communicating results back.
|
void |
setTrackingInfo(MTrackingInfo p_trackingInfo) |
void |
setVerbCode(int verbCode)
Set the verb code attribute in this document.
|
void |
setVersion(int version)
Set the version information for this business document.
|
java.lang.String |
toString() |
addProperty, getProperties, getProperty, getPropertyCount, getPropertyNames, getRegistry, isOK, isOK
public static final java.lang.String M_BUSINESS_DOCUMENT
public static final java.lang.String M_DATA_SECTION
public static final java.lang.String M_SEQ_OF_DATA_SECTION
public static final java.lang.String M_BD_NAME
public static final java.lang.String M_BD_VERSION
public static final java.lang.String M_BD_REFERENCE_ID
public static final java.lang.String M_BD_DATE_TIME_STAMP
public static final java.lang.String M_BD_APPLICATION_ID
public static final java.lang.String M_BD_APPLICATION_INSTANCE_ID
public static final java.lang.String M_BD_LOT_ID
public static final java.lang.String M_BD_LOT_ITEM
public static final java.lang.String M_BD_LOT_END
public static final java.lang.String M_BD_COMPONENT_ID
public static final java.lang.String M_BD_ENCRYPTED
public static final java.lang.String M_BD_REPLY_ADDRESS
public static final java.lang.String M_BD_ERROR_ADDRESS
public static final java.lang.String M_BD_CONFIRM_CODE
public static final java.lang.String M_BD_OPERATION_CODE
public static final java.lang.String M_BD_APPLICATION_CONTEXT
public static final java.lang.String M_BD_DATA_SECTION
public static final java.lang.String M_BD_DATA
public static final java.lang.String M_BD_VERBCODE
public static final int M_Not_Required
public static final int M_Required_on_Error
public static final int M_Required
public static final int M_Insert
public static final int M_Update
public static final int M_Delete
public static final int M_Insert_or_Update
public MBusinessDocument(MClassRegistry registry)
MBusinessDocument
.
You must import BusinessDocument.dat
in the repository.
If you use this constructor and if the repository does not contain
the MBusinessDocument
class definition at
/tibco/public/class/ae/baseDocument/MBusinessDocument
,
the SDK throws MRuntimeException
.
registry
- Class registry for which this MBusinessDocument
is createdpublic MBusinessDocument(MClassRegistry registry, java.lang.String className)
MBusinessDocument
with the specified name.registry
- Class registry for which this MBusinessDocument
is createdclassName
- Name of the class that describes this MBusinessDocument
.MBusinessDocument(MClassRegistry)
public MBusinessDocument(MClassRegistry registry, MTree data)
MBusinessDocument
that
is specified by the reg
argument.registry
- Class registry for which this MBusinessDocument
is createddata
- MTree
representing a previously serialized MBusinessDocument
.MBusinessDocument(MClassRegistry)
public MBusinessDocument(MInstance instance)
MInstance
as an MBusinessDocument
.instance
- Instance to encapsulate.MBusinessDocument(MClassRegistry)
public void setName(java.lang.String name) throws MException
MException
public void setVersion(int version) throws MException
MException
public void setReferenceId(java.lang.String referenceId) throws MException
MException
public void setDateTimeStamp(java.util.Date datetime) throws MException
MException
public void setApplicationId(java.lang.String applicationId) throws MException
MException
public void setApplicationInstanceId(java.lang.String applicationInstanceId) throws MException
MException
public void setLotId(java.lang.String lotId) throws MException
MException
public void setLotItem(int lotItem) throws MException
MException
public void setLotEnd(java.lang.Boolean lotEnd) throws MException
Boolean
value that identifies whether this message is the end of a lot.MException
public void setEncryption(boolean encrypted) throws MException
MException
public void setReplyAddress(java.lang.String replyAddress) throws MException
MException
public void setErrorAddress(java.lang.String errorAddress) throws MException
MException
public void setConfirmationCode(int confirmCode) throws MException
MBusinessDocument.M_Not_Required = 1
MBusinessDocument.M_Required_on_Error = 2
MBusinessDocument.M_Required = 3
(Required, regardless of success or failure). MException
public void setApplicationContext(java.lang.Object data) throws MException
MException
public void setVerbCode(int verbCode) throws MException
M_Insert
M_Update
M_Delete
M_Insert_or_Update
(update existing record or insert new record
if it does not exist.)MException
public void setComponentId(java.lang.String componentId) throws MException
componentId
can be used to specify more precisely which component is the source of the
business document. The componentId
complements the ApplicationId
and ApplicationInstanceId
attributes.MException
public java.lang.Object get(java.lang.String attribName) throws MException
MException
public void set(java.lang.String attribName, java.lang.Object value) throws MException
MException
public void setDataSection(int vcode, java.lang.Object mdata) throws MException
MException
public java.lang.String getName() throws MException
MException
- if the named attribute is not defined for this instance.public int getVersion() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.String getReferenceId() throws MException
MException
- if the named attribute is not defined for this instance.public java.util.Date getDateTimeStamp() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.String getApplicationId() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.String getLotId() throws MException
MException
- if the named attribute is not defined for this instance.public int getLotItem() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.Boolean getLotEnd() throws MException
LotEnd
attribute, a boolean that indicates
whether a message is at the end of a lot.MException
- if the named attribute is not defined for this instance.public java.lang.String getApplicationInstanceId() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.Boolean getEncryption() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.String getReplyAddress() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.String getErrorAddress() throws MException
MException
- if the named attribute is not defined for this instance.public java.lang.Object getApplicationContext() throws MException
MException
- if the named attribute is not defined for this instance.public int getConfirmationCode() throws MException
MBusinessDocument.M_Not_Required = 1
MBusinessDocument.M_Required_on_Error = 2
MBusinessDocument.M_Required = 3
(Required regardless of success or failure). MException
- if the named attribute is not defined for this instance.public int getVerbCode() throws MException
verbCode
attribute from this business document.
This attribute provides suggested actions and is one of:
M_Insert
M_Update
M_Delete
M_Insert_or_Update
(update existing record or insert new record if it does not exist.)MException
- if the named attribute is not defined for this instance.public java.lang.String getComponentId() throws MException
componentId
can be used to specify more precisely which component is the source of
the business document. The componentId
complements the
ApplicationId
and ApplicationInstanceId
attributes.MException
- if the named attribute is not defined for this instance.public int getDataSectionCount() throws MException
MException
public java.lang.Object getDataSection(int index) throws MException
MException
public int getDataSectionCode(int index) throws MException
MException
public MTree serialize() throws MException
MBusinessDocument
instance for network transmission.MException
public MTree serialize(int formatHint) throws MException
MBusinessDocument
instance for network transmission.formatHint
- Required parameter specifying the message format.
Valid message format values are
MMessageFormat.AERV
- for AERV message formatMMessageFormat.XMLJMS
- for JMS XML message formatMMessageFormat.XMLRV
- for RV XML message formatMException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(MBusinessDocument bus)
public MInstance getInstance()
public void setTrackingInfo(MTrackingInfo p_trackingInfo)
public MTrackingInfo getTrackingInfo()