(file) Return to CIMResponseData.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMResponseData.cpp between version 1.2.2.22 and 1.7

version 1.2.2.22, 2009/11/30 10:59:36 version 1.7, 2011/02/02 05:43:48
Line 103 
Line 103 
     return _binaryData;     return _binaryData;
 } }
  
 bool CIMResponseData::setBinary(CIMBuffer& in, bool hasLen)  bool CIMResponseData::setBinary(CIMBuffer& in)
 { {
     PEG_METHOD_ENTER(TRC_DISPATCHER,      PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setBinary");
         "CIMResponseData::setBinary");  
  
     if (hasLen)      // Append all serial data from the CIMBuffer to the local data store.
     {      // Returns error if input not a serialized Uint8A
         if (!in.getUint8A(_binaryData))         if (!in.getUint8A(_binaryData))
         {         {
             PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,             PEG_TRACE_CSTRING(TRC_DISCARDED_DATA, Tracer::LEVEL1,
                 "Failed to get binary object path data!");              "Failed to get binary input data!");
             PEG_METHOD_EXIT();             PEG_METHOD_EXIT();
             return false;             return false;
         }         }
       _encoding |= RESP_ENC_BINARY;
       PEG_METHOD_EXIT();
       return true;
     }     }
     else  
   bool CIMResponseData::setRemainingBinaryData(CIMBuffer& in)
     {     {
         size_t remainingDataLength = in.capacity() - in.size();      PEG_METHOD_ENTER(TRC_DISPATCHER, "CIMResponseData::setRemainingBinaryData");
   
       // Append any data that has not been deserialized already from
       // the CIMBuffer.
       size_t remainingDataLength = in.remainingDataLength();
         _binaryData.append((Uint8*)in.getPtr(), remainingDataLength);         _binaryData.append((Uint8*)in.getPtr(), remainingDataLength);
     }  
     _encoding |= RESP_ENC_BINARY;     _encoding |= RESP_ENC_BINARY;
     PEG_METHOD_EXIT();     PEG_METHOD_EXIT();
     return true;     return true;
Line 304 
Line 311 
 { {
     PEG_METHOD_ENTER(TRC_DISPATCHER,     PEG_METHOD_ENTER(TRC_DISPATCHER,
         "CIMResponseData::encodeBinaryResponse");         "CIMResponseData::encodeBinaryResponse");
   
     // Need to do a complete job here by transferring all contained data     // Need to do a complete job here by transferring all contained data
     // into binary format and handing it out in the CIMBuffer     // into binary format and handing it out in the CIMBuffer
     if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY))     if (RESP_ENC_BINARY == (_encoding & RESP_ENC_BINARY))
Line 370 
Line 376 
 void CIMResponseData::completeNamespace(const SCMOInstance * x) void CIMResponseData::completeNamespace(const SCMOInstance * x)
 { {
     const char * ns;     const char * ns;
     Uint64 len;      Uint32 len;
     ns = x->getNameSpace_l(len);     ns = x->getNameSpace_l(len);
     // Both internal XML as well as binary always contain a namespace     // Both internal XML as well as binary always contain a namespace
     // don't have to do anything for those two encodings     // don't have to do anything for those two encodings
Line 395 
Line 401 
                         p.setNameSpace(nsName);                         p.setNameSpace(nsName);
                     }                     }
                 }                 }
                   break;
             }             }
             case RESP_INSTANCES:             case RESP_INSTANCES:
             {             {
Line 563 
Line 570 
 void CIMResponseData::encodeXmlResponse(Buffer& out) void CIMResponseData::encodeXmlResponse(Buffer& out)
 { {
     PEG_TRACE((TRC_XML, Tracer::LEVEL3,     PEG_TRACE((TRC_XML, Tracer::LEVEL3,
         "CIMResponseData::encodeXmlResponse(encoding=%X,content=%X)\n",          "CIMResponseData::encodeXmlResponse(encoding=%X,content=%X)",
         _encoding,         _encoding,
         _dataType));         _dataType));
  
Line 574 
Line 581 
     {     {
         _resolveBinary();         _resolveBinary();
     }     }
   
     if (RESP_ENC_XML == (_encoding & RESP_ENC_XML))     if (RESP_ENC_XML == (_encoding & RESP_ENC_XML))
     {     {
         switch (_dataType)         switch (_dataType)
Line 637 
Line 643 
  
     if (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM))     if (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM))
     {     {
           _propertyList.fillCIMNameTags();
         switch (_dataType)         switch (_dataType)
         {         {
             case RESP_INSTNAMES:             case RESP_INSTNAMES:
Line 651 
Line 658 
             {             {
                 if (_instances.size() > 0)                 if (_instances.size() > 0)
                 {                 {
                     XmlWriter::appendInstanceElement(out, _instances[0]);                      XmlWriter::appendInstanceElement(
                           out,
                           _instances[0],
                           _includeQualifiers,
                           _includeClassOrigin,
                           _propertyList);
                 }                 }
                 break;                 break;
             }             }
Line 660 
Line 672 
                 for (Uint32 i = 0, n = _instances.size(); i < n; i++)                 for (Uint32 i = 0, n = _instances.size(); i < n; i++)
                 {                 {
                     XmlWriter::appendValueNamedInstanceElement(                     XmlWriter::appendValueNamedInstanceElement(
                         out, _instances[i]);                          out,
                           _instances[i],
                           _includeQualifiers,
                           _includeClassOrigin,
                           _propertyList);
                 }                 }
                 break;                 break;
             }             }
Line 670 
Line 686 
                 {                 {
                     XmlWriter::appendValueObjectWithPathElement(                     XmlWriter::appendValueObjectWithPathElement(
                         out,                         out,
                         _objects[i]);                          _objects[i],
                           _includeQualifiers,
                           _includeClassOrigin,
                           _propertyList);
                 }                 }
                 break;                 break;
             }             }
Line 704 
Line 723 
                     SCMOXmlWriter::appendInstanceNameElement(                     SCMOXmlWriter::appendInstanceNameElement(
                         out,                         out,
                         _scmoInstances[i]);                         _scmoInstances[i]);
   
                 }                 }
                 break;                 break;
             }             }
Line 711 
Line 731 
             {             {
                 if (_scmoInstances.size() > 0)                 if (_scmoInstances.size() > 0)
                 {                 {
                     SCMOXmlWriter::appendInstanceElement(out,_scmoInstances[0]);                      if(_propertyList.isNull())
                       {
                           Array<Uint32> emptyNodes;
                           SCMOXmlWriter::appendInstanceElement(
                               out,
                               _scmoInstances[0],
                               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,
                                   _scmoInstances[0],
                                   _propertyList);
                           SCMOXmlWriter::appendInstanceElement(
                               out,
                               _scmoInstances[0],
                               true,
                               nodes);
                       }
                 }                 }
                 break;                 break;
             }             }
             case RESP_INSTANCES:             case RESP_INSTANCES:
             {             {
                 for (Uint32 i = 0, n = _scmoInstances.size(); i < n; i++)                  SCMOXmlWriter::appendValueSCMOInstanceElements(
                 {  
                     SCMOXmlWriter::appendValueSCMOInstanceElement(  
                         out,                         out,
                         _scmoInstances[i]);                      _scmoInstances,
                 }                      _propertyList);
                 break;                 break;
             }             }
             case RESP_OBJECTS:             case RESP_OBJECTS:
             {             {
                 for (Uint32 i = 0; i < _scmoInstances.size(); i++)  
                 {  
                     SCMOXmlWriter::appendValueObjectWithPathElement(                     SCMOXmlWriter::appendValueObjectWithPathElement(
                         out,                         out,
                         _scmoInstances[i]);                     _scmoInstances,
                 }                    _propertyList);
                 break;                 break;
             }             }
             case RESP_OBJECTPATHS:             case RESP_OBJECTPATHS:
Line 761 
Line 801 
 void CIMResponseData::encodeInternalXmlResponse(CIMBuffer& out) void CIMResponseData::encodeInternalXmlResponse(CIMBuffer& out)
 { {
     PEG_TRACE((TRC_XML, Tracer::LEVEL3,     PEG_TRACE((TRC_XML, Tracer::LEVEL3,
         "CIMResponseData::encodeInternalXmlResponse(encoding=%X,content=%X)\n",          "CIMResponseData::encodeInternalXmlResponse(encoding=%X,content=%X)",
         _encoding,         _encoding,
         _dataType));         _dataType));
   
     // For mixed (CIM+SCMO) responses, we need to tell the receiver the     // For mixed (CIM+SCMO) responses, we need to tell the receiver the
     // total number of instances. The totalSize variable is used to keep track     // total number of instances. The totalSize variable is used to keep track
     // of this.     // of this.
Line 780 
Line 819 
     if ((0 == _encoding) ||     if ((0 == _encoding) ||
         (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM)))         (RESP_ENC_CIM == (_encoding & RESP_ENC_CIM)))
     {     {
           _propertyList.fillCIMNameTags();
         switch (_dataType)         switch (_dataType)
         {         {
             case RESP_INSTANCE:             case RESP_INSTANCE:
Line 787 
Line 827 
                 if (0 == _instances.size())                 if (0 == _instances.size())
                 {                 {
                     _instances.append(CIMInstance());                     _instances.append(CIMInstance());
                       CIMInternalXmlEncoder::_putXMLInstance(
                           out,
                           _instances[0]);
                       break;
                 }                 }
                 CIMInternalXmlEncoder::_putXMLInstance(out, _instances[0]);                  CIMInternalXmlEncoder::_putXMLInstance(
                       out,
                       _instances[0],
                       _includeQualifiers,
                       _includeClassOrigin,
                       _propertyList);
                 break;                 break;
             }             }
             case RESP_INSTANCES:             case RESP_INSTANCES:
Line 800 
Line 849 
                 {                 {
                     CIMInternalXmlEncoder::_putXMLNamedInstance(                     CIMInternalXmlEncoder::_putXMLNamedInstance(
                         out,                         out,
                         _instances[i]);                          _instances[i],
                           _includeQualifiers,
                           _includeClassOrigin,
                           _propertyList);
                 }                 }
                 break;                 break;
             }             }
Line 811 
Line 863 
                 out.putUint32(totalSize);                 out.putUint32(totalSize);
                 for (Uint32 i = 0; i < n; i++)                 for (Uint32 i = 0; i < n; i++)
                 {                 {
                     CIMInternalXmlEncoder::_putXMLObject(out, _objects[i]);                      CIMInternalXmlEncoder::_putXMLObject(
                           out,
                           _objects[i],
                           _includeQualifiers,
                           _includeClassOrigin,
                           _propertyList);
                 }                 }
                 break;                 break;
             }             }
Line 835 
Line 892 
                 {                 {
                     _scmoInstances.append(SCMOInstance());                     _scmoInstances.append(SCMOInstance());
                 }                 }
                 SCMOInternalXmlEncoder::_putXMLInstance(out, _scmoInstances[0]);                  SCMOInternalXmlEncoder::_putXMLInstance(
                       out,
                       _scmoInstances[0],
                       _propertyList);
                 break;                 break;
             }             }
             case RESP_INSTANCES:             case RESP_INSTANCES:
Line 846 
Line 906 
                 {                 {
                     out.putUint32(n);                     out.putUint32(n);
                 }                 }
                 for (Uint32 i = 0; i < n; i++)  
                 {  
                     SCMOInternalXmlEncoder::_putXMLNamedInstance(                     SCMOInternalXmlEncoder::_putXMLNamedInstance(
                             out,                             out,
                             _scmoInstances[i]);                      _scmoInstances,
                 }                      _propertyList);
                 break;                 break;
             }             }
             case RESP_OBJECTS:             case RESP_OBJECTS:
Line 862 
Line 920 
                 {                 {
                     out.putUint32(n);                     out.putUint32(n);
                 }                 }
                 for (Uint32 i = 0; i < n; i++)  
                 {  
                     SCMOInternalXmlEncoder::_putXMLObject(                     SCMOInternalXmlEncoder::_putXMLObject(
                         out,                         out,
                         _scmoInstances[i]);                      _scmoInstances,
                 }                      _propertyList);
                 break;                 break;
             }             }
             // internal xml encoding of instance names and object paths not             // internal xml encoding of instance names and object paths not
Line 880 
Line 936 
             }             }
         }         }
     }     }
   
 } }
  
 void CIMResponseData::_resolveToCIM() void CIMResponseData::_resolveToCIM()
 { {
     PEG_TRACE((TRC_XML, Tracer::LEVEL2,      PEG_TRACE((TRC_XML, Tracer::LEVEL3,
         "CIMResponseData::_resolveToCIM(encoding=%X,content=%X)\n",          "CIMResponseData::_resolveToCIM(encoding=%X,content=%X)",
         _encoding,         _encoding,
         _dataType));         _dataType));
  
Line 907 
Line 964 
  
 void CIMResponseData::_resolveToSCMO() void CIMResponseData::_resolveToSCMO()
 { {
     PEG_TRACE((TRC_XML, Tracer::LEVEL2,      PEG_TRACE((TRC_XML, Tracer::LEVEL3,
         "CIMResponseData::_resolveToSCMO(encoding=%X,content=%X)\n",          "CIMResponseData::_resolveToSCMO(encoding=%X,content=%X)",
         _encoding,         _encoding,
         _dataType));         _dataType));
  
Line 1361 
Line 1418 
     _encoding |=RESP_ENC_SCMO;     _encoding |=RESP_ENC_SCMO;
 } }
  
   void CIMResponseData::setRequestProperties(
       const Boolean includeQualifiers,
       const Boolean includeClassOrigin,
       const CIMPropertyList& propertyList)
   {
       _includeQualifiers = includeQualifiers;
       _includeClassOrigin = includeClassOrigin;
       _propertyList = propertyList;
   }
   void CIMResponseData::getRequestProperties(
       Boolean & includeQualifiers,
       Boolean & includeClassOrigin,
       CIMPropertyList& propertyList)
   {
       includeQualifiers = _includeQualifiers;
       includeClassOrigin = _includeClassOrigin;
       propertyList = _propertyList;
   }
   
 PEGASUS_NAMESPACE_END PEGASUS_NAMESPACE_END


Legend:
Removed from v.1.2.2.22  
changed lines
  Added in v.1.7

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2