⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testcimclient.java

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 JAVA
📖 第 1 页 / 共 4 页
字号:
            System.err.println ("enm           = " + enm);         }         if (  enm == null            || !enm.hasMoreElements ()            )         {            System.out.println ("FAIL (22): testCIMClient: enumQualifierTypes");            return false;         }         while (enm.hasMoreElements ())         {            cqt = (CIMQualifierType)enm.nextElement ();            if (DEBUG)            {               System.err.println ("cqt           = " + cqt.getName ());            }         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Enumerate qualifiers: enumerateQualifiers");         }         enm = cimClient.enumerateQualifiers (cop);         if (DEBUG)         {            System.err.println ("enm           = " + enm);         }         if (  enm == null            || !enm.hasMoreElements ()            )         {            System.out.println ("FAIL (23): testCIMClient: enumerateQualifiers");            return false;         }         while (enm.hasMoreElements ())         {            cqt = (CIMQualifierType)enm.nextElement ();            if (DEBUG)            {               System.err.println ("cqt           = " + cqt.getName ());            }         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         String testQualifier = "JMPINewQualifierType";         cop = new CIMObjectPath (testQualifier, nameSpaceClass);         cqt = new CIMQualifierType ();         cqt.setName (testQualifier);         cqt.setValue (new CIMValue (new Boolean (true)));         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Create qualifier: createQualifierType");         }         cimClient.createQualifierType (cop, cqt);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Delete qualifier: deleteQualifierType");         }         cimClient.deleteQualifierType (cop);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         cqt = new CIMQualifierType ();         cqt.setName (testQualifier);         cqt.setValue (new CIMValue (new Boolean (true)));         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Create qualifier: createQualifierType");         }         cimClient.createQualifierType (cop, cqt);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Get qualifier: getQualifierType");         }         cqt = cimClient.getQualifierType (cop);         if (DEBUG)         {            System.err.println ("cqt           = " + cqt);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Get qualifier: getQualifier");         }         cqt = cimClient.getQualifier (cop);         if (DEBUG)         {            System.err.println ("cqt           = " + cqt);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------/*         // Error: Exception: CIM_ERR_NOT_SUPPORTED (CIM_ERR_NOT_SUPPORTED: The requested operation is not supported: "JMPINewQualifierType")         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Set qualifier: setQualifierType");         }         cimClient.setQualifierType (cop, cqt);         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("cqt           = " + cqt);         }*/         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Delete qualifier: deleteQualifier");         }         cimClient.deleteQualifier (cop);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         String testClass = "JMPINewClass";         cc  = new CIMClass (testClass);         cop = new CIMObjectPath (testClass, nameSpaceClass);         if (DEBUG)         {            System.err.println ("cc            = " + cc);            System.err.println ("cop           = " + cop);            System.err.println ("Create class");         }         cimClient.createClass (cop, cc);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Set class: setClass");         }         cimClient.setClass (cop, cc);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Set class: modifyClass");         }         cimClient.modifyClass (cop, cc);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("Delete class");         }         cimClient.deleteClass (cop);         if (DEBUG)         {            System.err.println ("cop           = " + cop);         }         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         kvp = new Vector ();         kvp.addElement (new CIMProperty ("CreationClassName",                                          new CIMValue (classNameInstanceChild)));         kvp.addElement (new CIMProperty ("InstanceId",                                          new CIMValue (new UnsignedInt64 ("3"))));         kvp.addElement (new CIMProperty ("PropertyString",                                          new CIMValue ("Third string")));         kvp.addElement (new CIMProperty ("PropertyUint8",                                          new CIMValue (new UnsignedInt8 ((short)123))));         kvp.addElement (new CIMProperty ("PropertyUint16",                                          new CIMValue (new UnsignedInt16 ((int)1603))));         kvp.addElement (new CIMProperty ("PropertyUint32",                                          new CIMValue (new UnsignedInt32 ((long)3203))));         kvp.addElement (new CIMProperty ("PropertyUint64",                                          new CIMValue (new UnsignedInt64 ("6403"))));         kvp.addElement (new CIMProperty ("PropertySint8",                                          new CIMValue (new Byte ((byte)-113))));         kvp.addElement (new CIMProperty ("PropertySint16",                                          new CIMValue (new Short ((short)-1603))));         kvp.addElement (new CIMProperty ("PropertySint32",                                          new CIMValue (new Integer (-3203))));         kvp.addElement (new CIMProperty ("PropertySint64",                                          new CIMValue (new Long (-6403))));         kvp.addElement (new CIMProperty ("PropertyBoolean",                                          new CIMValue (new Boolean (false))));         kvp.addElement (new CIMProperty ("PropertyReal32",                                          new CIMValue (new Float (3.33333333333))));         kvp.addElement (new CIMProperty ("PropertyReal64",                                          new CIMValue (new Double (3.13131313131313131313))));         kvp.addElement (new CIMProperty ("PropertyDatetime",                                          new CIMValue (new CIMDateTime ("20030303030333.000000:000"))));         kvp.addElement (new CIMProperty ("PropertyChar16",                                          new CIMValue (new Character ('3'))));         cop = new CIMObjectPath (classNameInstanceChild, kvp);         cop.setNameSpace (nameSpaceClass);         ci = new CIMInstance (classNameInstanceChild);         ci.setObjectPath (cop);         CIMProperty cp = null;         // @TBD         enm = kvp.elements ();         while (enm.hasMoreElements ())         {            cp = (CIMProperty)enm.nextElement ();            if (DEBUG)            {               System.err.println ("setting (" + cp.getName () + ", " + cp.getValue () + ")");            }            ci.setProperty (cp.getName (), cp.getValue ());         }         if (DEBUG)         {            System.err.println ("cop           = " + cop);            System.err.println ("ci            = " + ci);            System.err.println ("Create instance");         }         CIMObjectPath copCreated = null;         copCreated = cimClient.createInstance (cop, ci);         if (DEBUG)         {            System.err.println ("copCreated    = " + copCreated);         }         // @TBD - the name space was not set in the returned cop!         copCreated.setNameSpace (nameSpaceClass);         //8<--------8<--------8<--------8<--------8<--------8<--------8<--------         kvp = new Vector ();         kvp.addElement (new CIMProperty ("CreationClassName",                                          new CIMValue (classNameInstanceChild)));         kvp.addElement (new CIMProperty ("InstanceId",                                          new CIMValue (new UnsignedInt64 ("3"))));         kvp.addElement (new CIMProperty ("PropertyString",                                          new CIMValue ("Fourth string")));         kvp.addElement (new CIMProperty ("PropertyUint8",                                          new CIMValue (new UnsignedInt8 ((short)124))));         kvp.addElement (new CIMProperty ("PropertyUint16",                                          new CIMValue (new UnsignedInt16 ((int)1604))));         kvp.addElement (new CIMProperty ("PropertyUint32",                                          new CIMValue (new UnsignedInt32 ((long)4204))));         kvp.addElement (new CIMProperty ("PropertyUint64",                                          new CIMValue (new UnsignedInt64 ("6404"))));         kvp.addElement (new CIMProperty ("PropertySint8",                                          new CIMValue (new Byte ((byte)-114))));         kvp.addElement (new CIMProperty ("PropertySint16",                                          new CIMValue (new Short ((short)-1604))));         kvp.addElement (new CIMProperty ("PropertySint42",                                          new CIMValue (new Integer (-4204))));         kvp.addElement (new CIMProperty ("PropertySint64",                                          new CIMValue (new Long (-6404))));         kvp.addElement (new CIMProperty ("PropertyBoolean",                                          new CIMValue (new Boolean (false))));         kvp.addElement (new CIMProperty ("PropertyReal42",                                          new CIMValue (new Float (4.44444444444))));         kvp.addElement (new CIMProperty ("PropertyReal64",                                          new CIMValue (new Double (4.14141414141414141414))));         kvp.addElement (new CIMProperty ("PropertyDatetime",                                          new CIMValue (new CIMDateTime ("20040404040444.000000:000"))));         kvp.addElement (new CIMProperty ("PropertyChar16",                                          new CIMValue (new Character ('4'))));         cop = new CIMObjectPath (classNameInstanceChild, kvp);         cop.setNameSpace (nameSpaceClass);         ci = new CIMInstance (classNameInstanceChild);         ci.setObjectPath (cop);         // @TBD         enm = kvp.elements ();         while (enm.hasMoreElements ())         {            cp = (CIMProperty)enm.nextElement ();            if (DEBUG)            {               System.err.println ("setting (" + cp.getName () + ", " + cp.getValue () + ")");            }            ci.setProperty (cp.getName (), cp.getValue ());         }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -