The StandardBusinessDocumentMessage (document message or SBDM), represents a collection of business documents and header information, in a Request Message or a Response Message. More...
Typedefs | |
typedef struct _sbr_Sbdm | sbr_Sbdm |
The CSR SBDM object. More... | |
Functions | |
SBR_CSR_EXPORT const char * | sbr_sbdm_iid (sbr_Sbdm *sbdm) |
Return the unique id for the SBDM - this is a memory only value. More... | |
SBR_CSR_EXPORT sbr_eMsgSourceType | sbr_sbdm_msgsourcetype (sbr_Sbdm *sbdm) |
Indicates whether the sbdm is part of a request or response message. More... | |
SBR_CSR_EXPORT int | sbr_sbdm_setmessagetype (ato_Ctx *ctx, sbr_Sbdm *sbdm, const char *messagetype) |
Set the message type for this sbdm and request (request only). More... | |
SBR_CSR_EXPORT const char * | sbr_sbdm_messagetype (sbr_Sbdm *sbdm) |
Get the message type for this sbdm. More... | |
SBR_CSR_EXPORT int | sbr_sbdm_setparty (ato_Ctx *ctx, sbr_Sbdm *sbdm, sbr_eMsgPartyType partytype, const char *iddesignation, const char *idname) |
Set the other party details for this sbdm and request (request only). More... | |
SBR_CSR_EXPORT sbr_MsgParty * | sbr_sbdm_party (sbr_Sbdm *sbdm, sbr_eMsgPartyType partytype) |
Get the other party details for this sbdm. More... | |
SBR_CSR_EXPORT int | sbr_sbdm_doc_add (ato_Ctx *ctx, sbr_Sbdm *sbdm, sbr_Doc **doc, const char *validationuri, const char *governmentid, const char *businessid, time_t createtime) |
Create and add a new document object - use sbr_doc_setcontent() to add content (request only). More... | |
SBR_CSR_EXPORT int | sbr_sbdm_doc_remove (ato_Ctx *ctx, sbr_Sbdm *sbdm, sbr_Doc *doc) |
Remove the indicated document from the sbdm (request only) - not currently implemented. More... | |
SBR_CSR_EXPORT size_t | sbr_sbdm_doc_count (sbr_Sbdm *sbdm) |
Get the number of documents in this sbdm. More... | |
SBR_CSR_EXPORT void | sbr_sbdm_doc_iterator (sbr_Sbdm *sbdm, ato_Iterator **iter) |
Create an iterator for the collection of a documents - caller must free. More... | |
SBR_CSR_EXPORT sbr_Doc * | sbr_sbdm_doc_firstv (sbr_Sbdm *sbdm) |
Get the first document of the collection. More... | |
SBR_CSR_EXPORT sbr_Doc * | sbr_sbdm_doc_nextv (sbr_Sbdm *sbdm) |
Get the next document of the collection. More... | |
SBR_CSR_EXPORT sbr_MsgReceipt * | sbr_sbdm_receipt (sbr_Sbdm *sbdm) |
Get the receipt object for the sbdm (response only). More... | |
SBR_CSR_EXPORT const char * | sbr_sbdm_maxseveritycode (sbr_Sbdm *sbdm) |
Get the maxseveritycode for the sbdm (response only). More... | |
SBR_CSR_EXPORT size_t | sbr_sbdm_eventitem_count (sbr_Sbdm *sbdm) |
Get the number of event items (response only). More... | |
SBR_CSR_EXPORT void | sbr_sbdm_eventitem_iterator (sbr_Sbdm *sbdm, ato_Iterator **iter) |
Create an iterator for the collection of event items to use in an iterator (response only) - caller must free. More... | |
SBR_CSR_EXPORT sbr_MsgEventItem * | sbr_sbdm_eventitem_firstv (sbr_Sbdm *sbdm) |
Get the first event item of the collection (response only). More... | |
SBR_CSR_EXPORT sbr_MsgEventItem * | sbr_sbdm_eventitem_nextv (sbr_Sbdm *sbdm) |
Get the next event item of the collection (response only). More... | |
SBR_CSR_EXPORT size_t | sbr_sbdm_timestamp_count (sbr_Sbdm *sbdm) |
Get the number of timestamps. More... | |
SBR_CSR_EXPORT void | sbr_sbdm_timestamp_iterator (sbr_Sbdm *sbdm, ato_Iterator **iter) |
Create an iterator for the collection of timestamps - caller must free. More... | |
SBR_CSR_EXPORT sbr_MsgTimestamp * | sbr_sbdm_timestamp_firstv (sbr_Sbdm *sbdm) |
Get the first timestamp of the collection. More... | |
SBR_CSR_EXPORT sbr_MsgTimestamp * | sbr_sbdm_timestamp_nextv (sbr_Sbdm *sbdm) |
Get the next timestamp of the collection. More... | |
The StandardBusinessDocumentMessage (document message or SBDM), represents a collection of business documents and header information, in a Request Message or a Response Message.
While similar, the content differs depending on whether the message is a request or response (sbr_eMsgSourceType).
This is documented in the individual methods.
typedef struct _sbr_Sbdm sbr_Sbdm |
The CSR SBDM object.
Used when adding business documents to a request for submission to CSR - see sbr_Request. Used when extracting business documents from a response - see sbr_Response.
SBR_CSR_EXPORT const char * sbr_sbdm_iid | ( | sbr_Sbdm * | sbdm | ) |
Return the unique id for the SBDM - this is a memory only value.
sbdm | the StandardBusinessDocumentMessage object |
SBR_CSR_EXPORT sbr_eMsgSourceType sbr_sbdm_msgsourcetype | ( | sbr_Sbdm * | sbdm | ) |
Indicates whether the sbdm is part of a request or response message.
sbdm | the StandardBusinessDocumentMessage object |
SBR_CSR_EXPORT int sbr_sbdm_setmessagetype | ( | ato_Ctx * | ctx, |
sbr_Sbdm * | sbdm, | ||
const char * | messagetype | ||
) |
Set the message type for this sbdm and request (request only).
This will override the value in the template (StandardBusinessDocumentHeader:Message.Type.Text).
If this is a response sbdm then this will call will be ignored and will silently fail.
ctx | the current thread local Context. |
sbdm | the request object. |
messagetype | the messagetype string (e.g. "message.ping"). |
SBR_CSR_EXPORT const char * sbr_sbdm_messagetype | ( | sbr_Sbdm * | sbdm | ) |
Get the message type for this sbdm.
This will override any value in the template (StandardBusinessDocumentHeader:Message.Type.Text).
If this is a response sbdm then this will return NULL.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT int sbr_sbdm_setparty | ( | ato_Ctx * | ctx, |
sbr_Sbdm * | sbdm, | ||
sbr_eMsgPartyType | partytype, | ||
const char * | iddesignation, | ||
const char * | idname | ||
) |
Set the other party details for this sbdm and request (request only).
This will override any value in the template
If this is a response sbdm then this call will be ignored and will silently fail.
ctx | the current thread local Context. |
sbdm | the StandardBusinessDocumentMessage object. |
partytype | SBR_MSG_RECEIVER or SBR_MSG_SENDER - see sbr_eMsgPartyType |
iddesignation | the identifier designation string (e.g. "ato.gov.au"). |
idname | the party identifier name - for agencies use SBR_PARTYSCHEME_AGENCY (preset to 'AgencyInternetDomainName'). |
SBR_CSR_EXPORT sbr_MsgParty * sbr_sbdm_party | ( | sbr_Sbdm * | sbdm, |
sbr_eMsgPartyType | partytype | ||
) |
Get the other party details for this sbdm.
Use sbr_msgp_type() to determine if sender or receiver. Note that in a request the type will always be SBR_MSG_RECEIVER; and for a response it will always be SBR_MSG_SENDER.
sbdm | the StandardBusinessDocumentMessage object. |
partytype | SBR_MSG_RECEIVER or SBR_MSG_SENDER - see sbr_eMsgPartyType |
SBR_CSR_EXPORT int sbr_sbdm_doc_add | ( | ato_Ctx * | ctx, |
sbr_Sbdm * | sbdm, | ||
sbr_Doc ** | doc, | ||
const char * | validationuri, | ||
const char * | governmentid, | ||
const char * | businessid, | ||
time_t | createtime | ||
) |
Create and add a new document object - use sbr_doc_setcontent() to add content (request only).
This will return an error if called on a response.
This object will be free when the request is freed. Alternatively, it will be freed if sbr_sbdm_doc_remove() is called on the returned document object.
An appropriate sequence number is assigned.
ctx | the current thread local Context. |
sbdm | the StandardBusinessDocumentMessage object. |
doc | the address of the document object to create. Do not explictly free. |
validationuri | the validation uri |
governmentid | the government identifier |
businessid | a business specific identifier |
createtime | the time to assign as the create datetime. |
Remove the indicated document from the sbdm (request only) - not currently implemented.
This will return an error if called on a response.
The document object will be freed, so do not reference it after this call.
ctx | the current thread local Context. |
sbdm | the StandardBusinessDocumentMessage object. |
doc | the document object to free. |
SBR_CSR_EXPORT size_t sbr_sbdm_doc_count | ( | sbr_Sbdm * | sbdm | ) |
Get the number of documents in this sbdm.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT void sbr_sbdm_doc_iterator | ( | sbr_Sbdm * | sbdm, |
ato_Iterator ** | iter | ||
) |
Create an iterator for the collection of a documents - caller must free.
This is useful if a collection is being shared between threads and each thread has its own iterator.
If this is not the case then the sbr_sbdm_doc_firstv() and sbr_sbdm_doc_nextv() methods are simpler and this method can be ignored.
sbdm | the StandardBusinessDocumentMessage object. |
iter | the address of the iterator to create - *iter must be NULL. This will be NULL if there is no collection. |
Get the first document of the collection.
This also initialises the iterator associated with the current sbdm eventitems.
sbdm | the StandardBusinessDocumentMessage object. |
Get the next document of the collection.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT sbr_MsgReceipt * sbr_sbdm_receipt | ( | sbr_Sbdm * | sbdm | ) |
Get the receipt object for the sbdm (response only).
This will return NULL if called on a request sbdm.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT const char * sbr_sbdm_maxseveritycode | ( | sbr_Sbdm * | sbdm | ) |
Get the maxseveritycode for the sbdm (response only).
This will return NULL if called on a request sbdm.
This will be set to 'Information' in the case of no errors.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT size_t sbr_sbdm_eventitem_count | ( | sbr_Sbdm * | sbdm | ) |
Get the number of event items (response only).
This will return 0 if called on a request sbdm.
There will be at least one, even when there are no errors.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT void sbr_sbdm_eventitem_iterator | ( | sbr_Sbdm * | sbdm, |
ato_Iterator ** | iter | ||
) |
Create an iterator for the collection of event items to use in an iterator (response only) - caller must free.
This is useful if a collection is being shared between threads and each thread has its own iterator.
If this is not the case then the sbr_sbdm_eventitem_firstv() and sbr_sbdm_eventitem_nextv() methods are simpler and this method can be ignored.
This will return NULL if called on a request sbdm.
sbdm | the StandardBusinessDocumentMessage object. |
iter | the address of the iterator to create - *iter must be NULL. This will be NULL if there is no collection. |
SBR_CSR_EXPORT sbr_MsgEventItem * sbr_sbdm_eventitem_firstv | ( | sbr_Sbdm * | sbdm | ) |
Get the first event item of the collection (response only).
This also initialises the iterator associated with the current sbdm eventitems.
This will return NULL if called on a request sbdm.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT sbr_MsgEventItem * sbr_sbdm_eventitem_nextv | ( | sbr_Sbdm * | sbdm | ) |
Get the next event item of the collection (response only).
This will return NULL if called on a request sbdm.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT size_t sbr_sbdm_timestamp_count | ( | sbr_Sbdm * | sbdm | ) |
Get the number of timestamps.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT void sbr_sbdm_timestamp_iterator | ( | sbr_Sbdm * | sbdm, |
ato_Iterator ** | iter | ||
) |
Create an iterator for the collection of timestamps - caller must free.
This is useful if a collection is being shared between threads and each thread has its own iterator.
If this is not the case then the sbr_sbdm_timestamp_firstv() and sbr_sbdm_timestamp_nextv() methods are simpler and this method can be ignored.
sbdm | the StandardBusinessDocumentMessage object. |
iter | the address of the iterator to create - *iter must be NULL. This will be NULL if there is no collection. |
SBR_CSR_EXPORT sbr_MsgTimestamp * sbr_sbdm_timestamp_firstv | ( | sbr_Sbdm * | sbdm | ) |
Get the first timestamp of the collection.
This also initialises the iterator associated with the current sbdm timestamps.
sbdm | the StandardBusinessDocumentMessage object. |
SBR_CSR_EXPORT sbr_MsgTimestamp * sbr_sbdm_timestamp_nextv | ( | sbr_Sbdm * | sbdm | ) |
Get the next timestamp of the collection.
sbdm | the StandardBusinessDocumentMessage object. |