void EnumerateInstanceNamesResponseHandler::deliver( const SCMOInstance& scmoObjectPath) { if (scmoObjectPath.getClassName()==NULL) { MessageLoaderParms message( "Common.Exception.UNINITIALIZED_OBJECT_EXCEPTION", "The object is not initialized."); throw CIMException(CIM_ERR_FAILED, message); } SimpleObjectPathResponseHandler::deliver(scmoObjectPath); }
PEGASUS_NAMESPACE_BEGIN void SCMOInternalXmlEncoder::_putXMLInstance( CIMBuffer& out, const SCMOInstance& ci, const CIMPropertyList& propertyList ) { if (ci.isUninitialized()) { out.putUint32(0); out.putUint32(0); out.putString(String()); out.putNamespaceName(CIMNamespaceName()); } else { Buffer buf(4096); // Serialize instance as XML. if (propertyList.isNull()) { Array<Uint32> emptyNodes; SCMOXmlWriter::appendInstanceElement( buf, ci, false, emptyNodes); } else { Array<propertyFilterNodesArray_t> propFilterNodesArrays; // This searches for an already created array of nodes, // if not found, creates it inside propFilterNodesArrays const Array<Uint32> & nodes= SCMOXmlWriter::getFilteredNodesArray( propFilterNodesArrays, ci, propertyList); SCMOXmlWriter::appendInstanceElement( buf, ci, true, nodes); } buf.append('\0'); out.putUint32(buf.size()); out.putBytes(buf.getData(), buf.size()); buf.clear(); if (0 == ci.getClassName()) { out.putUint32(0); out.putString(String()); out.putNamespaceName(CIMNamespaceName()); } else { // Serialize object path as XML. SCMOXmlWriter::appendValueReferenceElement(buf, ci); buf.append('\0'); out.putUint32(buf.size()); out.putBytes(buf.getData(), buf.size()); // Write hostname and namespace in UTF-16 format Uint32 len=0; const char* hn = ci.getHostName_l(len); out.putUTF8AsString(hn, len); const char * ns = ci.getNameSpace_l(len); out.putUTF8AsString(ns, len); } } }