Re: Question on Association behaviour

Ashok K Pathak <[email protected]>
Newsgroups gmane.network.open-pegasus.general
Message-ID <OF9113F6C1.546F4D23-ON652578E1.002B6B0C-852578E1.005FE733@in.ibm.com>
DMTF spec say :

Associators
 <objectWithPath>*Associators (
         [IN] <objectName> ObjectName,
         [IN,OPTIONAL,NULL] <className> AssocClass = NULL,
         [IN,OPTIONAL,NULL] <className> ResultClass = NULL,
         [IN,OPTIONAL,NULL] string Role = NULL,
         [IN,OPTIONAL,NULL] string ResultRole = NULL,
         [IN,OPTIONAL] boolean IncludeQualifiers = false, (DEPRECATED)
         [IN,OPTIONAL] boolean IncludeClassOrigin = false,
         [IN,OPTIONAL,NULL] string PropertyList [] = NULL
 )

The ObjectName input parameter defines the source CIM Object whose
associated Objects are to be returned.  This may be either a Class name or
Instance name (model path).

The AssocClass input parameter, if not NULL, MUST be a valid CIM
Association Class name. It acts as a filter on the returned set of Objects
by mandating that each returned Object MUST be associated to the source
Object via an Instance of this Class or one of its subclasses.

http://www.dmtf.org/sites/default/files/standards/documents/DSP200.html



Also look into example for TST_Person
src/Providers/TestProviders/Load/TST_Family.mof
where association has been defined for different classes
such as
>>>

[Association, Version("1.0.0"), Description(" Lineage defines the "
"relationship between parents and children.") ]
class TST_Lineage
{
    [key] TST_Person ref parent;
    [key] TST_Person ref child;
};

instance of TST_Lineage
{
    parent = "TST_Person.name=\"Mike\"";
    child = "TST_Person.name=\"Sofi\"";
};

instance of TST_Lineage
{
    parent = "TST_Person.name=\"Mike\"";
    child = "TST_Person.name=\"Gabi\"";
};

instance of TST_Lineage
{
    parent = "TST_Person.name=\"Saara\"";
    child = "TST_Person.name=\"Sofi\"";
};

instance of TST_Lineage
{
    parent = "TST_Person.name=\"Saara\"";
    child = "TST_Person.name=\"Gabi\"";
};

<<<

For more detail refer the TST_Family.mof

An example

# cimcli a -n test/TestProvider TST_Person -i -niq
1: TST_Person.name="Mike"
2: TST_Person.name="Saara"
3: TST_Person.name="Sofi"
4: TST_Person.name="Gabi"
5: TST_PersonS.name="Mikes"
6: TST_PersonS.name="Saaras"
7: TST_PersonS.name="Sofis"
8: TST_PersonS.name="Gabis"
9: TST_PersonDynamic.name="Father"
10: TST_PersonDynamic.name="Mother"
11: TST_PersonDynamic.name="Son1"
12: TST_PersonDynamic.name="Son2"
13: TST_PersonDynamic.name="Daughter1"
14: TST_PersonDynamicSubClass.name="AnotherKid"
Select an Instance (1..14)? 1
path= //lc4eb571502150.ibm.com/test/TestProvider:TST_Person.name="Sofi"

//Instance of TST_Person
instance of TST_Person
{
extraProperty = "defaultvalue";
name = "Sofi";
};
path= //lc4eb571502150.ibm.com/test/TestProvider:TST_Person.name="Gabi"

//Instance of TST_Person
instance of TST_Person
{
extraProperty = "defaultvalue";
name = "Gabi";
};
[root@lc4eb571502150 nonroot]#

Here we get two instance of TST_Person  as MIke is asso ciated with Sofi
and
Gabi

Hope  this helps

Regards
Ashok




                                                                           
             <biswapratap.chat                                             
             [email protected]>                                             
                                                                        To 
             08/03/11 01:58 AM         <[email protected]>         
                                                                        cc 
                                       <[email protected]>,             
                                       <[email protected]>            
                                                                   Subject 
                                       Question on Association behaviour   
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi,

Consider the following situation below –

      1.       You have a set of classes (parent and derived) compiled in
      your user defined namespace “say” “root/xyx”.
      2.       Out of all those classes we consider the “DiskDrive”,
      “SystemDevice” and the “Realizes” classes.
         a)      Parent Class for DiskDrive is “CIM_DiskDrive”.
         b)      My Derived class for DiskDrive : XYZ_DiskDrive –
               i)                     class XYZ_DiskDrive : CIM_DiskDrive
               { };
         c)       Parent Class for SystemDevice “CIM_SystemDevice”.
         d)      Three Derived classes on “SystemDevice” –
               i)                    class
               XYZ_ComputerSystemVolumeSystemDevice : CIM_SystemDevice { };
               ii)                   class
               XYZ_ComputerSystemAlarmSystemDevice : CIM_SystemDevice { };
               iii)                 class
               XYZ_ComputerSystemDiskDriveSystemDevice : CIM_SystemDevice
               { };
         e)      Two Derived classes on “Realizes” –
               i)                    class
               XYZ_DiskDrivePhysicalPackageRealizes : CIM_Realizes { };
               ii)                   class XYZ_
               ComputerSystemCardRealizes : CIM_Realizes { };
      3.       Now I fire the following “associators/associatornames” i.e
      “a/an” client commands to the cimserver where the above classes
      compiled in the “root/xyz” namespace are present serviced by the
      “xyz.dll/.so” provider –
         a)      cimcli an –n root/xyz CIM_DiskDrive –I –niq (and then I
         select one of the DiskDrive objectpaths listed)
         b)      cimcli a –n root/xyz CIM_DiskDrive –I –niq (and then I
         select one of the DiskDrive objectpaths listed)

Facts I assume:

      1.       The result that will be obtained by the client after firing
      the above commands will be :
         a)      List of objectpaths of all classes associated (through any
         association) with the selected diskdrive. (Objectpaths of
         ComputerSystems associated with the diskdrive through
         XYZ_ComputerSystemDiskDriveSystemDevice association (2/d/iii) and
         Objectpaths of PhysicalPackages associated with the diskdrive
         through XYZ_DiskDrivePhysicalPackageRealizes association
         (2/e/ii) )

Queries

      1.       What will be the behavior of the CIMOM after receiving this
      call –
         a)      It will spawn separate and parallel “a/an” thread calls to
         my provider (xyz.dll/.so), with –
               i)                    Objectpath = Selected DiskDrive Path.
               (always)
               ii)                   AssociationClass =
               XYZ_ComputerSystemDiskDriveSystemDevice and
               XYZ_DiskDrivePhysicalPackageRealizes only.
               iii)                 ResultClass = EMPTY
               iv)                 Role = EMPTY
               v)                  ResultRole = EMPTY
         b)      OR anything other than a), if “yes” please explain.

Thanks in advance.

Regards,
Biswapratap.



Please do not print this email unless it is absolutely necessary.


The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.


WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses.
The company accepts no liability for any damage caused by any virus
transmitted by this email.


www.wipro.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.