[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] conga/ricci/modules/cluster/clumon/src/cim-pro ...



CVSROOT:	/cvs/cluster
Module name:	conga
Changes by:	kupcevic sourceware org	2006-08-09 16:50:42

Modified files:
	ricci/modules/cluster/clumon/src/cim-provider: 
	                                               ClusterProvider.cpp 
	                                               ClusterProviderMain.cpp 

Log message:
	cluster-cim: use explicit Pegasus Strings

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/cim-provider/ClusterProvider.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/modules/cluster/clumon/src/cim-provider/ClusterProviderMain.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2

--- conga/ricci/modules/cluster/clumon/src/cim-provider/ClusterProvider.cpp	2006/06/14 21:44:37	1.1
+++ conga/ricci/modules/cluster/clumon/src/cim-provider/ClusterProvider.cpp	2006/08/09 16:50:42	1.2
@@ -44,6 +44,7 @@
 using namespace Pegasus;
 using namespace ClusterMonitoring;
 
+using Pegasus::String;
 
 static CIMInstance 
 buildClusterInstance(counting_auto_ptr<Cluster>& cluster, Boolean qual, Boolean orig);
@@ -61,7 +62,7 @@
 buildServiceInstancePath(counting_auto_ptr<Service>& service, const CIMNamespaceName& nameSpace);
 
 
-static String
+static Pegasus::String
 hostname(void);
 
 
@@ -314,7 +315,7 @@
 // private
 
 void 
-ClusterProvider::log(const String& str)
+ClusterProvider::log(const Pegasus::String& str)
 {
   ::log((const char*) str.getCString());
 }
@@ -332,16 +333,16 @@
   // Name
   inst.addProperty(CIMProperty(
 			       CIMName("Name"),
-			       CIMValue(String(cluster->name().c_str()))));
+			       CIMValue(Pegasus::String(cluster->name().c_str()))));
   
   // Caption
   //inst.addProperty(CIMProperty(
   //			       CIMName("Caption"),
-  //			       CIMValue(String(cluster.name.c_str()))));
+  //			       CIMValue(Pegasus::String(cluster.name.c_str()))));
   // Description
   //inst.addProperty(CIMProperty(
   //			       CIMName("Description"),
-  //			       CIMValue(String(cluster.name.c_str()))));
+  //			       CIMValue(Pegasus::String(cluster.name.c_str()))));
   
   // *** Votes ***
   
@@ -356,15 +357,15 @@
   // *** Nodes ***
   
   list<counting_auto_ptr<Node> > nodes = cluster->nodes();
-  Array<String> names;
-  Array<String> namesA;
-  Array<String> namesU;
+  Array<Pegasus::String> names;
+  Array<Pegasus::String> namesA;
+  Array<Pegasus::String> namesU;
   for(list<counting_auto_ptr<Node> >::iterator iterN = nodes.begin();
       iterN != nodes.end(); 
       iterN++)
     {
       counting_auto_ptr<Node>& node = *iterN;
-      String name(node->name().c_str());
+      Pegasus::String name(node->name().c_str());
       names.append(name);
       if(node->clustered())
 	namesA.append(name);
@@ -397,15 +398,15 @@
   
   list<counting_auto_ptr<Service> > services = cluster->services();
   names.clear();
-  Array<String> namesR;
-  Array<String> namesF;
-  Array<String> namesS;
+  Array<Pegasus::String> namesR;
+  Array<Pegasus::String> namesF;
+  Array<Pegasus::String> namesS;
   for(list<counting_auto_ptr<Service> >::iterator iterS = services.begin();
       iterS != services.end(); 
       iterS++)
     {
       counting_auto_ptr<Service>& service = *iterS;
-      String name(service->name().c_str());
+      Pegasus::String name(service->name().c_str());
       names.append(name);
       if(service->running())
 	namesR.append(name);
@@ -448,7 +449,7 @@
   bool unclusteredNodes = cluster->unclusteredNodes().size() != 0;
   bool quorate = cluster->quorate();
   Array<Uint16> Ostatus; // OperationalStatus
-  Array<String> statusD; // StatusDescription
+  Array<Pegasus::String> statusD; // StatusDescription
   if(online)
     {
       if(quorate)
@@ -528,7 +529,7 @@
   // CreationClassName
   inst.addProperty(CIMProperty(
 			       CIMName("CreationClassName"),
-			       CIMValue(String(CLUSTER_CLASSNAME))));
+			       CIMValue(Pegasus::String(CLUSTER_CLASSNAME))));
   
   // ResetCapability
   //inst.addProperty(CIMProperty(
@@ -583,21 +584,21 @@
   // ClusterName
   inst.addProperty(CIMProperty(
   			       CIMName("ClusterName"),
-  			       CIMValue(String(node->clustername().c_str()))));
+  			       CIMValue(Pegasus::String(node->clustername().c_str()))));
   
   // Name
   inst.addProperty(CIMProperty(
 			       CIMName("Name"),
-			       CIMValue(String(node->name().c_str()))));
+			       CIMValue(Pegasus::String(node->name().c_str()))));
   
   // Caption
   //inst.addProperty(CIMProperty(
   //			       CIMName("Caption"),
-  //			       CIMValue(String(cluster.name.c_str()))));
+  //			       CIMValue(Pegasus::String(cluster.name.c_str()))));
   // Description
   //inst.addProperty(CIMProperty(
   //			       CIMName("Description"),
-  //			       CIMValue(String(cluster.name.c_str()))));
+  //			       CIMValue(Pegasus::String(cluster.name.c_str()))));
   
   
   // *** Votes ***
@@ -609,12 +610,12 @@
   // *** services ***
   
   list<counting_auto_ptr<Service> > services = node->services();
-  Array<String> names;
+  Array<Pegasus::String> names;
   for(list<counting_auto_ptr<Service> >::iterator iter = services.begin();
       iter != services.end(); 
       iter++)
     {
-      String name((*iter)->name().c_str());
+      Pegasus::String name((*iter)->name().c_str());
       names.append(name);
     }
   inst.addProperty(CIMProperty(
@@ -628,7 +629,7 @@
   // *** status begin ***
   
   Array<Uint16> Ostatus; // OperationalStatus
-  Array<String> statusD; // StatusDescription
+  Array<Pegasus::String> statusD; // StatusDescription
   if(node->online() && node->clustered())
     {
       // OK
@@ -662,7 +663,7 @@
   // CreationClassName
   inst.addProperty(CIMProperty(
 			       CIMName("CreationClassName"),
-			       CIMValue(String(CLUSTER_NODE_CLASSNAME))));
+			       CIMValue(Pegasus::String(CLUSTER_NODE_CLASSNAME))));
   
   // ResetCapability
   //inst.addProperty(CIMProperty(
@@ -703,28 +704,28 @@
   // Name
   inst.addProperty(CIMProperty(
 			       CIMName("Name"),
-			       CIMValue(String(service->name().c_str()))));
+			       CIMValue(Pegasus::String(service->name().c_str()))));
   
   // Caption
   //inst.addProperty(CIMProperty(
   //			       CIMName("Caption"),
-  //			       CIMValue(String(cluster.name.c_str()))));
+  //			       CIMValue(Pegasus::String(cluster.name.c_str()))));
   // Description
   //inst.addProperty(CIMProperty(
   //			       CIMName("Description"),
-  //			       CIMValue(String(cluster.name.c_str()))));
+  //			       CIMValue(Pegasus::String(cluster.name.c_str()))));
   
   // ClusterName
   inst.addProperty(CIMProperty(
   			       CIMName("ClusterName"),
-  			       CIMValue(String(service->clustername().c_str()))));
+  			       CIMValue(Pegasus::String(service->clustername().c_str()))));
   
   // Started
   inst.addProperty(CIMProperty(
 			       CIMName("Started"),
 			       CIMValue(service->running())));
   // StartMode
-  String autostart;
+  Pegasus::String autostart;
   if(service->autostart())
     autostart = "Automatic";
   else
@@ -736,7 +737,7 @@
   // NodeName
   if(service->running())
     {
-      String nodeName = String(service->nodename().c_str());
+      Pegasus::String nodeName = Pegasus::String(service->nodename().c_str());
       inst.addProperty(CIMProperty(
 				   CIMName("NodeName"),
 				   CIMValue(nodeName)));
@@ -745,7 +746,7 @@
   // *** status begin ***
   
   Array<Uint16> Ostatus; // OperationalStatus
-  Array<String> statusD; // StatusDescription
+  Array<Pegasus::String> statusD; // StatusDescription
   if(service->failed())
     {
       // Error
@@ -778,17 +779,17 @@
   // CreationClassName
   inst.addProperty(CIMProperty(
 			       CIMName("CreationClassName"),
-			       CIMValue(String(CLUSTER_SERVICE_CLASSNAME))));
+			       CIMValue(Pegasus::String(CLUSTER_SERVICE_CLASSNAME))));
   
   // SystemCreationClassName
   inst.addProperty(CIMProperty(
 			       CIMName("SystemCreationClassName"),
-			       CIMValue(String(CLUSTER_CLASSNAME))));
+			       CIMValue(Pegasus::String(CLUSTER_CLASSNAME))));
   
   // SystemName
   inst.addProperty(CIMProperty(
   			       CIMName("SystemName"),
-  			       CIMValue(String(service->clustername().c_str()))));
+  			       CIMValue(Pegasus::String(service->clustername().c_str()))));
   
   
   // ElementName
@@ -818,10 +819,10 @@
 {
   Array<CIMKeyBinding> keys;
   keys.append(CIMKeyBinding("CreationClassName", 
-			    String(CLUSTER_CLASSNAME), 
+			    Pegasus::String(CLUSTER_CLASSNAME), 
 			    CIMKeyBinding::STRING));
   keys.append(CIMKeyBinding("Name", 
-			    String(cluster->name().c_str()), 
+			    Pegasus::String(cluster->name().c_str()), 
 			    CIMKeyBinding::STRING));
   return CIMObjectPath(hostname(), nameSpace, CLUSTER_CLASSNAME, keys);
 }
@@ -832,13 +833,13 @@
 {
   Array<CIMKeyBinding> keys;
   keys.append(CIMKeyBinding("CreationClassName", 
-			    String(CLUSTER_NODE_CLASSNAME), 
+			    Pegasus::String(CLUSTER_NODE_CLASSNAME), 
 			    CIMKeyBinding::STRING));
   keys.append(CIMKeyBinding("Name", 
-			    String(node->name().c_str()), 
+			    Pegasus::String(node->name().c_str()), 
 			    CIMKeyBinding::STRING));
   keys.append(CIMKeyBinding("ClusterName", 
-			    String(node->clustername().c_str()), 
+			    Pegasus::String(node->clustername().c_str()), 
 			    CIMKeyBinding::STRING));
   return CIMObjectPath(hostname(), nameSpace, CLUSTER_NODE_CLASSNAME, keys);
 }
@@ -849,25 +850,25 @@
 {
   Array<CIMKeyBinding> keys;
   keys.append(CIMKeyBinding("CreationClassName", 
-			    String(CLUSTER_SERVICE_CLASSNAME), 
+			    Pegasus::String(CLUSTER_SERVICE_CLASSNAME), 
 			    CIMKeyBinding::STRING));
   keys.append(CIMKeyBinding("Name", 
-			    String(service->name().c_str()), 
+			    Pegasus::String(service->name().c_str()), 
 			    CIMKeyBinding::STRING));
   keys.append(CIMKeyBinding("SystemCreationClassName", 
-			    String(CLUSTER_CLASSNAME), 
+			    Pegasus::String(CLUSTER_CLASSNAME), 
 			    CIMKeyBinding::STRING));
   keys.append(CIMKeyBinding("SystemName", 
-			    String(service->clustername().c_str()), 
+			    Pegasus::String(service->clustername().c_str()), 
 			    CIMKeyBinding::STRING));
   return CIMObjectPath(hostname(), nameSpace, CLUSTER_SERVICE_CLASSNAME, keys);
 }
 
 
-String
+Pegasus::String
 hostname()
 {
-  String hostname;
+  Pegasus::String hostname;
   struct utsname uts;
   
   if (uname(&uts) == 0)
@@ -956,8 +957,8 @@
 				 const CIMObjectPath& objectName,
 				 const CIMName& associationClass,
 				 const CIMName& resultClass,
-				 const String& role,
-				 const String& resultRole,
+				 const Pegasus::String& role,
+				 const Pegasus::String& resultRole,
 				 ObjectPathResponseHandler& handler) 
 {
   counting_auto_ptr<Cluster> cluster = _monitor.get_cluster();
@@ -978,8 +979,8 @@
 			     const CIMObjectPath& objectName,
 			     const CIMName& associationClass,
 			     const CIMName& resultClass,
-			     const String& role,
-			     const String& resultRole,
+			     const Pegasus::String& role,
+			     const Pegasus::String& resultRole,
 			     const Boolean includeQualifiers,
 			     const Boolean includeClassOrigin,
 			     const CIMPropertyList& propertyList,
@@ -1002,7 +1003,7 @@
 ClusterProvider::referenceNames(const OperationContext& context,
 				const CIMObjectPath& objectName,
 				const CIMName& resultClass,
-				const String& role,
+				const Pegasus::String& role,
 				ObjectPathResponseHandler& handler)
 {
   counting_auto_ptr<Cluster> cluster = _monitor.get_cluster();
@@ -1058,7 +1059,7 @@
 ClusterProvider::references(const OperationContext& context,
 			    const CIMObjectPath& objectName,
 			    const CIMName& resultClass,
-			    const String& role,
+			    const Pegasus::String& role,
 			    const Boolean includeQualifiers,
 			    const Boolean includeClassOrigin,
 			    const CIMPropertyList& propertyList,
@@ -1161,10 +1162,10 @@
 {
   Array<CIMKeyBinding> keys;
   keys.append(CIMKeyBinding("Dependent", 
-			    String(buildClusterInstancePath(cluster, nameSpace).toString()), 
+			    Pegasus::String(buildClusterInstancePath(cluster, nameSpace).toString()), 
 			    CIMKeyBinding::REFERENCE));
   keys.append(CIMKeyBinding("Antecedent", 
-			    String(buildNodeInstancePath(node, nameSpace).toString()), 
+			    Pegasus::String(buildNodeInstancePath(node, nameSpace).toString()), 
 			    CIMKeyBinding::REFERENCE));
   return CIMObjectPath(hostname(), nameSpace, CLUSTER_PARTICIPATING_NODE_CLASSNAME, keys);
 }
--- conga/ricci/modules/cluster/clumon/src/cim-provider/ClusterProviderMain.cpp	2006/06/14 21:44:37	1.1
+++ conga/ricci/modules/cluster/clumon/src/cim-provider/ClusterProviderMain.cpp	2006/08/09 16:50:42	1.2
@@ -29,9 +29,9 @@
 
 using namespace Pegasus;
 
-extern "C" PEGASUS_EXPORT Pegasus::CIMProvider* PegasusCreateProvider(const String &providerName)
+extern "C" PEGASUS_EXPORT Pegasus::CIMProvider* PegasusCreateProvider(const Pegasus::String &providerName)
 {
-  if (String::equalNoCase(providerName, "RedHatClusterProvider"))
+  if (Pegasus::String::equalNoCase(providerName, "RedHatClusterProvider"))
     {
       return new ClusterMonitoring::ClusterProvider();
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]