[an error occurred while processing this directive]
[an error occurred while processing this directive] [an error occurred while processing this directive]

Pegasus CIM Object Broker Documentation

[an error occurred while processing this directive]


[an error occurred while processing this directive]

 

Contents

o Introduction
o Objectives
o Overview
o Credits
o Pegasus Architecture
   o Design Goals
   o The Broker
   o Pegasus Providers.
   o Extension Services
   o Pegasus Clients.
   o Functional Flow
o Pegasus Components
   o Component Descriptions
   o Pegasus Directory Structure
o Pegasus Utilization
   o Pegasus Availability
   o Pegasus Installation
   o Pegasus Operation
   o Pegasus CIM Clients
   o Pegasus Providers
   o Pegasus MOF Compiler
o Programming Pegasus
   o CIM Objects in Pegasus
   o CIM Object Table
   o Class Definitions
o Pegasus Interfaces
   o CIM Operations over HTTP
   o Pegasus Client Interfaces
   o Pegasus Provider Interfaces
   o Pegasus Service Extension Interfaces
   o Repository Interfaces
o Writing Providers.
o Glossary
o Pegasus Code Examples
   o Client Examples
   o Client Coding Examples
   o Provider Coding Examples
o Document References
o Pegausus FAQ
o
In file ../../src/Pegasus/Common/CIMObjectPath.h:

class PEGASUS_COMMON_LINKAGE CIMObjectPath

The CIMObjectPath class represents the DMTF standard CIM object name or reference.

Documentation

The CIMObjectPath class represents the DMTF standard CIM object name or reference. A reference is a property type that is used in an association. Consider this MOF example:

    [Association]
    class MyAssociations
    {
        MyClass ref from;
        MyClass ref to;
    };
    

The value of the "from" and "to" properties are represented using a CIMObjectPath.

A CIM reference is used to uniquely identify a CIM class or CIM instance object. A CIMObjectPath consists of:

  • Host - name of host that contains the object
  • NameSpace - the namespace which contains the object
  • ClassName - name of objects class
  • KeyBindings key/value pairs which uniquely identify an instance

CIM references may also be expressed as simple strings (as opposed to being represented by the CIMObjectPath class). This string is known as the "Object Name". An object name has the following form:

    <namespace-path>:<model-path>
    

As for the model-path mentioned above, its form is defined by the CIM Standard (more is defined by the "XML Mapping Specification v2.0.0" specification) as follows:


<Qualifyingclass>.<key-1>=<value-1>[,<key-n>= <value-n>]*

For example:

    TennisPlayer.first="Patrick",last="Rafter"
    

This presupposes the existence of a class called "TennisPlayer" that has key properties named "first" and "last". For example, here is what the MOF might look like:

    class TennisPlayer : Person
    {
        [key] string first;
        [key] string last;
    };
    

All keys must be present in the model path.

Now the namespace-type and model-path are combined in the following string object name.

//atp:9999/root/cimv25:TennisPlayer.first="Patrick",last="Rafter"

Now suppose we wish to create a CIMObjectPath from this above string. There are two constructors provided: one which takes the above string and the other that takes the constituent elements. Here are the signature of the two constructors:

    CIMObjectPath(const String& objectName);

CIMObjectPath( const String& host, const CIMNamespaceName& nameSpace, const CIMName& className, const Array& keyBindings);

Following our example, the above object name may be used to initialize a CIMObjectPath like this:

        CIMObjectPath ref =
            "//atp:9999/root/cimv25:TennisPlayer.first="Patrick",last="Rafter";
        

A CIMObjectPath may also be initialized using the constituent elements of the object name (sometimes the object name is not available as a string: this is the case with CIM XML encodings). The arguments shown in that constructor above correspond elements of the object name in the following way:

  • host = "atp:9999"
  • nameSpace = "root/cimv25"
  • className = "TennisPlayer"
  • keyBindings = "first=\"Patrick\",last=\"Rafter\""

Note that the host and nameSpace argument may be empty since object names need not necessarily include a namespace path according to the standard.

The key bindings must be built up by appending CIMKeyBinding objects to an Array of CIMKeyBindings like this:

    Array keyBindings;
    keyBindings.append(
        CIMKeyBinding("first", "Patrick", CIMKeyBinding::STRING));
    keyBindings.append(CIMKeyBinding("last", "Rafter", CIMKeyBinding::STRING));
    

Notice that the keys in the object name may appear in any order. That is the following object names refer to the same object:

    TennisPlayer.first="Patrick",last="Rafter"
    TennisPlayer.last="Rafter",first="Patrick"
    

And since CIM is not case sensitive, the following refer to the same object:

    TennisPlayer.first="Patrick",last="Rafter"
    tennisplayer.FIRST="Patrick",Last="Rafter"
    

Therefore, the CIMObjectPaths::operator==() would return true for the last two examples.

The CIM standard leaves it an open question whether model paths may have spaces around delimiters (like '.', '=', and ','). We assume they cannot. So the following is an invalid model path:

    TennisPlayer . first = "Patrick", last="Rafter"
    

We require that the '.', '=', and ',' have no spaces around them.

For reasons of efficiency, the key bindings are internally sorted during initialization. This allows the key bindings to be compared more easily. This means that when the string is converted back to string (by calling toString()) that the keys may have been rearranged.

There are two forms an object name can take:

    <namespace-path>:<model-path>
    <model-path>
    

In other words, the namespace-path is optional. Here is an example of each:

    //atp:9999/root/cimv25:TennisPlayer.first="Patrick",last="Rafter"
    TennisPlayer.first="Patrick",last="Rafter"
    

If it begins with "//" then we assume the namespace-path is present and process it that way.

It should also be noted that an object name may refer to an instance or a class. Here is an example of each:

    TennisPlayer.first="Patrick",last="Rafter"
    TennisPlayer
    

In the second case--when it refers to a class--the key bindings are omitted.


Inheritance:


Public Methods

[more] CIMObjectPath ()
Constructs a CIMObjectPath object with null values
[more] CIMObjectPath (const CIMObjectPath& x)
Constructs a CIMObjectPath object from the value of a specified CIMObjectPath object.
[more] CIMObjectPath (const String& objectName)
Constructs a CIMObjectPath from a CIM object name in String form.
[more] CIMObjectPath ( const String& host, const CIMNamespaceName& nameSpace, const CIMName& className, const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>())
Constructs a CIMObjectPath object with the specified attributes.
[more] ~CIMObjectPath ()
Destructs the CIMObjectPath object
[more]CIMObjectPath& operator= (const CIMObjectPath& x)
Assigns the value of the specified CIMObjectPath object to this object.
[more]void clear ()
Resets the attributes of the object path to null values.
[more]void set ( const String& host, const CIMNamespaceName& nameSpace, const CIMName& className, const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>())
Sets the CIMObjectPath with the specified attributes.
[more]void set (const String& objectName)
Sets the CIMObjectPath from a CIM object name in String form.
[more]CIMObjectPath& operator= (const String& objectName)
Sets the CIMObjectPath from a CIM object name in String form.
[more]const String& getHost () const
Gets the host name for the object path.
[more]void setHost (const String& host)
Sets the host name for the object path.
[more]const CIMNamespaceName& getNameSpace () const
Gets the namespace name for the object path.
[more]void setNameSpace (const CIMNamespaceName& nameSpace)
Sets the namespace name for the object path.
[more]const CIMName& getClassName () const
Gets the class name for the object path.
[more]void setClassName (const CIMName& className)
Sets the class name for the object path.
[more]const Array<CIMKeyBinding> & getKeyBindings () const
Gets the key bindings for the object path.
[more]void setKeyBindings (const Array<CIMKeyBinding>& keyBindings)
Sets the key bindings for the object path.
[more]String toString () const
Generates a String form of the object path.
[more]Boolean identical (const CIMObjectPath& x) const
Compares the CIMObjectPath with a specified CIMObjectPath.
[more]Uint32 makeHashCode () const
Generates a hash code for the object path.

o CIMObjectPath()
Constructs a CIMObjectPath object with null values

o CIMObjectPath(const CIMObjectPath& x)
Constructs a CIMObjectPath object from the value of a specified CIMObjectPath object.
Parameters:
x - The CIMObjectPath object from which to construct a new CIMObjectPath object.

o CIMObjectPath(const String& objectName)
Constructs a CIMObjectPath from a CIM object name in String form.

Example:

            CIMObjectPath r1 = "MyClass.z=true,y=1234,x=\"Hello World\"";
        
Throws:
MalformedObjectNameException If the String does not contain a properly formed object name.
Parameters:
objectName - A String representation of the object name.

o CIMObjectPath( const String& host, const CIMNamespaceName& nameSpace, const CIMName& className, const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>())
Constructs a CIMObjectPath object with the specified attributes.
Throws:
MalformedObjectNameException If the host name String contains an improperly formed host name.
Parameters:
host - A String containing the host name (e.g., "nemesis:5988"). An empty String indicates that the object path does not contain a host name attribute.
nameSpace - A CIMNamespaceName specifying the namespace name. A null name indicates that the object path does not contain a namespace attribute.
className - A CIMName specifying the class name.
keyBindings - An Array of CIMKeyBinding objects specifying the key bindings.

o ~CIMObjectPath()
Destructs the CIMObjectPath object

oCIMObjectPath& operator=(const CIMObjectPath& x)
Assigns the value of the specified CIMObjectPath object to this object.
Parameters:
x - The CIMObjectPath object from which to assign this CIMObjectPath object.
Returns:
A reference to this CIMObjectPath object.

ovoid clear()
Resets the attributes of the object path to null values. The result is equivalent to using the default constructor.

ovoid set( const String& host, const CIMNamespaceName& nameSpace, const CIMName& className, const Array<CIMKeyBinding>& keyBindings = Array<CIMKeyBinding>())
Sets the CIMObjectPath with the specified attributes.
Throws:
MalformedObjectNameException If the host name String contains an improperly formed host name.
Parameters:
host - A String containing the host name (e.g., "nemesis:5988"). An empty String indicates that the object path does not contain a host name attribute.
nameSpace - A CIMNamespaceName specifying the namespace name. A null name indicates that the object path does not contain a namespace attribute.
className - A CIMName specifying the class name.
keyBindings - An Array of CIMKeyBinding objects specifying the key bindings.

ovoid set(const String& objectName)
Sets the CIMObjectPath from a CIM object name in String form.
Throws:
MalformedObjectNameException If the String does not contain a properly formed object name.
Parameters:
objectName - A String representation of the object name.

oCIMObjectPath& operator=(const String& objectName)
Sets the CIMObjectPath from a CIM object name in String form.
Throws:
MalformedObjectNameException If the String does not contain a properly formed object name.
Parameters:
objectName - A String representation of the object name.

oconst String& getHost() const
Gets the host name for the object path.
Returns:
A String containing the host name.

ovoid setHost(const String& host)
Sets the host name for the object path.

Example:

        CIMObjectPath r1;
        r1.setHost("fred:5988");
        
Throws:
MalformedObjectNameException If the host name String contains an improperly formed host name.
Parameters:
host - A String containing the host name.

oconst CIMNamespaceName& getNameSpace() const
Gets the namespace name for the object path.
Returns:
A CIMNamespaceName containing the namespace name.

ovoid setNameSpace(const CIMNamespaceName& nameSpace)
Sets the namespace name for the object path.
Parameters:
nameSpace - A CIMNamespaceName containing the namespace name.

oconst CIMName& getClassName() const
Gets the class name for the object path.
Returns:
A CIMName containing the class name.

ovoid setClassName(const CIMName& className)
Sets the class name for the object path.
Parameters:
className - A CIMName containing the class name.

oconst Array<CIMKeyBinding> & getKeyBindings() const
Gets the key bindings for the object path.
Returns:
An Array of CIMKeyBinding objects containing the key bindings.

ovoid setKeyBindings(const Array<CIMKeyBinding>& keyBindings)
Sets the key bindings for the object path.
Parameters:
keyBindings - An Array of CIMKeyBinding objects containing the key bindings.

oString toString() const
Generates a String form of the object path. The format is:

            "" + hostname + "/" + namespace + ":" + classname +"." +
            (keyname) + "=" (keyvalue) +"," ...
        

Special characters are escaped in the resulting String.

Throws:
UninitializedObjectException If the class name attribute of the object path is null.
Returns:
A String form of the object path.

oBoolean identical(const CIMObjectPath& x) const
Compares the CIMObjectPath with a specified CIMObjectPath. Comparisons of CIM names are case-insensitive, per the CIM specification.
Parameters:
x - The CIMObjectPath to be compared.
Returns:
True if this object is identical to the one specified, false otherwise.

oUint32 makeHashCode() const
Generates a hash code for the object path. Identical references generate the same hash code (despite insignificant differences such as the case of names and the order of the key bindings).


This class has no child classes.
Friends:
class SQLiteStore
class SCMOInstance
class SCMOClass

Alphabetic index HTML hierarchy of classes or Java


[an error occurred while processing this directive]