version 1.71, 2002/09/13 21:40:42
|
version 1.72, 2002/09/18 17:09:24
|
|
|
else | else |
return("localhost:5988"); | return("localhost:5988"); |
} | } |
|
|
|
void getHostAndPort (String & host, Uint32 & portNumber) |
|
{ |
|
const char* tmp = getenv ("QUERY_STRING"); |
|
char* queryString = strcpy (new char [strlen (tmp) + 1], tmp); |
|
CGIQueryString qs (queryString); |
|
|
|
String tmpStr= qs.findValue ("hostaddress"); |
|
if (tmpStr.size () > 0) |
|
{ |
|
Uint32 index = tmpStr.find (':'); |
|
host = tmpStr.subString (0, index); |
|
portNumber = 0; |
|
if (index != PEG_NOT_FOUND) |
|
{ |
|
String portStr = tmpStr.subString (index + 1, tmpStr.size ()); |
|
sscanf (portStr.getCString (), "%u", &portNumber); |
|
} |
|
} |
|
else |
|
{ |
|
host = "localhost"; |
|
portNumber = 5988; |
|
} |
|
} |
|
|
CIMName PrintSuperClassName(CIMName superClassName) | CIMName PrintSuperClassName(CIMName superClassName) |
{ | { |
if (superClassName.isNull ()) | if (superClassName.isNull ()) |
|
|
{ | { |
CIMClient client; | CIMClient client; |
| |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
cimClass = client.getClass(nameSpace, className, | cimClass = client.getClass(nameSpace, className, |
localOnly, includeQualifiers, includeClassOrigin); | localOnly, includeQualifiers, includeClassOrigin); |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
// get the class | // get the class |
CIMClass cimClass = client.getClass( | CIMClass cimClass = client.getClass( |
|
|
| |
// Make the Connection | // Make the Connection |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
Array<CIMName> classNames = client.enumerateClassNames( | Array<CIMName> classNames = client.enumerateClassNames( |
nameSpace, className, deepInheritance); | nameSpace, className, deepInheritance); |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
client.deleteClass(nameSpace, className); | client.deleteClass(nameSpace, className); |
| |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
Array<CIMQualifierDecl> qualifierDecls = | Array<CIMQualifierDecl> qualifierDecls = |
client.enumerateQualifiers(nameSpace); | client.enumerateQualifiers(nameSpace); |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
CIMQualifierDecl qd = client.getQualifier(nameSpace, qualifierName); | CIMQualifierDecl qd = client.getQualifier(nameSpace, qualifierName); |
| |
|
|
Stopwatch elapsedTime; | Stopwatch elapsedTime; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
// Call enumerate Instances CIM Method | // Call enumerate Instances CIM Method |
Array<CIMObjectPath> instanceNames = client.enumerateInstanceNames( | Array<CIMObjectPath> instanceNames = client.enumerateInstanceNames( |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
CIMInstance cimInstance = client.getInstance(nameSpace, | CIMInstance cimInstance = client.getInstance(nameSpace, |
referenceName, localOnly, includeClassOrigin, includeClassOrigin); | referenceName, localOnly, includeClassOrigin, includeClassOrigin); |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
/* | /* |
virtual Array<CIMInstance> enumerateInstances( | virtual Array<CIMInstance> enumerateInstances( |
const CIMNamespaceName& nameSpace, | const CIMNamespaceName& nameSpace, |
|
|
try | try |
{ | { |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
CIMValue value = client.getProperty(nameSpace, | CIMValue value = client.getProperty(nameSpace, |
referenceName, propertyName); | referenceName, propertyName); |
|
|
Stopwatch elapsedTime; | Stopwatch elapsedTime; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
// Call create Instances CIM Method for class __Namespace | // Call create Instances CIM Method for class __Namespace |
cout << "Creating " << nameSpaceName; | cout << "Creating " << nameSpaceName; |
|
|
Stopwatch elapsedTime; | Stopwatch elapsedTime; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
// Call delete Instances CIM Method for class __Namespace | // Call delete Instances CIM Method for class __Namespace |
client.deleteInstance(nameSpace, referenceName); | client.deleteInstance(nameSpace, referenceName); |
|
|
Stopwatch elapsedTime; | Stopwatch elapsedTime; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
// Call enumerate Instances CIM Method | // Call enumerate Instances CIM Method |
Array<CIMObjectPath> instanceNames = client.enumerateInstanceNames( | Array<CIMObjectPath> instanceNames = client.enumerateInstanceNames( |
|
|
| |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
client.setTimeout(timeOut); | client.setTimeout(timeOut); |
| |
| |
|
|
CIMName className; | CIMName className; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
Array<CIMName> classNames = client.enumerateClassNames( | Array<CIMName> classNames = client.enumerateClassNames( |
nameSpace, | nameSpace, |
|
|
CIMName className; | CIMName className; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
Array<CIMName> classNames = client.enumerateClassNames( | Array<CIMName> classNames = client.enumerateClassNames( |
nameSpace, | nameSpace, |
|
|
Stopwatch elapsedTime; | Stopwatch elapsedTime; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
Array<CIMObjectPath> objectReferences; | Array<CIMObjectPath> objectReferences; |
objectReferences = client.referenceNames( | objectReferences = client.referenceNames( |
|
|
Stopwatch elapsedTime; | Stopwatch elapsedTime; |
| |
CIMClient client; | CIMClient client; |
HostInfo hostinfo; |
String host; |
client.connect(hostinfo.getAddress(), String::EMPTY, String::EMPTY); |
Uint32 portNumber; |
|
getHostAndPort (host, portNumber); |
|
client.connect (host, portNumber, String::EMPTY, String::EMPTY); |
| |
Array<CIMObjectPath> objectReferences; | Array<CIMObjectPath> objectReferences; |
objectReferences = client.associatorNames( | objectReferences = client.associatorNames( |