Cisco Cisco Configuration Engine 3.5 Entwickleranleitung

Seite von 344
4-18
Cisco Configuration Engine Software Development Kit API Reference and Programmer Guide 3.5
OL-17661-02
Chapter 4      Namespace Mapping Service
NSM Client API Reference
const char *event,
int action,
int element);
Description:
After the resolve() function has returned, the NSMResult object will contain all of the event strings that 
have been mapped by your network administrator to the string in the event argument and that are 
applicable to the device identified by the dev_id argument. The function will return FAILURE if any one 
of the following is true:
  •
Action is not PUBLISH or SUBSCRIBE
  •
Element is not DEVICE or GROUP
  •
Result is NULL
Parameters
result – a NSMResult object containing the mapped events after the function returns. Application needs 
to construct this object and pass in to resolve(). 
dev_id – string identifying the device or group (key string of the GroupItem object in the Namespace 
object model).
event – the Cisco IOS event for which you want to obtain mapped event strings.
action – SUBSCRIBE or PUBLISH 
element – indicates whether dev_id is a DEVICE or a GROUP.
Returns
SUCCESS or FAILURE
resolve()
The method provides the mechanism by which it actually resolves the original subject into one or more 
subjects, based on the namespace to which the client is “attached.” This uses the NSMResult and 
NSMResolveRequest objects.
Usage:
virtual int resolve(NSMResult &result, 
const NSMResolveRequest &request);
Description:
After the resolve() function has returned, the NSMResult object will contain all of the event strings that 
have been mapped by your network administrator. This is a variant of the above resolve() call. The 
request parameters are pass in to NSMResolveRequest object. The function will return FAILURE if any 
one of the following is true: 
  •
NSMResolveRequest.action is not PUBLISH or SUBSCRIBE 
  •
NSMResolveRequest.element is not DEVICE or GROUP
Parameters
result – a NSMResult object containing the mapped events after the function returns. Application needs 
to construct this object and pass in to resolve(). 
request – a NSMResolveRequest object that contains the dev_id, event, action and element.