Cisco Cisco Configuration Engine 3.5 Entwickleranleitung

Seite von 344
4-3
Cisco Configuration Engine Software Development Kit API Reference and Programmer Guide 3.5
OL-17661-02
Chapter 4      Namespace Mapping Service
Namespace Mapper
Subscriber mapping for R2:  abcd.load.R2, abcd.load./config/G1
Subscriber mapping for R3:  abcd.load.R3
The mapping (abcd.load) for R1 and R2 are specialized with the deviceId and groupId, because R1 and 
R2 belong to a group, whereas the mapping for R3 has been specialized with just the deviceId. Note that 
/config/G1 is referred to as the absolute groupId, indicating that group G1 is created right under the 
config namespace.
When an external application wants to publish to either of the devices individually, or address them as a 
group, it calls the Namespace Mapper passing in an application name as parameter (config). In either 
case, the Namespace Mapper specializes the mapping (abcd.load) with the ID of the individual device 
or the absolute group Id. 
For example, if an external application wants to send a config.load to device R2, it would query 
Namespace Mapper for the resulting map abcd.load.R2 to publish.
Alternatively, if an external application wants to send a config.load to the group /config/G1 (i.e., to both 
devices R1 and R2), it would query Namespace Mapper for the resulting map abcd.load./config/G1 to 
publish.
Figure 4-2
Example of NSM operation
Namespace Mapper (NSM) Client API
The NSM Client API provides an interface to its clients for querying the subscriber and publisher maps.
The methods of the NSM API are the same in both Java and C++. They are contained in a single class, 
NSMClient, as follows:
NSMClient — C++ only
attach
detach
resolve
75504
External
application
Publisher Event to R1: abcd.load.R1
Publisher Event to R2: abcd.load.R2
Publisher Event to R3: abcd.load.R3
Publisher Event to /config/G1: abcd.load./config/G1
Subscriber mapping  R1:abcd.load.R1, abcd.load./config/G1
Subscriber mapping  R2:abcd.load.R2, abcd.load./config/G1
Subscriber mapping  R3:abcd.load.R2
Namespace
mapper
Group: G1
Sub: config.load
R1
config.load = a.b
App. Name
App. Name
CNS event
gateway
CNS event Bus
R2
R3