4.1.3 Check Whether Import Will Lead to Conflicting Objects
The following sequence of WSRM client actions can be used to determine whether the import of a given object will lead to conflicts.
Connect to the WSRM server by creating a ResourceManager COM object.
Get pointers to the IWRMMachineGroup, IResourceManager2 and other interfaces needed to gather the data of desired objects.
Gather the names and types of all target objects.
Call the IResourceManager2 ExportObjects method with following parameters:
bstrObjectIds set to the ids of the objects to check.
enumObjectType set to the object type of the objects specified by bstrObjectIds.
pbstrObjectXml set to a previously-allocated buffer that will receive the XML for the target objects.
Call the IResourceManager2 GetImportConflicts method with the following parameters:
bstrPMCXml, NULL or an XML string specifying desired PMC objects.
bstrPolicyXml, NULL or an XML string specifying desired resource policy objects.
bstrCalendarXml, NULL or an XML string specifying desired calendar objects.
bstrConditionalXml, set to NULL.
bstrMachineGroupXml, set to NULL.
bstrConfigurationXml, set to NULL.
pbstrConflictingObjects, set to a previously-allocated buffer that will receive the XML for the conflicting object identifiers.
Release all pointers to interfaces.