version 1.5.2.10, 2013/09/14 23:08:17
|
version 1.5.2.11, 2013/09/23 13:55:57
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
// Defines debug code in CIMResponseData. This under this |
|
// special compile flag so that it can be compiled independent of |
|
// PEGASUS_DEBUG flags. |
|
#define CIMRESPONSEDATA_DEBUG |
|
|
#define LOCAL_MIN(a, b) ((a < b) ? a : b) | #define LOCAL_MIN(a, b) ((a < b) ? a : b) |
// C++ objects interface handling | // C++ objects interface handling |
| |
// KS_TODO Remove this completely when finished testing. | // KS_TODO Remove this completely when finished testing. |
bool CIMResponseData::sizeValid() | bool CIMResponseData::sizeValid() |
{ | { |
TRACELINE; |
PEGASUS_DEBUG_ASSERT(valid()); |
|
#ifdef CIMRESPONSEDATA_DEBUG |
PEGASUS_ASSERT(valid()); |
|
if (_size > 1000000) | if (_size > 1000000) |
{ | { |
TRACELINE; |
|
cout << "CIMResponseData::PSVALID _size too big " << _size << endl; | cout << "CIMResponseData::PSVALID _size too big " << _size << endl; |
PEG_TRACE((TRC_XML, Tracer::LEVEL4, | PEG_TRACE((TRC_XML, Tracer::LEVEL4, |
"CIMResponseData::PSVALID _size too big %u",_size )); | "CIMResponseData::PSVALID _size too big %u",_size )); |
return false; | return false; |
} | } |
|
#endif |
PEG_TRACE((TRC_XML, Tracer::LEVEL4, | PEG_TRACE((TRC_XML, Tracer::LEVEL4, |
"CIMResponseData Size _size=%u", _size)); | "CIMResponseData Size _size=%u", _size)); |
return true; | return true; |
|
|
// Instance Names handling | // Instance Names handling |
Array<CIMObjectPath>& CIMResponseData::getInstanceNames() | Array<CIMObjectPath>& CIMResponseData::getInstanceNames() |
{ | { |
TRACELINE; |
|
PSVALID; | PSVALID; |
PEGASUS_DEBUG_ASSERT( | PEGASUS_DEBUG_ASSERT( |
(_dataType==RESP_INSTNAMES || _dataType==RESP_OBJECTPATHS)); | (_dataType==RESP_INSTNAMES || _dataType==RESP_OBJECTPATHS)); |
|
|
// an empty instance. | // an empty instance. |
CIMInstance& CIMResponseData::getInstance() | CIMInstance& CIMResponseData::getInstance() |
{ | { |
TRACELINE; |
|
PEGASUS_DEBUG_ASSERT(_dataType == RESP_INSTANCE); | PEGASUS_DEBUG_ASSERT(_dataType == RESP_INSTANCE); |
_resolveToCIM(); | _resolveToCIM(); |
if (0 == _instances.size()) | if (0 == _instances.size()) |
|
|
// Instances handling | // Instances handling |
Array<CIMInstance>& CIMResponseData::getInstances() | Array<CIMInstance>& CIMResponseData::getInstances() |
{ | { |
TRACELINE; |
|
PEGASUS_DEBUG_ASSERT(_dataType == RESP_INSTANCES); | PEGASUS_DEBUG_ASSERT(_dataType == RESP_INSTANCES); |
_resolveToCIM(); | _resolveToCIM(); |
return _instances; | return _instances; |
|
|
// this keeps it working for the moment. | // this keeps it working for the moment. |
Array<CIMInstance>& CIMResponseData::getInstancesFromInstancesOrObjects() | Array<CIMInstance>& CIMResponseData::getInstancesFromInstancesOrObjects() |
{ | { |
TRACELINE; |
|
if (_dataType == RESP_INSTANCES) | if (_dataType == RESP_INSTANCES) |
{ | { |
_resolveToCIM(); | _resolveToCIM(); |
|
|
return _instances; | return _instances; |
| |
} | } |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
| |
// Objects handling | // Objects handling |
Array<CIMObject>& CIMResponseData::getObjects() | Array<CIMObject>& CIMResponseData::getObjects() |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::getObjects"); |
PEGASUS_DEBUG_ASSERT(_dataType == RESP_OBJECTS); | PEGASUS_DEBUG_ASSERT(_dataType == RESP_OBJECTS); |
_resolveToCIM(); | _resolveToCIM(); |
|
PEG_METHOD_EXIT(); |
return _objects; | return _objects; |
} | } |
| |
|
|
// represented as SCMOInstance this returns array of SCMOInstance. | // represented as SCMOInstance this returns array of SCMOInstance. |
Array<SCMOInstance>& CIMResponseData::getSCMO() | Array<SCMOInstance>& CIMResponseData::getSCMO() |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::getSCMO"); |
|
|
// This function resolves to instances and so cannot handle responses to | // This function resolves to instances and so cannot handle responses to |
// the associators,etc.requests that return classes (input object path with | // the associators,etc.requests that return classes (input object path with |
// no keys). That issue is resolved however, since CIMResponseData uses the | // no keys). That issue is resolved however, since CIMResponseData uses the |
|
|
// false(instancePaths) so that this should always produce instance paths. | // false(instancePaths) so that this should always produce instance paths. |
| |
_resolveToSCMO(); | _resolveToSCMO(); |
|
PEG_METHOD_EXIT(); |
return _scmoInstances; | return _scmoInstances; |
} | } |
| |
// set an array of SCMOInstances into the response data object | // set an array of SCMOInstances into the response data object |
void CIMResponseData::setSCMO(const Array<SCMOInstance>& x) | void CIMResponseData::setSCMO(const Array<SCMOInstance>& x) |
{ | { |
|
|
|
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setSCMO"); |
//// AutoMutex autoMut(testLock); | //// AutoMutex autoMut(testLock); |
TRACELINE; |
|
PSVALID; | PSVALID; |
_scmoInstances=x; | _scmoInstances=x; |
_encoding |= RESP_ENC_SCMO; | _encoding |= RESP_ENC_SCMO; |
_size += x.size(); | _size += x.size(); |
|
PEG_METHOD_EXIT(); |
} | } |
| |
// Binary data is just a data stream | // Binary data is just a data stream |
Array<Uint8>& CIMResponseData::getBinary() | Array<Uint8>& CIMResponseData::getBinary() |
{ | { |
TRACELINE; |
|
PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_BINARY || _encoding == 0); | PEGASUS_DEBUG_ASSERT(_encoding == RESP_ENC_BINARY || _encoding == 0); |
return _binaryData; | return _binaryData; |
} | } |
| |
bool CIMResponseData::setBinary(CIMBuffer& in) | bool CIMResponseData::setBinary(CIMBuffer& in) |
{ | { |
//// AutoMutex autoMut(testLock); |
|
|
|
TRACELINE; |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setBinary"); | PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setBinary"); |
|
//// AutoMutex autoMut(testLock); |
| |
// Append all serial data from the CIMBuffer to the local data store. | // Append all serial data from the CIMBuffer to the local data store. |
// Returns error if input not a serialized Uint8A | // Returns error if input not a serialized Uint8A |
|
|
bool CIMResponseData::setRemainingBinaryData(CIMBuffer& in) | bool CIMResponseData::setRemainingBinaryData(CIMBuffer& in) |
{ | { |
//// AutoMutex autoMut(testLock); | //// AutoMutex autoMut(testLock); |
|
|
TRACELINE; |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setRemainingBinaryData"); | PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setRemainingBinaryData"); |
| |
// Append any data that has not been deserialized already from | // Append any data that has not been deserialized already from |
|
|
bool CIMResponseData::setXml(CIMBuffer& in) | bool CIMResponseData::setXml(CIMBuffer& in) |
{ | { |
//// AutoMutex autoMut(testLock); | //// AutoMutex autoMut(testLock); |
TRACELINE; |
|
PSVALID; | PSVALID; |
switch (_dataType) | switch (_dataType) |
{ | { |
|
|
case RESP_OBJECTPATHS: | case RESP_OBJECTPATHS: |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
_encoding |= RESP_ENC_XML; | _encoding |= RESP_ENC_XML; |
|
|
// that the from object is not used during the move. | // that the from object is not used during the move. |
Uint32 CIMResponseData::moveObjects(CIMResponseData & from, Uint32 count) | Uint32 CIMResponseData::moveObjects(CIMResponseData & from, Uint32 count) |
{ | { |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::moveObjects"); |
|
|
//// AutoMutex autoMut(testLock); | //// AutoMutex autoMut(testLock); |
| |
PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::moveObjects"); |
|
TRACELINE; |
|
PEG_TRACE((TRC_XML, Tracer::LEVEL3, | PEG_TRACE((TRC_XML, Tracer::LEVEL3, |
"CIMResponseData::move(%u)", count)); | "CIMResponseData::move(%u)", count)); |
| |
PEGASUS_ASSERT(valid()); // KS_TEMP |
PEGASUS_DEBUG_ASSERT(valid()); // KS_TEMP |
PEGASUS_ASSERT(_size == 0); // Validate that to size == 0 or fix below |
PEGASUS_DEBUG_ASSERT(_size == 0); // Validate size == 0 or fix below |
if (_dataType != from._dataType) // KS_TEMP |
|
{ |
|
printf("ERROR moveObjects _dataType %u. from._dataType %u\n", |
|
_dataType, from._dataType); |
|
} |
|
PEGASUS_DEBUG_ASSERT(_dataType == from._dataType); | PEGASUS_DEBUG_ASSERT(_dataType == from._dataType); |
|
|
Uint32 rtnSize = 0; | Uint32 rtnSize = 0; |
Uint32 toMove = count; | Uint32 toMove = count; |
| |
|
|
break; | break; |
case RESP_INSTANCE: | case RESP_INSTANCE: |
{ | { |
//// TODO fix this Uint32 moveCount = toMove; |
|
if (from._instanceData.size() > 0) | if (from._instanceData.size() > 0) |
{ | { |
// temp test to assure all sizes are the same. | // temp test to assure all sizes are the same. |
PEGASUS_ASSERT(from._hostsData.size() == |
PEGASUS_DEBUG_ASSERT(from._hostsData.size() == |
from._instanceData.size()); | from._instanceData.size()); |
PEGASUS_ASSERT(from._referencesData.size() == |
PEGASUS_DEBUG_ASSERT(from._referencesData.size() == |
from._instanceData.size()); | from._instanceData.size()); |
PEGASUS_ASSERT(from._nameSpacesData.size() == |
PEGASUS_DEBUG_ASSERT(from._nameSpacesData.size() == |
from._instanceData.size()); | from._instanceData.size()); |
_instanceData.append(from._instanceData.getData(),1); | _instanceData.append(from._instanceData.getData(),1); |
from._instanceData.remove(0, 1); | from._instanceData.remove(0, 1); |
|
|
} | } |
break; | break; |
| |
// KS-TODO The above should probably be folded into the following. |
// KS-TODO The above could probably be folded into the following. |
// Need something like an assert if there is ever more than | // Need something like an assert if there is ever more than |
// one instance in _instanceData for type RESP_INSTANCE | // one instance in _instanceData for type RESP_INSTANCE |
case RESP_INSTANCES: | case RESP_INSTANCES: |
|
|
Uint32 moveCount = LOCAL_MIN(toMove, | Uint32 moveCount = LOCAL_MIN(toMove, |
from._instanceData.size()); | from._instanceData.size()); |
| |
PEGASUS_ASSERT(from._referencesData.size() == |
PEGASUS_DEBUG_ASSERT(from._referencesData.size() == |
from._instanceData.size()); | from._instanceData.size()); |
_instanceData.append(from._instanceData.getData(), | _instanceData.append(from._instanceData.getData(), |
moveCount); | moveCount); |
|
|
} | } |
if (RESP_ENC_BINARY == (from._encoding & RESP_ENC_BINARY)) | if (RESP_ENC_BINARY == (from._encoding & RESP_ENC_BINARY)) |
{ | { |
// KS_PULL TBD Add binary move function |
|
// Cannot resolve this one without actually processing | // Cannot resolve this one without actually processing |
// the data since it is a stream. |
// the data since it is a stream. Concluded that we do not |
|
// want to do that since cost higher than gain. Therefore we do |
|
// not allow this option. Should only mean that provider agent |
|
// cannot generate binary for pull operations. |
rtnSize += 0; | rtnSize += 0; |
PEGASUS_ASSERT(false); | PEGASUS_ASSERT(false); |
} | } |
|
|
_size += rtnSize; | _size += rtnSize; |
from._size -= rtnSize; | from._size -= rtnSize; |
| |
|
//// KS_TODO diagnostic that we should be able to remove |
if (rtnSize != _size) | if (rtnSize != _size) |
{ | { |
PEG_TRACE((TRC_XML, Tracer::LEVEL1, | PEG_TRACE((TRC_XML, Tracer::LEVEL1, |
|
|
Uint32 CIMResponseData::size() | Uint32 CIMResponseData::size() |
{ | { |
AutoMutex autoMut(testLock); | AutoMutex autoMut(testLock); |
TRACELINE; |
|
PEG_METHOD_ENTER(TRC_XML,"CIMResponseData::size()"); | PEG_METHOD_ENTER(TRC_XML,"CIMResponseData::size()"); |
PSVALID; | PSVALID; |
// If debug mode, add up all the individual size components to | // If debug mode, add up all the individual size components to |
|
|
// but there are many sources of size info and we need to be sure we | // but there are many sources of size info and we need to be sure we |
// have covered them all. | // have covered them all. |
#ifdef PEGASUS_DEBUG | #ifdef PEGASUS_DEBUG |
PEGASUS_ASSERT(valid()); //KS_TEMP KS_TODO |
PEGASUS_DEBUG_ASSERT(valid()); //KS_TEMP KS_TODO |
| |
Uint32 rtnSize = 0; | Uint32 rtnSize = 0; |
TEMPLOG; | TEMPLOG; |
|
|
// target array | // target array |
void CIMResponseData::appendResponseData(const CIMResponseData & x) | void CIMResponseData::appendResponseData(const CIMResponseData & x) |
{ | { |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::appendResponseData"); |
//// AutoMutex autoMut(testLock); | //// AutoMutex autoMut(testLock); |
TRACELINE; |
|
// Confirm that the CIMResponseData type matches the type | // Confirm that the CIMResponseData type matches the type |
// of the data being appended | // of the data being appended |
| |
PEGASUS_ASSERT(valid()); // KS_TEMP |
PEGASUS_DEBUG_ASSERT(valid()); // KS_TEMP |
PEGASUS_DEBUG_ASSERT(_dataType == x._dataType); | PEGASUS_DEBUG_ASSERT(_dataType == x._dataType); |
_encoding |= x._encoding; | _encoding |= x._encoding; |
| |
|
|
| |
// transfer property list | // transfer property list |
_propertyList = x._propertyList; | _propertyList = x._propertyList; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
// Encoding responses into output format | // Encoding responses into output format |
void CIMResponseData::encodeBinaryResponse(CIMBuffer& out) | void CIMResponseData::encodeBinaryResponse(CIMBuffer& out) |
{ | { |
TRACELINE; |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMResponseData::encodeBinaryResponse"); | "CIMResponseData::encodeBinaryResponse"); |
| |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) | if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) |
{ | { |
// This actually should not happen following general code logic | // This actually should not happen following general code logic |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
| |
void CIMResponseData::completeNamespace(const SCMOInstance * x) | void CIMResponseData::completeNamespace(const SCMOInstance * x) |
{ | { |
TRACELINE; |
|
const char * ns; | const char * ns; |
Uint32 len; | Uint32 len; |
ns = x->getNameSpace_l(len); | ns = x->getNameSpace_l(len); |
|
|
} | } |
} | } |
} | } |
|
|
if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) | if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) |
{ | { |
for (Uint32 j = 0, n = _scmoInstances.size(); j < n; j++) | for (Uint32 j = 0, n = _scmoInstances.size(); j < n; j++) |
|
|
const String & hn, | const String & hn, |
const CIMNamespaceName & ns) | const CIMNamespaceName & ns) |
{ | { |
TRACELINE; |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMResponseData::completeHostNameAndNamespace"); | "CIMResponseData::completeHostNameAndNamespace"); |
| |
PEGASUS_ASSERT(valid()); // KS_TEMP |
PEGASUS_DEBUG_ASSERT(valid()); // KS_TEMP |
| |
if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) | if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) |
{ | { |
|
|
{ | { |
CIMObjectPath& p = _instanceNames[j]; | CIMObjectPath& p = _instanceNames[j]; |
if (p.getHost().size() == 0) | if (p.getHost().size() == 0) |
|
{ |
p.setHost(hn); | p.setHost(hn); |
|
} |
if (p.getNameSpace().isNull()) | if (p.getNameSpace().isNull()) |
|
{ |
p.setNameSpace(ns); | p.setNameSpace(ns); |
} | } |
|
} |
break; | break; |
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
// are one of the pull responses or not | // are one of the pull responses or not |
void CIMResponseData::encodeXmlResponse(Buffer& out, Boolean isPullResponse) | void CIMResponseData::encodeXmlResponse(Buffer& out, Boolean isPullResponse) |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::encodeXmlResponse"); |
| |
PEG_TRACE((TRC_XML, Tracer::LEVEL3, | PEG_TRACE((TRC_XML, Tracer::LEVEL3, |
"CIMResponseData::encodeXmlResponse(encoding=%X,dataType=%X)", |
"CIMResponseData::encodeXmlResponse(encoding=%X,dataType=%X, pull=)", |
_encoding, | _encoding, |
_dataType)); |
_dataType, |
|
(isPullResponse? "true" : "false"))); |
| |
// already existing Internal XML does not need to be encoded further | // already existing Internal XML does not need to be encoded further |
// binary input is not actually impossible here, but we have an established | // binary input is not actually impossible here, but we have an established |
|
|
case RESP_OBJECTPATHS: | case RESP_OBJECTPATHS: |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
// contrary to encodeXmlResponse this function encodes the Xml in a format | // contrary to encodeXmlResponse this function encodes the Xml in a format |
// not usable by clients | // not usable by clients |
void CIMResponseData::encodeInternalXmlResponse(CIMBuffer& out) | void CIMResponseData::encodeInternalXmlResponse(CIMBuffer& out) |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::encodeInternalXmlResponse"); |
|
|
PEG_TRACE((TRC_XML, Tracer::LEVEL3, | PEG_TRACE((TRC_XML, Tracer::LEVEL3, |
"CIMResponseData::encodeInternalXmlResponse(encoding=%X,content=%X)", | "CIMResponseData::encodeInternalXmlResponse(encoding=%X,content=%X)", |
_encoding, | _encoding, |
|
|
case RESP_OBJECTPATHS: | case RESP_OBJECTPATHS: |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
|
case RESP_OBJECTPATHS: | case RESP_OBJECTPATHS: |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
} | } |
|
PEG_METHOD_EXIT(); |
} | } |
| |
void CIMResponseData::_resolveToCIM() | void CIMResponseData::_resolveToCIM() |
{ | { |
TRACELINE; |
|
PEG_TRACE((TRC_XML, Tracer::LEVEL3, | PEG_TRACE((TRC_XML, Tracer::LEVEL3, |
"CIMResponseData::_resolveToCIM(encoding=%X,content=%X)", | "CIMResponseData::_resolveToCIM(encoding=%X,content=%X)", |
_encoding, | _encoding, |
|
|
| |
void CIMResponseData::_resolveToSCMO() | void CIMResponseData::_resolveToSCMO() |
{ | { |
TRACELINE; |
|
PEG_TRACE((TRC_XML, Tracer::LEVEL3, | PEG_TRACE((TRC_XML, Tracer::LEVEL3, |
"CIMResponseData::_resolveToSCMO(encoding=%X,content=%X)", | "CIMResponseData::_resolveToSCMO(encoding=%X,content=%X)", |
_encoding, | _encoding, |
|
|
// avoided whenever possible | // avoided whenever possible |
void CIMResponseData::_resolveBinary() | void CIMResponseData::_resolveBinary() |
{ | { |
TRACELINE; |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMResponseData::_resolveBinary"); | "CIMResponseData::_resolveBinary"); |
| |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} // switch | } // switch |
_encoding |= RESP_ENC_CIM; | _encoding |= RESP_ENC_CIM; |
|
|
| |
void CIMResponseData::_deserializeObject(Uint32 idx,CIMObject& cimObject) | void CIMResponseData::_deserializeObject(Uint32 idx,CIMObject& cimObject) |
{ | { |
|
|
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::_deserializeObject"); |
// Only start the parser when instance data is present. | // Only start the parser when instance data is present. |
if (0 != _instanceData[idx].size()) | if (0 != _instanceData[idx].size()) |
{ | { |
|
|
PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, | PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1, |
"Failed to resolve XML object data, parser error!"); | "Failed to resolve XML object data, parser error!"); |
} | } |
|
PEG_METHOD_EXIT(); |
} | } |
| |
void CIMResponseData::_deserializeInstance(Uint32 idx,CIMInstance& cimInstance) | void CIMResponseData::_deserializeInstance(Uint32 idx,CIMInstance& cimInstance) |
{ | { |
|
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::_deserializeInstance"); |
// Only start the parser when instance data is present. | // Only start the parser when instance data is present. |
if (0 != _instanceData[idx].size()) | if (0 != _instanceData[idx].size()) |
{ | { |
|
|
// reset instance when parsing may not be successfull or | // reset instance when parsing may not be successfull or |
// no instance is present. | // no instance is present. |
cimInstance = CIMInstance(); | cimInstance = CIMInstance(); |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
Boolean CIMResponseData::_deserializeReference( | Boolean CIMResponseData::_deserializeReference( |
|
|
| |
void CIMResponseData::_resolveXmlToCIM() | void CIMResponseData::_resolveXmlToCIM() |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::_resolveXmlToCIM"); |
|
|
switch (_dataType) | switch (_dataType) |
{ | { |
// Xml encoding for instance names and object paths not used | // Xml encoding for instance names and object paths not used |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
// Xml was resolved, release Xml content now | // Xml was resolved, release Xml content now |
|
|
_encoding &=(~RESP_ENC_XML); | _encoding &=(~RESP_ENC_XML); |
// add CIM Encoding flag | // add CIM Encoding flag |
_encoding |=RESP_ENC_CIM; | _encoding |=RESP_ENC_CIM; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
void CIMResponseData::_resolveXmlToSCMO() | void CIMResponseData::_resolveXmlToSCMO() |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::_resolveXmlToSCMO"); |
// Not optimal, can probably be improved | // Not optimal, can probably be improved |
// but on the other hand, since using the binary format this case should | // but on the other hand, since using the binary format this case should |
// actually not ever happen. | // actually not ever happen. |
_resolveXmlToCIM(); | _resolveXmlToCIM(); |
_resolveCIMToSCMO(); | _resolveCIMToSCMO(); |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
void CIMResponseData::_resolveSCMOToCIM() | void CIMResponseData::_resolveSCMOToCIM() |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::_resolveSCMOToCIM"); |
switch(_dataType) | switch(_dataType) |
{ | { |
case RESP_INSTNAMES: | case RESP_INSTNAMES: |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
_scmoInstances.clear(); | _scmoInstances.clear(); |
|
|
_encoding &=(~RESP_ENC_SCMO); | _encoding &=(~RESP_ENC_SCMO); |
// add SCMO Encoding flag | // add SCMO Encoding flag |
_encoding |=RESP_ENC_CIM; | _encoding |=RESP_ENC_CIM; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
void CIMResponseData::_resolveCIMToSCMO() | void CIMResponseData::_resolveCIMToSCMO() |
{ | { |
TRACELINE; |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMResponseData::_resolveCIMToSCMO"); |
CString nsCString=_defaultNamespace.getString().getCString(); | CString nsCString=_defaultNamespace.getString().getCString(); |
const char* _defNamespace = nsCString; | const char* _defNamespace = nsCString; |
Uint32 _defNamespaceLen; | Uint32 _defNamespaceLen; |
|
|
} | } |
default: | default: |
{ | { |
PEGASUS_DEBUG_ASSERT(false); |
PEGASUS_ASSERT(false); |
} | } |
} | } |
| |
|
|
_encoding &=(~RESP_ENC_CIM); | _encoding &=(~RESP_ENC_CIM); |
// add SCMO Encoding flag | // add SCMO Encoding flag |
_encoding |=RESP_ENC_SCMO; | _encoding |=RESP_ENC_SCMO; |
|
|
|
PEG_METHOD_EXIT(); |
} | } |
| |
/** | /** |
|
|
const Boolean includeClassOrigin, | const Boolean includeClassOrigin, |
const CIMPropertyList& propertyList) | const CIMPropertyList& propertyList) |
{ | { |
TRACELINE; |
|
_includeQualifiers = includeQualifiers; | _includeQualifiers = includeQualifiers; |
_includeClassOrigin = includeClassOrigin; | _includeClassOrigin = includeClassOrigin; |
_propertyList = propertyList; | _propertyList = propertyList; |