cciGetNodeAttribute
The cciGetNodeAttribute function returns the value of the specified attribute.
Syntax
CciSize cciGetNodeAttribute (int* returnCode,
CciNode* node,
CciChar* name,
CciChar* value,
CciSize length);
Parameters
- returnCode (output)
- Receives the return code from the function (output).
- CCI_INV_BUFFER_TOO_SMALL
The provided buffer was not large enough to hold the value of node's type.
- CCI_INV_BUFFER_TOO_SMALL
- node (input)
- This is a handle to a node.
- name (input)
- This is a pointer to a NULL-terminated string of CciChar specifying the name of the node attribute being queried.
- value (output)
- Address of a buffer, allocated by the caller to hold the value of the attribute.
- length
- The length, in CciChars, of the buffer allocated by the caller.
Return values
- If successful, the attribute value is copied into the supplied buffer and the number of CciChar characters copied is returned.
- If the buffer is not large enough to contain the attribute value, returnCode is set to CCI_BUFFER_TOO_SMALL, and the number of CciChars required is returned.
- If name specifies an attribute name that is not appropriate for the given node, returnCode is set to CCI_ATTRIBUTE_UNKOWN.
Example
void myPropagatedMessageCallback(
CciMessage* message,
CciMessage* localEnvironment,
CciMessage* exceptionList,
CciMessage* environment,
CciConnection* connection){
int rc = CCI_SUCCESS;
CciNode* sourceNode = cciGetSourceNode(&rc,
connection);
/*you should now check the rc for unexpected values*/
CciChar queueNameAttribute[16];
cciMbsToUcs(&rc,
"queueName",
queueNameAttribute,
16,
BIP_DEF_COMP_CCSID);
/*you should now check the rc for unexpected values*/
CciChar queueName [512];
sourceNodeQueueNameLength = cciGetNodeType(&rc,
sourceNode,
queueName,
512);
/*you should now check the rc for unexpected values*/
/*if rc is CCI_BUFFER_TOO_SMALL, resize and retry*/
/*sourceNodeQueueNameLength will hold the actual or required size */