The Agent manages the data it represents by the QmfAgentData class - a derivative of the QmfData class.
The Agent is responsible for managing the values of the properties within the object, as well as servicing the object's method calls. Unlike the Console, the Agent has full control of the state of the object.
In most cases, for efficiency, it is expected that Agents would actually manage objects that are subclasses of QmfAgentData and maintain subclass specific properties as primitives, only actually explicitly setting the underlying Map properties via setValue() etc. when the object needs to be "serialised". This would most obviously be done by extending the mapEncode() method (noting that it's important to call QmfAgentData's mapEncode() first via super.mapEncode(); as this will set the state of the underlying QmfData).
This class provides a number of methods aren't in the QMF2 API per se, but they are used to manage the association between a managed object and any subscriptions that might be interested in it.
The diagram below shows the relationship between the Subscription and QmfAgentData.
In particular the QmfAgentData maintains references to active subscriptions to allow agents to asynchronously push data to subscribing Consoles immediately that data becomes available.
The update() method indicates that the object's state has changed and the publish() method immediately sends the new state to any subscription.
The original intention was to "auto update" by calling these from the setValue() method. Upon reflection this seems a bad idea, as in many cases there may be several properties that an Agent may wish to change which would lead to unnecessary calls to currentTimeMillis(), but also as theSubscription update is run via a TimerTask it is possible that an update indication could get sent part way through setting an object's overall state. Similarly calling the publish() method directly from setValue() would force an update indication on partial changes of state, which is generally not the desired behaviour.
@author Fraser Adams