Package org.sblim.cimclient.internal.cim
Class CIMHelper
- java.lang.Object
-
- org.sblim.cimclient.internal.cim.CIMHelper
-
public abstract class CIMHelper extends java.lang.ObjectClass CIMHelper provides convenience methods that are missing from the official JSR48 API
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CIMInstanceCIMInstanceWithSynchonizedNumericKeyDataTypes(CIMObjectPath pObjectPath, CIMProperty<?>[] pProps)CIMInstanceWithSynchonizedNumericKeyDataTypes returns aCIMInstancewhere the data types of all numeric keys in theCIMObjectPathmatch those of the corresponding keys within theCIMProperty[].static java.net.URIcreateCimomUri(java.net.URI pUri)Creates a URI of a CIMOM from a given URI, adding default port if port not specified.static java.net.URIcreateCimomUri(CIMObjectPath pPath)Creates a URI of a CIMOM from a given CIM object path, adding default port if port not parsable.static CIMDataTypeScalarDataType(int pType)Returns the CIMDataType of a scalar of the specified data type.static CIMDataTypeUnboundedArrayDataType(int pType)Returns the CIMDataType of an unbounded array of the specified data type.
-
-
-
Method Detail
-
createCimomUri
public static java.net.URI createCimomUri(CIMObjectPath pPath) throws java.net.URISyntaxException
Creates a URI of a CIMOM from a given CIM object path, adding default port if port not parsable.- Parameters:
pPath- The CIM object path.- Returns:
- The URI.
- Throws:
java.net.URISyntaxException
-
createCimomUri
public static java.net.URI createCimomUri(java.net.URI pUri) throws java.net.URISyntaxExceptionCreates a URI of a CIMOM from a given URI, adding default port if port not specified.- Parameters:
pUri- The URI.- Returns:
- The URI.
- Throws:
java.net.URISyntaxException
-
ScalarDataType
public static CIMDataType ScalarDataType(int pType)
Returns the CIMDataType of a scalar of the specified data type. This should be used in lieu of "new CIMDataType(pType)" which is not supported by the JSR48 standard.- Parameters:
pType- Data type.- Returns:
- CIMDataType corresponding to data type.
-
UnboundedArrayDataType
public static CIMDataType UnboundedArrayDataType(int pType)
Returns the CIMDataType of an unbounded array of the specified data type. This should be used in lieu of "new CIMDataType(pType,0)" which is not supported by the JSR48 standard.- Parameters:
pType- Data type.- Returns:
- CIMDataType corresponding to data type.
-
CIMInstanceWithSynchonizedNumericKeyDataTypes
public static CIMInstance CIMInstanceWithSynchonizedNumericKeyDataTypes(CIMObjectPath pObjectPath, CIMProperty<?>[] pProps)
CIMInstanceWithSynchonizedNumericKeyDataTypes returns aCIMInstancewhere the data types of all numeric keys in theCIMObjectPathmatch those of the corresponding keys within theCIMProperty[]. The need for this conversion mechanism arises from a deficiency in the CIM-XML specs, where the TYPE (sint8, uint8, etc.) is required for PROPERTY but not for KEYVALUE. If a CIMOM sends a KEYVALUE of VALUETYPE="numeric" without TYPE, the Java CIM Client assumes a type of sint64, uint64 or real64. This can cause problems (i.e. ClassCastException) down the line if the TYPE of the corresponding PROPERTY is different.- Parameters:
pObjectPath- Instance object path.pProps- Instance properties.- Returns:
- CIMInstance with numeric key data types synchronized.
-
-