The following policy example shows how the provided Sample connector inbound policy transforms USM data of the Router type class to the Router class specifications in the Sample connector mock domain manager:
<EventClass name='Item' > <Classify> <Field input='ClassName' pattern='^Router$' output='eventtype' outval='Router' /> </Classify>
The classify operation classifies CIs with a USM type of Router to the Sample connector class of Router. This operation directs all specialized processing to occur under the policy for the Router event class. The object also inherits policy operations from the parent Item event class.
<Format>
<Field input='LastModActivity' format='{0}' output='action' />
<Field output='CAProductIdentifier' format='09998' input='' />
<Field conditional='MdrElementID' input='MdrElementID' format='{0}'
output='id' />
<Field conditional='Description' input='Description' format='{0}'
output='description' />
<Field conditional='Label' input='Label' format='{0}' output='name' />
<!-- correlated properties -->
<Field conditional='SysName' input='SysName' format='{0}' output='sysname' />
<Field conditional='PrimaryDnsName' input='PrimaryDnsName' format='{0}'
output='dnsname' />
<Field conditional='PrimaryMacAddress' input='PrimaryMacAddress' format='{0}'
output='macaddress' />
<Field conditional='PrimaryIPV4Address' input='PrimaryIPV4Address'
format='{0}' output='ip_address' />
</Format>
The format operations in the generic Item event class convert USM properties to the source format in the Sample connector mock domain manager.
<Write> <Field type='file' name='outfile' properties='*' /> <Field type='publishcache' properties='name,description,id,action,sysname, dnsname,macaddress,ip_address' /> </Write> </EventClass>
The write operation in the generic Item event class writes the derived properties to the output CI. The CI is then processed further by the specialized policy under the Router event class.
<EventClass name='Router' extends='Item' >
<Format>
<Field output='class' format='Router' input='' />
<Field conditional='AdministrativeStatus' input='AdministrativeStatus'
format='{0}' output='adminstatus' />
<Field conditional='IsInMaintenance' input='IsInMaintenance'
format='{0}' output='maintenanceFlag' />
</Format>
The format operation in the Router event class converts the class property in the output CI to Router, the AdministrativeStatus property to adminstatus, and the IsInMaintenance property to maintenanceFlag.
<Write> <Field type='file' name='outfile' properties='*' /> <Field type='publishcache' properties='class,adminstatus,maintenanceFlag' /> </Write> </EventClass>
The write operation in the Router event class writes the final CI to an outfile for transmission to the Sample connector mock domain manager sample data.
In addition to this example, all inbound policy must include an event class of SiloDataFilter. All DataObject instances passed to the create(), update(), and delete() methods are transformed before the methods are invoked. Since the top-level type name is SiloDataFilter for the delete() method, this event class is used as the value for the property eventtype when the filter properties are converted. Therefore, SiloDataFilter must match the name of an event class. The Sample connector policy implements this event class as follows:
<EventClass name='SiloDataFilter' >
<!-- properties are as follows (with example below): -->
<!-- + id (xs:string) -->
<!-- + updatedAfter (xs:dateTime) -->
<!-- + entitytype (xs:string) Item, Relationship, or Alert -->
<!-- + itemtype (xs:string) -->
<!-- + recursive (xs:boolean) -->
<!-- Format>
<Field output='mdrelementid' input='id' format='{0}' />
</Format-->
<Write>
<Field type='file' name='outfile' properties='*' />
<Field type='publishcache' properties='id,updatedAfter,
entitytype,itemtype,recursive' />
</Write>
</EventClass>
|
Copyright © 2013 CA.
All rights reserved.
|
|