version 1.1, 2009/06/30 10:31:30
|
version 1.2.2.5, 2009/10/13 13:39:24
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include "CIMResponseData.h" | #include "CIMResponseData.h" |
#include "XmlWriter.h" |
#include <Pegasus/Common/Tracer.h> |
#include "XmlReader.h" |
#include <Pegasus/Common/XmlWriter.h> |
#include "Tracer.h" |
#include <Pegasus/Common/SCMOXmlWriter.h> |
|
#include <Pegasus/Common/XmlReader.h> |
|
#include <Pegasus/Common/SCMOClassCache.h> |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
//----------------------------------------------------------------------------- |
// C++ objects interface handling |
// |
|
// CIMInstanceResponseData |
|
// |
|
//----------------------------------------------------------------------------- |
|
| |
bool CIMInstanceResponseData::setBinaryCimInstance(CIMBuffer& in) |
// Instance Names handling |
|
Array<CIMObjectPath>& CIMResponseData::getInstanceNames() |
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
PEGASUS_DEBUG_ASSERT( |
"CIMInstanceResponseData::setBinaryCimInstance"); |
(_dataType==RESP_INSTNAMES || _dataType==RESP_OBJECTPATHS)); |
|
_resolveToCIM(); |
if (!in.getUint8A(_binaryData)) |
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_CIM); |
{ |
return _instanceNames; |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
"Failed to get binary instance data!"); |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} | } |
| |
_resolveCallback = _resolveBinaryInstance; |
// Instance handling |
_binaryEncoding = true; |
CIMInstance& CIMResponseData::getInstance() |
|
|
PEG_METHOD_EXIT(); |
|
return true; |
|
}; |
|
|
|
bool CIMInstanceResponseData::setXmlCimInstance(CIMBuffer& in) |
|
{ |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMInstanceResponseData::setXmlCimInstance"); |
|
|
|
if (!in.getSint8A(_instanceData)) |
|
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
PEGASUS_DEBUG_ASSERT(_dataType == RESP_INSTANCE); |
"Failed to get XML instance data!"); |
_resolveToCIM(); |
PEG_METHOD_EXIT(); |
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_CIM); |
return false; |
return _instances[0]; |
} | } |
| |
if (!in.getSint8A(_referenceData)) |
// Instances handling |
|
Array<CIMInstance>& CIMResponseData::getInstances() |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
PEGASUS_DEBUG_ASSERT(_dataType == RESP_INSTANCES); |
"Failed to get XML instance data (reference)!"); |
_resolveToCIM(); |
PEG_METHOD_EXIT(); |
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_CIM); |
return false; |
return _instances; |
} | } |
| |
if (!in.getString(_hostData)) |
// Objects handling |
|
Array<CIMObject>& CIMResponseData::getObjects() |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
PEGASUS_DEBUG_ASSERT(_dataType == RESP_OBJECTS); |
"Failed to get XML instance data (host)!"); |
_resolveToCIM(); |
PEG_METHOD_EXIT(); |
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_CIM); |
return false; |
return _objects; |
} | } |
| |
if (!in.getNamespaceName(_nameSpaceData)) |
// SCMO representation, single instance stored as one element array |
|
// object paths are represented as SCMOInstance |
|
Array<SCMOInstance>& CIMResponseData::getSCMO() |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
_resolveToSCMO(); |
"Failed to get XML instance data (namespace)!"); |
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_SCMO); |
PEG_METHOD_EXIT(); |
return _scmoInstances; |
return false; |
|
} |
|
|
|
_resolveCallback = _resolveXMLInstance; |
|
_binaryEncoding = false; |
|
|
|
PEG_METHOD_EXIT(); |
|
return true; |
|
}; |
|
|
|
//------------------------------------------------------------------------------ |
|
// Encodes the CIMInstance representation contained in the current |
|
// CIMResponseData object in binary response message format. |
|
// This code corresponds to method _resolveBinaryInstance, which is used |
|
// revert a binary instance representation back into a CIMInstance |
|
//------------------------------------------------------------------------------ |
|
void CIMInstanceResponseData::encodeBinaryResponse(CIMBuffer& out) const |
|
{ |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMInstanceResponseData::encodeBinaryResponse"); |
|
|
|
if (_resolveCallback && _binaryEncoding) |
|
{ |
|
const Array<Uint8>& data = _binaryData; |
|
out.putBytes(data.getData(), data.size()); |
|
} |
|
else |
|
{ |
|
out.putInstance(_cimInstance, false, false); |
|
} |
|
PEG_METHOD_EXIT(); |
|
} |
|
|
|
//------------------------------------------------------------------------------ |
|
// Encodes the CIMInstanc representation contained in the current |
|
// CIMResponseData object in xml response message format. |
|
// This code corresponds to method _resolveXmlInstance, which is used |
|
// revert a CIM-XML instance representation back into a CIMInstance. |
|
//------------------------------------------------------------------------------ |
|
void CIMInstanceResponseData::encodeXmlResponse(Buffer& out) const |
|
{ |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMInstanceResponseData::encodeXmlResponse"); |
|
|
|
if (_resolveCallback && !_binaryEncoding) |
|
{ |
|
out.append( (char*)_instanceData.getData(),_instanceData.size()-1); |
|
} |
|
else |
|
{ |
|
XmlWriter::appendInstanceElement(out, _cimInstance); |
|
} |
|
PEG_METHOD_EXIT(); |
|
} | } |
| |
//------------------------------------------------------------------------------ |
// Binary data is just a data stream |
// Instantiates a CIMInstance from a binary representation created by |
Array<Uint8>& CIMResponseData::getBinary() |
// the CIMBinMessageSerializer. |
|
// Returns true on success. |
|
//------------------------------------------------------------------------------ |
|
Boolean CIMInstanceResponseData::_resolveBinaryInstance( |
|
CIMInstanceResponseData* data, |
|
CIMInstance& instance) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
// TODO: Check if the following condition might come true |
"CIMInstanceResponseData::_resolveBinaryInstance"); |
// One actually should resolve everything down to binary in here ... |
|
return _binaryData; |
CIMBuffer in((char*)data->_binaryData.getData(), data->_binaryData.size()); |
|
|
|
if (!in.getInstance(instance)) |
|
{ |
|
instance = CIMInstance(); |
|
in.release(); |
|
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
"Failed to resolve binary instance!"); |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} | } |
| |
in.release(); |
bool CIMResponseData::setBinary(CIMBuffer& in, bool hasLen) |
PEG_METHOD_EXIT(); |
|
return true; |
|
} |
|
|
|
//------------------------------------------------------------------------------ |
|
// Instantiates a CIMInstance from an xml representation created by |
|
// the CIMBinMessageSerializer. |
|
// Returns true on success. |
|
//------------------------------------------------------------------------------ |
|
Boolean CIMInstanceResponseData::_resolveXMLInstance( |
|
CIMInstanceResponseData* data, |
|
CIMInstance& cimInstance) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMInstanceResponseData::_resolveXMLInstance"); |
"CIMResponseData::setBinary"); |
| |
// Deserialize instance: |
if (hasLen) |
{ | { |
XmlParser parser((char*)data->_instanceData.getData()); |
if (!in.getUint8A(_binaryData)) |
|
|
if (!XmlReader::getInstanceElement(parser, cimInstance)) |
|
{ | { |
cimInstance = CIMInstance(); |
|
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, | PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
"Failed to resolve XML instance, parser error!"); |
"Failed to get binary object path data!"); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return false; | return false; |
} | } |
} | } |
|
else |
// Deserialize path: |
|
{ |
|
XmlParser parser((char*)data->_referenceData.getData()); |
|
CIMObjectPath cimObjectPath; |
|
|
|
if (XmlReader::getValueReferenceElement(parser, cimObjectPath)) |
|
{ | { |
if (data->_hostData.size()) |
size_t remainingDataLength = in.capacity() - in.size(); |
cimObjectPath.setHost(data->_hostData); |
_binaryData.append((Uint8*)in.getPtr(), remainingDataLength); |
|
|
if (!data->_nameSpaceData.isNull()) |
|
cimObjectPath.setNameSpace(data->_nameSpaceData); |
|
|
|
cimInstance.setPath(cimObjectPath); |
|
} | } |
} |
_encoding |= RESP_ENC_BINARY; |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return true; | return true; |
} | } |
| |
|
bool CIMResponseData::setXml(CIMBuffer& in) |
//----------------------------------------------------------------------------- |
|
// |
|
// CIMInstancesResponseData |
|
// |
|
//----------------------------------------------------------------------------- |
|
|
|
//------------------------------------------------------------------------------ |
|
// Reverts a binary instance array representation back into an array of |
|
// CIMInstance |
|
//------------------------------------------------------------------------------ |
|
bool CIMInstancesResponseData::setBinaryCimInstances(CIMBuffer& in) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMInstancesResponseData::setBinaryCimInstances"); |
"CIMResponseData::setXml"); |
|
|
if (!in.getUint8A(_binaryData)) |
|
{ |
|
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
"Failed to get binary instance data!"); |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
|
|
_resolveCallback = _resolveBinaryInstances; |
|
_binaryEncoding = true; |
|
|
|
PEG_METHOD_EXIT(); |
|
return true; |
|
}; |
|
| |
bool CIMInstancesResponseData::setXmlCimInstances(CIMBuffer& in) |
if (_dataType == RESP_INSTNAMES) |
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMInstancesResponseData::setXmlCimInstances"); |
|
|
|
Uint32 count; | Uint32 count; |
| |
if (!in.getUint32(count)) | if (!in.getUint32(count)) |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, | PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
"Failed to get XML instance data (number of instance)!"); |
"Failed to get XML objectpath data (number of paths)!"); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return false; | return false; |
} | } |
| |
for (Uint32 i = 0; i < count; i++) | for (Uint32 i = 0; i < count; i++) |
{ | { |
Array<Sint8> inst; |
|
Array<Sint8> ref; | Array<Sint8> ref; |
CIMNamespaceName ns; | CIMNamespaceName ns; |
String host; | String host; |
| |
if (!in.getSint8A(inst)) |
|
{ |
|
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
|
"Failed to get XML instance data (instances)!"); |
|
PEG_METHOD_EXIT(); |
|
return false; |
|
} |
|
|
|
if (!in.getSint8A(ref)) | if (!in.getSint8A(ref)) |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, | PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
"Failed to get XML instance data (references)!"); |
"Failed to get XML objectpath data (references)!"); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return false; | return false; |
} | } |
|
|
return false; | return false; |
} | } |
| |
_instancesData.append(inst); |
|
_referencesData.append(ref); | _referencesData.append(ref); |
_hostsData.append(host); | _hostsData.append(host); |
_nameSpacesData.append(ns); | _nameSpacesData.append(ns); |
} | } |
|
} |
|
// TODO: Code the left out types |
| |
_resolveCallback = _resolveXMLInstances; |
_encoding |= RESP_ENC_XML; |
_binaryEncoding = false; |
|
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return true; | return true; |
}; |
} |
|
|
|
// function used by OperationAggregator to aggregate response data in a |
|
// single ResponseData object |
|
void CIMResponseData::appendResponseData(const CIMResponseData & x) |
|
{ |
|
// as the Messages set the data types, this should be impossible |
|
PEGASUS_DEBUG_ASSERT(_dataType == x._dataType); |
|
_encoding |= x._encoding; |
| |
|
// add all binary data |
|
_binaryData.appendArray(x._binaryData); |
| |
|
// add all the C++ stuff |
|
_instanceNames.appendArray(x._instanceNames); |
|
_instances.appendArray(x._instances); |
|
_objects.appendArray(x._objects); |
| |
|
// add the SCMO instances |
|
_scmoInstances.appendArray(x._scmoInstances); |
| |
//------------------------------------------------------------------------------ |
// add Xml encodings too |
// Encodes the array of CIMInstance representation contained in the current |
_referencesData.appendArray(x._referencesData); |
// CIMResponseData object in binary response message format. |
_instanceData.appendArray(x._instanceData); |
// This code corresponds to method _resolveBinaryInstances, which is used |
_hostsData.appendArray(x._hostsData); |
// revert a binary instance array representation back into an array of |
_nameSpacesData.appendArray(x._nameSpacesData); |
// CIMInstance |
} |
//------------------------------------------------------------------------------ |
|
void CIMInstancesResponseData::encodeBinaryResponse(CIMBuffer& out) const |
// Encoding responses into output format |
|
void CIMResponseData::encodeBinaryResponse(CIMBuffer& out) |
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMInstancesResponseData::encodeBinaryResponse"); |
"CIMResponseData::encodeBinaryResponse"); |
| |
if (_resolveCallback && _binaryEncoding) |
// Need to do a complete job here by transferring all contained data |
|
// into binary format and handing it out in the CIMBuffer |
|
if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) |
{ | { |
|
// Binary does NOT need a marker as it consists of C++ and SCMO |
const Array<Uint8>& data = _binaryData; | const Array<Uint8>& data = _binaryData; |
out.putBytes(data.getData(), data.size()); | out.putBytes(data.getData(), data.size()); |
} | } |
else |
if (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM)) |
|
{ |
|
// TODO: Set Marker for C++ data |
|
switch (_dataType) |
|
{ |
|
case RESP_INSTNAMES: |
|
{ |
|
out.putObjectPathA(_instanceNames, false); |
|
break; |
|
} |
|
case RESP_INSTANCE: |
|
{ |
|
if (0 != _instances.size()) |
|
{ |
|
out.putInstance(_instances[0], false, false); |
|
} |
|
break; |
|
} |
|
case RESP_INSTANCES: |
|
{ |
|
out.putInstanceA(_instances, false); |
|
break; |
|
} |
|
case RESP_OBJECTS: |
|
{ |
|
out.putObjectA(_objects); |
|
break; |
|
} |
|
case RESP_OBJECTPATHS: |
|
{ |
|
// TODO: Determine what to do here |
|
break; |
|
} |
|
default: |
|
{ |
|
// TODO: |
|
// Argl, not nice, but not a problem yet, ignore this |
|
} |
|
} |
|
} |
|
if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) |
{ | { |
out.putInstanceA(_namedInstances, false); |
// TODO: Set Marker for SCMO data |
|
|
|
// Call magic here to transform a SCMO object into binary format |
|
fprintf(stderr, "Watch wat ya do'n! SCMO to binary ? NO OOP yet.\n"); |
|
fflush(stderr); |
|
} |
|
if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) |
|
{ |
|
// This actually should not happen following general code logic |
|
PEGASUS_DEBUG_ASSERT(true); |
} | } |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
//------------------------------------------------------------------------------ |
void CIMResponseData::encodeXmlResponse(Buffer& out) |
// Encodes the array of CIMInstance representation contained in the current |
|
// CIMResponseData object in xml response message format. |
|
// This code corresponds to method _resolveXmlInstances, which is used |
|
// revert a CIM-XML object array representation back into an array of |
|
// CIMInstance. |
|
//------------------------------------------------------------------------------ |
|
void CIMInstancesResponseData::encodeXmlResponse(Buffer& out) const |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMInstancesResponseData::encodeXmlResponse"); |
"CIMResponseData::encodeXmlResponse"); |
| |
if (_resolveCallback && !_binaryEncoding) |
fprintf( |
|
stderr, |
|
"encodeXmlResponse(encoding=%X,content=%X)\n", |
|
_encoding, |
|
_dataType); |
|
fflush(stderr); |
|
|
|
if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) |
|
{ |
|
switch (_dataType) |
|
{ |
|
case RESP_INSTNAMES: |
{ | { |
const Array<ArraySint8>& a = _instancesData; |
const Array<ArraySint8>& a = _referencesData; |
|
for (Uint32 i = 0, n = a.size(); i < n; i++) |
|
{ |
|
out.append((char*)a[i].getData(), a[i].size() - 1); |
|
} |
|
break; |
|
} |
|
case RESP_INSTANCE: |
|
{ |
|
out.append( |
|
(char*)_instanceData.getData(), |
|
_instanceData.size()-1); |
|
break; |
|
} |
|
case RESP_INSTANCES: |
|
{ |
|
const Array<ArraySint8>& a = _instanceData; |
const Array<ArraySint8>& b = _referencesData; | const Array<ArraySint8>& b = _referencesData; |
| |
for (Uint32 i = 0, n = a.size(); i < n; i++) | for (Uint32 i = 0, n = a.size(); i < n; i++) |
|
|
out.append((char*)a[i].getData(), a[i].size() - 1); | out.append((char*)a[i].getData(), a[i].size() - 1); |
out << STRLIT("</VALUE.NAMEDINSTANCE>\n"); | out << STRLIT("</VALUE.NAMEDINSTANCE>\n"); |
} | } |
|
break; |
} | } |
else |
case RESP_OBJECTS: |
{ | { |
for (Uint32 i = 0, n = _namedInstances.size(); i < n; i++) |
const Array<ArraySint8>& a = _instanceData; |
XmlWriter::appendValueNamedInstanceElement( |
const Array<ArraySint8>& b = _referencesData; |
out, _namedInstances[i]); |
|
|
for (Uint32 i = 0, n = a.size(); i < n; i++) |
|
{ |
|
out << STRLIT("<VALUE.OBJECTWITHPATH>\n"); |
|
out.append((char*)b[i].getData(), b[i].size() - 1); |
|
out.append((char*)a[i].getData(), a[i].size() - 1); |
|
out << STRLIT("</VALUE.OBJECTWITHPATH>\n"); |
} | } |
PEG_METHOD_EXIT(); |
break; |
} | } |
|
case RESP_OBJECTPATHS: |
//------------------------------------------------------------------------------ |
|
// Instantiates an array of CIMInstances from a binary representation created by |
|
// the CIMBinMessageSerializer. |
|
// Returns true on success. |
|
//------------------------------------------------------------------------------ |
|
Boolean CIMInstancesResponseData::_resolveBinaryInstances( |
|
CIMInstancesResponseData* data, |
|
Array<CIMInstance>& instances) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
// TODO: Check what to do in this case |
"CIMInstancesResponseData::_resolveBinaryInstances"); |
const Array<ArraySint8>& a = _instanceData; |
|
const Array<ArraySint8>& b = _referencesData; |
instances.clear(); |
|
|
|
CIMBuffer in((char*)data->_binaryData.getData(), data->_binaryData.size()); |
|
| |
if (!in.getInstanceA(instances)) |
for (Uint32 i = 0, n = a.size(); i < n; i++) |
{ | { |
in.release(); |
out << STRLIT("<VALUE.OBJECTWITHPATH>\n"); |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
out.append((char*)b[i].getData(), b[i].size() - 1); |
"Failed to remove binary instance!"); |
out.append((char*)a[i].getData(), a[i].size() - 1); |
PEG_METHOD_EXIT(); |
out << STRLIT("</VALUE.OBJECTWITHPATH>\n"); |
return false; |
|
} | } |
|
|
in.release(); |
|
PEG_METHOD_EXIT(); |
|
return true; |
|
} | } |
|
default: |
|
|
|
|
//------------------------------------------------------------------------------ |
|
// Instantiates an array of CIMInstances from an xml representation created by |
|
// the CIMBinMessageSerializer. |
|
// Returns true on success. |
|
//------------------------------------------------------------------------------ |
|
Boolean CIMInstancesResponseData::_resolveXMLInstances( |
|
CIMInstancesResponseData* data, |
|
Array<CIMInstance>& instances) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
// TODO: |
"CIMInstancesResponseData::_resolveXMLInstances"); |
// Argl, not nice, but not a problem yet, ignore this |
|
} |
instances.clear(); |
} |
|
} |
| |
for (Uint32 i = 0; i < data->_instancesData.size(); i++) |
if (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM)) |
{ | { |
CIMInstance cimInstance; |
fprintf(stderr,"Got CIM data...\n"); |
|
fflush(stderr); |
// Deserialize instance: |
// TODO: Set Marker for C++ data |
|
switch (_dataType) |
{ | { |
XmlParser parser((char*)data->_instancesData[i].getData()); |
case RESP_INSTNAMES: |
|
|
if (!XmlReader::getInstanceElement(parser, cimInstance)) |
|
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
for (Uint32 i = 0, n = _instanceNames.size(); i < n; i++) |
"Failed to resolve XML instance. Creating empty instance!"); |
{ |
cimInstance = CIMInstance(); |
XmlWriter::appendInstanceNameElement(out,_instanceNames[i]); |
} | } |
|
break; |
} | } |
|
case RESP_INSTANCE: |
// Deserialize path: |
|
{ | { |
XmlParser parser((char*)data->_referencesData[i].getData()); |
if (_instances.size()>0) |
CIMObjectPath cimObjectPath; |
|
|
|
if (XmlReader::getInstanceNameElement(parser, cimObjectPath)) |
|
{ | { |
if (!data->_nameSpacesData[i].isNull()) |
XmlWriter::appendInstanceElement(out, _instances[0]); |
cimObjectPath.setNameSpace(data->_nameSpacesData[i]); |
|
|
|
if (data->_hostsData[i].size()) |
|
cimObjectPath.setHost(data->_hostsData[i]); |
|
|
|
cimInstance.setPath(cimObjectPath); |
|
} | } |
|
break; |
} | } |
|
case RESP_INSTANCES: |
instances.append(cimInstance); |
{ |
|
for (Uint32 i = 0, n = _instances.size(); i < n; i++) |
|
{ |
|
XmlWriter::appendValueNamedInstanceElement( |
|
out, _instances[i]); |
} | } |
|
break; |
PEG_METHOD_EXIT(); |
|
return true; |
|
} | } |
|
case RESP_OBJECTS: |
|
|
//----------------------------------------------------------------------------- |
|
// |
|
// CIMObjectsResponseData |
|
// |
|
//----------------------------------------------------------------------------- |
|
|
|
|
|
bool CIMObjectsResponseData::setBinaryCimObjects(CIMBuffer& in) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
for (Uint32 i = 0; i < _objects.size(); i++) |
"CIMObjectsResponseData::setBinaryCimObjects"); |
|
|
|
if (!in.getUint8A(_binaryData)) |
|
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
XmlWriter::appendValueObjectWithPathElement( |
"Failed to get binary object data!"); |
out, |
PEG_METHOD_EXIT(); |
_objects[i]); |
return false; |
|
} | } |
|
break; |
_resolveCallback = _resolveBinaryObjects; |
} |
_binaryEncoding = true; |
case RESP_OBJECTPATHS: |
|
|
PEG_METHOD_EXIT(); |
|
return true; |
|
}; |
|
|
|
bool CIMObjectsResponseData::setXmlCimObjects(CIMBuffer& in) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
for (Uint32 i = 0, n = _instanceNames.size(); i < n; i++) |
"CIMObjectsResponseData::setXmlCimObjects"); |
|
|
|
Uint32 count; |
|
|
|
if (!in.getUint32(count)) |
|
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
out << "<OBJECTPATH>\n"; |
"Failed to get XML object data (number of objects)!"); |
XmlWriter::appendValueReferenceElement( |
PEG_METHOD_EXIT(); |
out, |
return false; |
_instanceNames[i], |
|
false); |
|
out << "</OBJECTPATH>\n"; |
} | } |
|
break; |
for (Uint32 i = 0; i < count; i++) |
} |
|
default: |
{ | { |
Array<Sint8> obj; |
// TODO: |
Array<Sint8> ref; |
// Argl, not nice, but not a problem yet, ignore this |
CIMNamespaceName ns; |
} |
String host; |
} |
|
} |
|
if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) |
|
{ |
|
/*SCMODump dmp; |
|
dmp.dumpSCMOInstanceKeyBindings(_scmoInstances[i]); |
|
dmp.dumpInstanceProperties(_scmoInstances[i]);*/ |
| |
if (!in.getSint8A(obj)) |
switch (_dataType) |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
case RESP_INSTNAMES: |
"Failed to get XML object data (object)!"); |
{ |
PEG_METHOD_EXIT(); |
for (Uint32 i = 0, n = _scmoInstances.size(); i < n; i++) |
return false; |
{ |
|
SCMOXmlWriter::appendInstanceNameElement( |
|
out, |
|
_scmoInstances[i]); |
} | } |
|
break; |
if (!in.getSint8A(ref)) |
} |
|
case RESP_INSTANCE: |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
if (_scmoInstances.size() > 0) |
"Failed to get XML object data (reference)!"); |
{ |
PEG_METHOD_EXIT(); |
SCMOXmlWriter::appendInstanceElement(out,_scmoInstances[0]); |
return false; |
|
} | } |
|
break; |
|
} |
|
case RESP_INSTANCES: |
|
{ |
|
fprintf( |
|
stderr,"encodeXmlResponse(SCMO)=%dinstances...\n", |
|
_scmoInstances.size()); |
|
fflush(stderr); |
| |
if (!in.getString(host)) |
for (Uint32 i = 0, n = _scmoInstances.size(); i < n; i++) |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
SCMOXmlWriter::appendValueSCMOInstanceElement( |
"Failed to get XML object data (host)!"); |
out, |
PEG_METHOD_EXIT(); |
_scmoInstances[i]); |
return false; |
|
} | } |
|
break; |
if (!in.getNamespaceName(ns)) |
} |
|
case RESP_OBJECTS: |
{ | { |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
for (Uint32 i = 0; i < _scmoInstances.size(); i++) |
"Failed to get XML object data (namespace)!"); |
{ |
PEG_METHOD_EXIT(); |
/* |
return false; |
SCMOXmlWriter::appendValueObjectWithPathElement( |
|
out, |
|
_scmoInstances[i]); |
|
*/ |
} | } |
|
break; |
_cimObjectsData.append(obj); |
} |
_referencesData.append(ref); |
case RESP_OBJECTPATHS: |
_hostsData.append(host); |
{ |
_nameSpacesData.append(ns); |
break; |
|
} |
|
default: |
|
{ |
|
// TODO: |
|
// Argl, not nice, but not a problem yet, ignore this |
|
} |
|
} |
|
/* fprintf( |
|
stderr, |
|
"After XmlWrite()\n%s", |
|
out.getData()); |
|
fflush(stderr);*/ |
} | } |
| |
_resolveCallback = _resolveXMLObjects; |
} |
_binaryEncoding = false; |
|
| |
PEG_METHOD_EXIT(); |
// contrary to encodeXmlResponse this function encodes the Xml in a format |
return true; |
// not usable by clients |
|
void CIMResponseData::encodeInternalXmlResponse(CIMBuffer& out) |
|
{ |
|
// TODO: Implement |
|
// Need the full switch here again |
|
// Should use the internal data available SCMO, C++ and InternalXML |
|
// to generate the InternalXML by CIMInternalEncoder and SCMOInternalEncoder |
|
fprintf(stderr, "Watch wat ya do'n! SCMO to InternalXml ? NO OOP yet.\n"); |
|
fflush(stderr); |
} | } |
| |
//------------------------------------------------------------------------------ |
void CIMResponseData::_resolveToCIM() |
// Encodes the array of CIMObject representation contained in the current |
|
// CIMResponseData object in binary response message format. |
|
// This code corresponds to method _resolveBinaryObjects, which is used |
|
// revert a binary object array representation back into an array of |
|
// CIMObject. |
|
//------------------------------------------------------------------------------ |
|
void CIMObjectsResponseData::encodeBinaryResponse(CIMBuffer& out) const |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
fprintf( |
"CIMObjectsResponseData::encodeBinaryResponse"); |
stderr, |
|
"_resolveToCIM(encoding=%X,content=%X)\n", |
|
_encoding, |
|
_dataType); |
|
fflush(stderr); |
| |
if (_resolveCallback && _binaryEncoding) |
if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) |
{ | { |
const Array<Uint8>& data = _binaryData; |
_resolveXmlToCIM(); |
out.putBytes(data.getData(), data.size()); |
|
} | } |
else |
if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) |
{ | { |
out.putObjectA(_cimObjects); |
_resolveBinary(); |
} | } |
PEG_METHOD_EXIT(); |
if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) |
|
{ |
|
_resolveSCMOToCIM(); |
|
} |
|
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_CIM); |
} | } |
| |
//------------------------------------------------------------------------------ |
void CIMResponseData::_resolveToSCMO() |
// Encodes the array of CIMObject representation contained in the current |
|
// CIMResponseData object in xml response message format. |
|
// This code corresponds to method _resolveXmlObjects, which is used |
|
// revert a CIM-XML object array representation back into an array of |
|
// CIMObject. |
|
//------------------------------------------------------------------------------ |
|
void CIMObjectsResponseData::encodeXmlResponse(Buffer& out) const |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
fprintf( |
"CIMObjectsResponseData::encodeXmlResponse"); |
stderr, |
|
"_resolveToSCMO(encoding=%X,content=%X)\n", |
|
_encoding, |
|
_dataType); |
|
fflush(stderr); |
| |
if (_resolveCallback && !_binaryEncoding) |
if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) |
{ | { |
const Array<ArraySint8>& a = _cimObjectsData; |
_resolveXmlToSCMO(); |
const Array<ArraySint8>& b = _referencesData; |
} |
|
if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) |
|
{ |
|
_resolveBinary(); |
|
} |
|
if (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM)) |
|
{ |
|
_resolveCIMToSCMO(); |
|
} |
|
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_SCMO); |
|
} |
| |
for (Uint32 i = 0, n = a.size(); i < n; i++) |
// helper functions to transform different formats into one-another |
|
// functions work on the internal data and calling of them should be |
|
// avoided whenever possible |
|
void CIMResponseData::_resolveBinary() |
{ | { |
out << STRLIT("<VALUE.OBJECTWITHPATH>\n"); |
// Call magic here to resolve binary format |
out.append((char*)b[i].getData(), b[i].size() - 1); |
fprintf(stderr, "Watch wat ya do'n! binary ? NO OOP yet.\n"); |
out.append((char*)a[i].getData(), a[i].size() - 1); |
fflush(stderr); |
out << STRLIT("</VALUE.OBJECTWITHPATH>\n"); |
|
|
switch (_dataType) |
|
{ |
|
case RESP_INSTNAMES: |
|
{ |
|
break; |
} | } |
|
case RESP_INSTANCE: |
|
{ |
|
break; |
} | } |
else |
case RESP_INSTANCES: |
{ | { |
for (Uint32 i = 0; i < _cimObjects.size(); i++) |
break; |
|
} |
|
case RESP_OBJECTS: |
{ | { |
XmlWriter::appendValueObjectWithPathElement(out, _cimObjects[i]); |
break; |
|
} |
|
case RESP_OBJECTPATHS: |
|
{ |
|
break; |
|
} |
|
default: |
|
{ |
|
// TODO: |
|
// Argl, not nice, but not a problem yet, ignore this |
} | } |
} | } |
PEG_METHOD_EXIT(); |
|
} | } |
| |
//------------------------------------------------------------------------------ |
void CIMResponseData::_resolveXmlToCIM() |
// Instantiates an array of CIMObjects from a binary representation created by |
|
// the CIMBinMessageSerializer. |
|
// Returns true on success. |
|
//------------------------------------------------------------------------------ |
|
Boolean CIMObjectsResponseData::_resolveBinaryObjects( |
|
CIMObjectsResponseData* data, |
|
Array<CIMObject>& cimObjects) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
switch (_dataType) |
"CIMObjectsResponseData::_resolveBinaryObjects"); |
{ |
|
case RESP_INSTNAMES: |
cimObjects.clear(); |
{ |
|
for (Uint32 i = 0; i < _referencesData.size(); i++) |
|
{ |
|
CIMObjectPath cop; |
|
// Deserialize path: |
|
{ |
|
XmlParser parser((char*)_referencesData[i].getData()); |
| |
CIMBuffer in((char*)data->_binaryData.getData(), data->_binaryData.size()); |
if (XmlReader::getInstanceNameElement(parser, cop)) |
|
{ |
|
if (!_nameSpacesData[i].isNull()) |
|
cop.setNameSpace(_nameSpacesData[i]); |
| |
if (!in.getObjectA(cimObjects)) |
if (_hostsData[i].size()) |
|
cop.setHost(_hostsData[i]); |
|
} |
|
} |
|
_instanceNames.append(cop); |
|
} |
|
break; |
|
} |
|
case RESP_INSTANCE: |
{ | { |
in.release(); |
CIMInstance cimInstance; |
|
// Deserialize instance: |
|
{ |
|
XmlParser parser((char*)_instanceData[0].getData()); |
| |
|
if (!XmlReader::getInstanceElement(parser, cimInstance)) |
|
{ |
|
cimInstance = CIMInstance(); |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, | PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
"Failed to resolve binary data!"); |
"Failed to resolve XML instance, parser error!"); |
PEG_METHOD_EXIT(); |
} |
return false; |
|
} | } |
|
// Deserialize path: |
|
{ |
|
XmlParser parser((char*)_referencesData[0].getData()); |
|
CIMObjectPath cimObjectPath; |
| |
in.release(); |
if (XmlReader::getValueReferenceElement(parser, cimObjectPath)) |
PEG_METHOD_EXIT(); |
{ |
return true; |
if (_hostsData.size()) |
|
{ |
|
cimObjectPath.setHost(_hostsData[0]); |
|
} |
|
if (!_nameSpacesData[0].isNull()) |
|
{ |
|
cimObjectPath.setNameSpace(_nameSpacesData[0]); |
|
} |
|
cimInstance.setPath(cimObjectPath); |
|
// only if everything works we add the CIMInstance to the |
|
// array |
|
_instances.append(cimInstance); |
|
} |
|
} |
|
break; |
} | } |
|
case RESP_INSTANCES: |
|
{ |
|
for (Uint32 i = 0; i < _instanceData.size(); i++) |
|
{ |
|
CIMInstance cimInstance; |
|
// Deserialize instance: |
|
{ |
|
XmlParser parser((char*)_instanceData[i].getData()); |
| |
//------------------------------------------------------------------------------ |
if (!XmlReader::getInstanceElement(parser, cimInstance)) |
// Instantiates an array of CIMObjects from an xml representation created by |
|
// the CIMBinMessageSerializer. |
|
// Returns true on success. |
|
//------------------------------------------------------------------------------ |
|
Boolean CIMObjectsResponseData::_resolveXMLObjects( |
|
CIMObjectsResponseData* data, |
|
Array<CIMObject>& cimObjects) |
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
"CIMObjectsResponseData::_resolveXMLObjects"); |
"Failed to resolve XML instance." |
|
" Creating empty instance!"); |
|
cimInstance = CIMInstance(); |
|
} |
|
} |
| |
cimObjects.clear(); |
// Deserialize path: |
|
{ |
|
XmlParser parser((char*)_referencesData[i].getData()); |
|
CIMObjectPath cimObjectPath; |
| |
for (Uint32 i=0, n=data->_cimObjectsData.size(); i<n; i++) |
if (XmlReader::getInstanceNameElement(parser,cimObjectPath)) |
|
{ |
|
if (!_nameSpacesData[i].isNull()) |
|
cimObjectPath.setNameSpace(_nameSpacesData[i]); |
|
|
|
if (_hostsData[i].size()) |
|
cimObjectPath.setHost(_hostsData[i]); |
|
|
|
cimInstance.setPath(cimObjectPath); |
|
} |
|
} |
|
|
|
_instances.append(cimInstance); |
|
} |
|
break; |
|
} |
|
case RESP_OBJECTS: |
|
{ |
|
for (Uint32 i=0, n=_instanceData.size(); i<n; i++) |
{ | { |
CIMObject cimObject; | CIMObject cimObject; |
| |
// Deserialize Objects: | // Deserialize Objects: |
{ | { |
XmlParser parser((char*)data->_cimObjectsData[i].getData()); |
XmlParser parser((char*)_instanceData[i].getData()); |
| |
CIMInstance cimInstance; | CIMInstance cimInstance; |
CIMClass cimClass; | CIMClass cimClass; |
|
|
| |
// Deserialize paths: | // Deserialize paths: |
{ | { |
XmlParser parser((char*)data->_referencesData[i].getData()); |
XmlParser parser((char*)_referencesData[i].getData()); |
CIMObjectPath cimObjectPath; | CIMObjectPath cimObjectPath; |
| |
if (XmlReader::getValueReferenceElement(parser, cimObjectPath)) |
if (XmlReader::getValueReferenceElement( |
|
parser, |
|
cimObjectPath)) |
{ | { |
if (!data->_nameSpacesData[i].isNull()) |
if (!_nameSpacesData[i].isNull()) |
cimObjectPath.setNameSpace(data->_nameSpacesData[i]); |
cimObjectPath.setNameSpace(_nameSpacesData[i]); |
| |
if (data->_hostsData[i].size()) |
if (_hostsData[i].size()) |
cimObjectPath.setHost(data->_hostsData[i]); |
cimObjectPath.setHost(_hostsData[i]); |
| |
cimObject.setPath(cimObjectPath); | cimObject.setPath(cimObjectPath); |
} | } |
} | } |
|
_objects.append(cimObject); |
|
} |
|
break; |
|
} |
|
case RESP_OBJECTPATHS: |
|
{ |
|
// TODO: ???? |
|
} |
|
default: |
|
{ |
|
// TODO: |
|
// Argl, not nice, but not a problem yet, ignore this |
|
} |
|
} |
|
// Xml was resolved, release Xml content now |
|
_referencesData.clear(); |
|
_hostsData.clear(); |
|
_nameSpacesData.clear(); |
|
_instanceData.clear(); |
|
// remove Xml Encoding flag |
|
_encoding &=(!RESP_ENC_XML); |
|
// add CIM Encoding flag |
|
_encoding |=RESP_ENC_CIM; |
|
} |
| |
cimObjects.append(cimObject); |
void CIMResponseData::_resolveXmlToSCMO() |
|
{ |
|
// Not optimal, can probably be improved |
|
// but on the other hand, since using the binary format this case should |
|
// actually not ever happen. |
|
_resolveXmlToCIM(); |
|
_resolveCIMToSCMO(); |
} | } |
| |
PEG_METHOD_EXIT(); |
void CIMResponseData::_resolveSCMOToCIM() |
return true; |
{ |
|
switch(_dataType) |
|
{ |
|
case RESP_INSTNAMES: |
|
case RESP_OBJECTPATHS: |
|
{ |
|
for (Uint32 x=0, n=_scmoInstances.size(); x < n; x++) |
|
{ |
|
CIMObjectPath newObjectPath; |
|
_scmoInstances[x].getCIMObjectPath(newObjectPath); |
|
_instanceNames.append(newObjectPath); |
} | } |
|
break; |
|
} |
|
case RESP_INSTANCE: |
|
{ |
|
CIMInstance newInstance; |
|
_scmoInstances[0].getCIMInstance(newInstance); |
|
_instances.append(newInstance); |
|
break; |
|
} |
|
case RESP_INSTANCES: |
|
{ |
|
for (Uint32 x=0, n=_scmoInstances.size(); x < n; x++) |
|
{ |
|
CIMInstance newInstance; |
|
_scmoInstances[x].getCIMInstance(newInstance); |
|
_instances.append(newInstance); |
|
} |
|
break; |
|
} |
|
case RESP_OBJECTS: |
|
{ |
|
for (Uint32 x=0, n=_scmoInstances.size(); x < n; x++) |
|
{ |
|
CIMInstance newInstance; |
|
_scmoInstances[x].getCIMInstance(newInstance); |
|
_objects.append(CIMObject(newInstance)); |
|
} |
|
break; |
|
} |
|
default: |
|
{ |
|
// TODO: |
|
// Argl, not nice, but not a problem yet, ignore this |
|
} |
|
} |
|
|
|
_scmoInstances.clear(); |
|
// remove CIM Encoding flag |
|
_encoding &=(!RESP_ENC_SCMO); |
|
// add SCMO Encoding flag |
|
_encoding |=RESP_ENC_CIM; |
|
} |
|
|
|
void CIMResponseData::_resolveCIMToSCMO() |
|
{ |
|
switch (_dataType) |
|
{ |
|
case RESP_INSTNAMES: |
|
case RESP_OBJECTPATHS: |
|
{ |
|
for (Uint32 i=0,n=_instanceNames.size();i<n;i++) |
|
{ |
|
SCMOInstance addme = |
|
_getSCMOFromCIMObjectPath(_instanceNames[i]); |
|
_scmoInstances.append(addme); |
|
} |
|
break; |
|
} |
|
case RESP_INSTANCE: |
|
{ |
|
SCMOInstance addme = |
|
_getSCMOFromCIMInstance(_instances[0]); |
|
_scmoInstances.append(addme); |
|
break; |
|
} |
|
case RESP_INSTANCES: |
|
{ |
|
for (Uint32 i=0,n=_instances.size();i<n;i++) |
|
{ |
|
SCMOInstance addme = |
|
_getSCMOFromCIMInstance(_instances[i]); |
|
_scmoInstances.append(addme); |
|
} |
|
break; |
|
} |
|
case RESP_OBJECTS: |
|
{ |
|
// TODO: Implement, but how ??? |
|
break; |
|
} |
|
default: |
|
{ |
|
// TODO: |
|
// Argl, not nice, but not a problem yet, ignore this |
|
break; |
|
} |
|
} |
|
|
|
// remove CIM Encoding flag |
|
_encoding &=(!RESP_ENC_CIM); |
|
// add SCMO Encoding flag |
|
_encoding |=RESP_ENC_SCMO; |
|
} |
|
|
|
|
|
// Function to convert a CIMInstance into an SCMOInstance |
|
SCMOInstance CIMResponseData::_getSCMOFromCIMInstance( |
|
const CIMInstance& cimInst) |
|
{ |
|
const CIMObjectPath& cimPath = cimInst.getPath(); |
|
|
|
const CString nameSpace = cimPath.getNameSpace().getString().getCString(); |
|
const CString className = cimPath.getClassName().getString().getCString(); |
|
// TODO: What do when either or both are 0 ? |
|
|
|
SCMOClass * scmoClass = _getSCMOClass( |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
// TODO: What do when there is no such class ? |
| |
|
// TODO: Interrogate Thilo about need to call new |
|
SCMOInstance scmoInst = SCMOInstance(*scmoClass, cimInst); |
|
|
|
return scmoInst; |
|
} |
|
|
|
// Function to convert a CIMObjectPath into an SCMOInstance |
|
SCMOInstance CIMResponseData::_getSCMOFromCIMObjectPath( |
|
const CIMObjectPath& cimPath) |
|
{ |
|
CString nameSpace = cimPath.getNameSpace().getString().getCString(); |
|
CString className = cimPath.getClassName().getString().getCString(); |
|
|
|
// TODO: What do when either or both are 0 ? |
|
|
|
SCMOClass * scmoClass = _getSCMOClass( |
|
(const char*)nameSpace, |
|
(const char*)className); |
|
|
|
// TODO: What do when there is no such class ? |
|
|
|
// TODO: Interrogate Thilo about need to call new |
|
SCMOInstance scmoRef = SCMOInstance(*scmoClass, cimPath); |
|
|
|
return scmoRef; |
|
} |
|
|
|
SCMOClass* CIMResponseData::_getSCMOClass( |
|
const char* nameSpace, |
|
const char* cls) |
|
{ |
|
SCMOClassCache* local = SCMOClassCache::getInstance(); |
|
return local->getSCMOClass( |
|
nameSpace, |
|
strlen(nameSpace), |
|
cls, |
|
strlen(cls)); |
|
} |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |