cniGetAttribute

Restriction: This function imposes a restriction on the length of the attribute value. This function is provided for backward compatibility only. You should implement cniGetAttribute2.
Start of changeThis function gets the value of an attribute on a specific node instance. It is invoked by the message broker as follows:
  • Before the nodes configuration is deployed in order to ascertain default values of any attributes that may override attributes owned by the framework.
  • After setting the deployed configuration in order to write the configuration to the Broker’s database. This ensures that the configuration persists across shutdown and restarts of the execution group
End of change
The responsibilities of the node at this point are to:
  1. Return a character representation of the attribute value.
  2. Throw an exception if an error occurs.
If both cniGetAttribute and cniGetAttribute2 are implemented, cniDefineNodeClass fails with CCI_INV_IMPL_FUNCTION.
Defined In Type Member
CNI_VFT Optional iFpGetAttribute

Syntax

int cniGetAttribute(
  CciContext*  context,
  CciChar*     attrName,
  CciChar*     buffer,
  int          bufsize);

Parameters

context
The address of the context for the instance of the node, as created by the node and returned by the cniCreateNodeContext function (input).
attrName
The name of the attribute for which the value is to be retrieved (input).
buffer
The address of a buffer into which the attribute value is copied (output).
bufsize
The length, in bytes, of the buffer specified in the buffer parameter (input).

Return values

If successful, zero is returned, and the character representation of the value of the attribute is returned in the specified buffer. If the name of the attribute does not identify one supported by the node, a non-zero value is returned.