version 1.5.2.26, 2014/05/10 20:19:58
|
version 1.5.2.28, 2014/06/01 19:26:52
|
|
|
else | else |
{ | { |
from._size = 0; | from._size = 0; |
//// KS_TODO Diagnostic since this should never occur |
|
PEG_TRACE((TRC_XML, Tracer::LEVEL1, |
|
"Size in from set to zero from= %u rtnSize= %u", |
|
from._size, rtnSize)); |
|
} | } |
| |
//// KS_TODO diagnostic that we should be able to remove | //// KS_TODO diagnostic that we should be able to remove |
|
|
// Sets the _size variable based on the internal size counts. | // Sets the _size variable based on the internal size counts. |
void CIMResponseData::setSize() | void CIMResponseData::setSize() |
{ | { |
PEGASUS_DEBUG_ASSERT(valid()); //KS_TEMP KS_TODO |
PEGASUS_DEBUG_ASSERT(valid()); |
| |
Uint32 rtnSize = 0; | Uint32 rtnSize = 0; |
if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) | if (RESP_ENC_XML == (_encoding & RESP_ENC_XML)) |
|
|
// 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. |
rtnSize += 0; | rtnSize += 0; |
// KS_TODO flag on this one |
|
} | } |
| |
if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) | if (RESP_ENC_SCMO == (_encoding & RESP_ENC_SCMO)) |
|
|
boolToString(RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) | boolToString(RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) |
)); | )); |
} | } |
PEG_TRACE((TRC_XML, Tracer::LEVEL1, "ReturnSize=%u", _size )); |
|
#endif | #endif |
return _size; | return _size; |
} | } |
|
|
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMResponseData::appendResponseData"); | "CIMResponseData::appendResponseData"); |
|
|
|
PEGASUS_DEBUG_ASSERT(valid()); |
|
|
// 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 |
|
// A CIMResponseData must represent a single data content type. |
|
// ex. Cannot mix objects and instances. |
| |
PEGASUS_DEBUG_ASSERT(valid()); // KS_TEMP |
|
PEGASUS_DEBUG_ASSERT(_dataType == x._dataType); | PEGASUS_DEBUG_ASSERT(_dataType == x._dataType); |
_encoding |= x._encoding; | _encoding |= x._encoding; |
| |
// add all binary data | // add all binary data |
_binaryData.appendArray(x._binaryData); | _binaryData.appendArray(x._binaryData); |
// KS_TBD TODO PULL Add the counter incrementer for binary |
|
| |
// add all the C++ stuff | // add all the C++ stuff |
_instanceNames.appendArray(x._instanceNames); | _instanceNames.appendArray(x._instanceNames); |
|
|
_scmoInstances.appendArray(x._scmoInstances); | _scmoInstances.appendArray(x._scmoInstances); |
_size += x._scmoInstances.size(); | _size += x._scmoInstances.size(); |
| |
// add Xml encodings |
|
// KS_TODO these are temporary. delete before release |
|
PEGASUS_ASSERT(x._referencesData.size() == x._instanceData.size()); |
|
PEGASUS_ASSERT(x._instanceData.size() == x._hostsData.size()); |
|
PEGASUS_ASSERT(x._instanceData.size() == x._nameSpacesData.size()); |
|
|
|
_referencesData.appendArray(x._referencesData); | _referencesData.appendArray(x._referencesData); |
_instanceData.appendArray(x._instanceData); | _instanceData.appendArray(x._instanceData); |
_hostsData.appendArray(x._hostsData); | _hostsData.appendArray(x._hostsData); |
|
|
PEG_METHOD_ENTER(TRC_DISPATCHER, | PEG_METHOD_ENTER(TRC_DISPATCHER, |
"CIMResponseData::completeHostNameAndNamespace"); | "CIMResponseData::completeHostNameAndNamespace"); |
| |
PEGASUS_DEBUG_ASSERT(valid()); // KS_TEMP |
PEGASUS_DEBUG_ASSERT(valid()); |
|
|
Uint32 count = 0; //// KS_TODO this counter is just diagnostic |
|
| |
PEG_TRACE(( TRC_DISPATCHER, Tracer::LEVEL4, // KS_TODO TEMP |
//// PEG_TRACE(( TRC_DISPATCHER, Tracer::LEVEL4, // KS_TODO TEMP |
"completeHostNameAndNamespace Setting hostName, etc " |
//// "completeHostNameAndNamespace Setting hostName, etc " |
"host %s ns %s set for dataType=%u encoding=%u isPull=%s", |
//// "host %s ns %s set for dataType=%u encoding=%u isPull=%s", |
(const char *)hn.getCString(), |
//// (const char *)hn.getCString(), |
(const char *)ns.getString().getCString(), |
//// (const char *)ns.getString().getCString(), |
_dataType, _encoding, boolToString(isPullOperation) )); |
//// _dataType, _encoding, boolToString(isPullOperation) )); |
| |
if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) | if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY)) |
{ | { |
|
|
// -> usage: See resolveBinary() | // -> usage: See resolveBinary() |
_defaultNamespace=ns; | _defaultNamespace=ns; |
_defaultHostname=hn; | _defaultHostname=hn; |
count++; |
|
} | } |
// InternalXml does not support objectPath calls | // InternalXml does not support objectPath calls |
if ((RESP_ENC_XML == (_encoding & RESP_ENC_XML)) && | if ((RESP_ENC_XML == (_encoding & RESP_ENC_XML)) && |
|
|
if (0 == _hostsData[j].size()) | if (0 == _hostsData[j].size()) |
{ | { |
_hostsData[j]=hn; | _hostsData[j]=hn; |
count++; |
|
} | } |
if (_nameSpacesData[j].isNull()) | if (_nameSpacesData[j].isNull()) |
{ | { |
|
|
{ | { |
if (0 == _hostsData[j].size()) | if (0 == _hostsData[j].size()) |
{ | { |
count++; |
|
_hostsData[j]=hn; | _hostsData[j]=hn; |
} | } |
if (_nameSpacesData[j].isNull()) | if (_nameSpacesData[j].isNull()) |
|
|
const_cast<CIMObjectPath&>(instance.getPath()); | const_cast<CIMObjectPath&>(instance.getPath()); |
if (p.getHost().size()==0) | if (p.getHost().size()==0) |
{ | { |
count++; |
|
p.setHost(hn); | p.setHost(hn); |
} | } |
if (p.getNameSpace().isNull()) | if (p.getNameSpace().isNull()) |
|
|
const_cast<CIMObjectPath&>(object.getPath()); | const_cast<CIMObjectPath&>(object.getPath()); |
if (p.getHost().size()==0) | if (p.getHost().size()==0) |
{ | { |
count++; |
|
p.setHost(hn); | p.setHost(hn); |
} | } |
if (p.getNameSpace().isNull()) | if (p.getNameSpace().isNull()) |
|
|
CIMObjectPath& p = _instanceNames[j]; | CIMObjectPath& p = _instanceNames[j]; |
if (p.getHost().size() == 0) | if (p.getHost().size() == 0) |
{ | { |
count++; |
|
p.setHost(hn); | p.setHost(hn); |
} | } |
if (p.getNameSpace().isNull()) | if (p.getNameSpace().isNull()) |
|
|
{ | { |
for (Uint32 j = 0, n = _scmoInstances.size(); j < n; j++) | for (Uint32 j = 0, n = _scmoInstances.size(); j < n; j++) |
{ | { |
count++; |
|
SCMOInstance & scmoInst=_scmoInstances[j]; | SCMOInstance & scmoInst=_scmoInstances[j]; |
scmoInst.completeHostNameAndNamespace( | scmoInst.completeHostNameAndNamespace( |
hnChars, | hnChars, |
|
|
} | } |
} | } |
} | } |
PEG_TRACE(( TRC_DISPATCHER, Tracer::LEVEL4, // KS_TODO TEMP |
|
"completeHostNameAndNamespace Set hostName, etc count %u " |
|
"host %s ns %s set for dataType=%u encoding=%u isPull=%s", |
|
count, |
|
(const char *)hn.getCString(), |
|
(const char *)ns.getString().getCString(), |
|
_dataType, _encoding, boolToString(isPullOperation) )); |
|
|
|
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
|
{ | { |
if (isPullResponse) | if (isPullResponse) |
{ | { |
// KS_TODO these are temporary. delete before release |
|
PEGASUS_ASSERT(a.size() == b.size()); |
|
PEGASUS_ASSERT(a.size() == _hostsData.size()); |
|
PEGASUS_ASSERT(a.size() == _nameSpacesData.size()); |
|
|
|
out << STRLIT("<VALUE.INSTANCEWITHPATH>\n"); | out << STRLIT("<VALUE.INSTANCEWITHPATH>\n"); |
out << STRLIT("<INSTANCEPATH>\n"); | out << STRLIT("<INSTANCEPATH>\n"); |
XmlWriter::appendNameSpacePathElement(out, | XmlWriter::appendNameSpacePathElement(out, |
|
|
// If pull, map to instances | // If pull, map to instances |
if (isPullResponse) | if (isPullResponse) |
{ | { |
|
|
CIMInstance x = (CIMInstance)_objects[i]; | CIMInstance x = (CIMInstance)_objects[i]; |
|
if (encodeInstanceOnly) |
|
{ |
|
XmlWriter::appendInstanceElement( |
|
out, |
|
x, |
|
_includeQualifiers, |
|
_includeClassOrigin, |
|
_propertyList); |
|
} |
|
else |
|
{ |
XmlWriter::appendValueInstanceWithPathElement( | XmlWriter::appendValueInstanceWithPathElement( |
out, | out, |
x, | x, |
|
|
_includeClassOrigin, | _includeClassOrigin, |
_propertyList); | _propertyList); |
} | } |
|
} |
else | else |
{ | { |
XmlWriter::appendValueObjectWithPathElement( | XmlWriter::appendValueObjectWithPathElement( |
|
|
// OpenQueryInstances and pullInstances | // OpenQueryInstances and pullInstances |
if (encodeInstanceOnly) | if (encodeInstanceOnly) |
{ | { |
|
// KS_TODO move this to SCMOXmlWriter |
for (Uint32 i = 0, n = _scmoInstances.size();i < n; i++) | for (Uint32 i = 0, n = _scmoInstances.size();i < n; i++) |
{ | { |
_appendInstanceElement(out, _scmoInstances[i]); | _appendInstanceElement(out, _scmoInstances[i]); |
|
|
{ | { |
if (isPullResponse) | if (isPullResponse) |
{ | { |
|
// if encodeInstanceOnly flag, encode objects as instances |
|
// Used by OpenQueryInstances and pullInstances. |
|
if (encodeInstanceOnly) |
|
{ |
|
for (Uint32 i = 0, n = _scmoInstances.size();i < n; i++) |
|
{ |
|
_appendInstanceElement(out, _scmoInstances[i]); |
|
} |
|
} |
|
else |
|
{ |
SCMOXmlWriter::appendValueSCMOInstanceWithPathElements( | SCMOXmlWriter::appendValueSCMOInstanceWithPathElements( |
out,_scmoInstances, _propertyList); | out,_scmoInstances, _propertyList); |
} | } |
|
} |
else | else |
{ | { |
// KS_TODO why is this one named element rather than | // KS_TODO why is this one named element rather than |
|
|
_size = 0; | _size = 0; |
} | } |
| |
//// KS_TODO Remove. Diagnostic Displays below before commit to head |
// The following are debugging support only |
void CIMResponseData::traceResponseData() |
//// #ifdef PEGASUS_DEBUG |
|
void CIMResponseData::traceResponseData() const |
{ | { |
PEG_TRACE((TRC_XML, Tracer::LEVEL3, | PEG_TRACE((TRC_XML, Tracer::LEVEL3, |
"%s", (const char*)toStringTraceResponseData().getCString() )); | "%s", (const char*)toStringTraceResponseData().getCString() )); |
} | } |
String CIMResponseData::toStringTraceResponseData() |
|
|
String CIMResponseData::toStringTraceResponseData() const |
{ | { |
int rtnSize; | int rtnSize; |
char *p; | char *p; |
|
|
free(p); | free(p); |
return(rtnStr); | return(rtnStr); |
} | } |
|
//// #endif |
| |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |