| 
    
 [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-cim] Memory pool question
 Gareth S Bestor wrote: To further followup on this, I think for the "generic assoc provider" changing to abool AssocMatch(LHSObjectPath, RHSObjectPath)which the developer customizes for each different association. The potential target endpoint instances can be obtained via upcalls to the target class(es), as we do already, but we can change the common assoc provider methods to determine this target class automagically by extracting the source class from the input reference objectpath, as happens today, but then query the CIM class to determine the two endpoint classes, rather than having to hand-code these as we do today. Hmm. I don't see how to do this via CMPI. It's not clear how to query the cimom about class info. Also we need the associator class name to determine the class name of endpoints it associates. The reference objectpath input parameter contains objectpath of one of the endpoints, not the association class. Perhaps the best way to continue this discussion is through some examples.My first thought was to create a generic getTargetEndpoints() function that would be called by each association provider. So a typical entry pint in an association provider would look something like 
CMPIStatus Associators(args)
{
   CMPIEnumeration potentialEndpoints = getTargetEndPoints(args)
   For endpoint in potentialEndpoints Do
       if AssocMatch(sourceEndpoint, endpoint)
         Add endpoint to results
}
getTargetEnpoints() signature would be something like
CMPIStatus getTargetEndpoints(CMPIBroker *, CMPIContext *,
                                       CMPIResult *, char *className,
                                       CMPIObjectPath *source, char 
*assocClass,
                                       char *resultClass, char *role, 
char *resultRole);
where className is the name of associator class invoking the function. Other parameters are just passed through. So some basic filtering would be done in getTargetInstances(), e.g. ensuring assocClass (if provided) is the subject association class (or superclass of subject association class). Final filtering would be done in AssocMatch - which implies it needs a few more paramenters?? The problem with this approach is I do not know how to determine the endpoints of parameter className in getTargetEndpoints() - my point above about not seeing how to do CIM class queries from CMPI. Alternatively we could pass this info to the generic getTargetEnpoints() - perhaps embedded in a structure that we define in the generic code. Suggestions? Does this even closely resemble what you were thinking Gareth? If not maybe some tweaking of the examples will help :-). Thanks, Jim This would give us generic top-level assoc methods that are basically class agnostic, and the programmer only needs to customize AssocMatch(), much like the resource abstraction layer we have in the instnace providers. Obviously, using upcalls to get *all* potential target instances is not the most efficient, but its probbaly the simplest. A more efficient approach would be to use a ExecQuery(class,query) upcall - instead of EnumInstnaces(class) and then filter - to more selectively pick out target instances, which would translate into converting AssocMatch into a complex ExecQuery WQL query experssion.Thoughts... - GarethInactive hide details for Gareth S Bestor/Beaverton/IBM@IBMUSGareth S Bestor/Beaverton/IBM@IBMUS _______________________________________________ Xen-cim mailing list Xen-cim@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-cim 
  | 
  
![]()  | 
            
         Lists.xenproject.org is hosted with RackSpace, monitoring our  |