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

Diff for /pegasus/src/Pegasus/Common/BinaryCodec.cpp between version 1.12.2.4 and 1.12.2.15

version 1.12.2.4, 2012/02/15 17:47:06 version 1.12.2.15, 2014/08/14 18:42:37
Line 62 
Line 62 
 static const Uint32 _MAGIC = 0xF00DFACE; static const Uint32 _MAGIC = 0xF00DFACE;
 static const Uint32 _REVERSE_MAGIC = 0xCEFA0DF0; static const Uint32 _REVERSE_MAGIC = 0xCEFA0DF0;
 static const Uint32 _VERSION = 1; static const Uint32 _VERSION = 1;
 static const size_t _DEFAULT_CIM_BUFFER_SIZE = 16*1024;  
  
 enum Operation enum Operation
 { {
Line 101 
Line 100 
     OP_OpenAssociatorInstancePaths,     OP_OpenAssociatorInstancePaths,
     OP_PullInstancesWithPath,     OP_PullInstancesWithPath,
     OP_PullInstancePaths,     OP_PullInstancePaths,
       OP_PullInstances,
     OP_CloseEnumeration,     OP_CloseEnumeration,
     OP_EnumerationCount,     OP_EnumerationCount,
       OP_OpenQueryInstances,
 // EXP_PULL_END // EXP_PULL_END
     OP_Count     OP_Count
 }; };
Line 187 
Line 188 
                 return OP_OpenAssociatorInstances;                 return OP_OpenAssociatorInstances;
             if (_EQUAL(s, "OpenAssociatorInstancePaths"))             if (_EQUAL(s, "OpenAssociatorInstancePaths"))
                 return OP_OpenAssociatorInstancePaths;                 return OP_OpenAssociatorInstancePaths;
               if (_EQUAL(s, "OpenQueryInstances"))
                   return OP_OpenQueryInstances;;
             break;             break;
         case 'P':         case 'P':
             if (_EQUAL(s, "PullInstancesWithPath"))             if (_EQUAL(s, "PullInstancesWithPath"))
                 return OP_PullInstancesWithPath;                 return OP_PullInstancesWithPath;
             if (_EQUAL(s, "PullInstancePaths"))             if (_EQUAL(s, "PullInstancePaths"))
                 return OP_PullInstancePaths;                 return OP_PullInstancePaths;
               if (_EQUAL(s, "PullInstances"))
                   return OP_PullInstances;
             break;             break;
 // EXP_PULL_END // EXP_PULL_END
         case 'R':         case 'R':
Line 335 
Line 340 
     STAT_GETSTARTTIME     STAT_GETSTARTTIME
  
     Boolean deepInheritance = flags & DEEP_INHERITANCE;     Boolean deepInheritance = flags & DEEP_INHERITANCE;
   #ifndef PEGASUS_DISABLE_INSTANCE_QUALIFIERS
     Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;     Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
   #endif
     Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;     Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
  
     // [NAMESPACE]     // [NAMESPACE]
Line 547 
Line 554 
     STAT_GETSTARTTIME     STAT_GETSTARTTIME
  
     // [FLAGS]     // [FLAGS]
   #ifndef PEGASUS_DISABLE_INSTANCE_QUALIFIERS
     Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;     Boolean includeQualifiers = flags & INCLUDE_QUALIFIERS;
   #endif
     Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;     Boolean includeClassOrigin = flags & INCLUDE_CLASS_ORIGIN;
  
     // [NAMESPACE]     // [NAMESPACE]
Line 3114 
Line 3122 
     // [PROPERTY-LIST]     // [PROPERTY-LIST]
     buf.putPropertyList(msg->propertyList);     buf.putPropertyList(msg->propertyList);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
     buf.putUint32Arg(msg->operationTimeout);     buf.putUint32Arg(msg->operationTimeout);
     buf.putString(msg->filterQueryLanguage);     buf.putString(msg->filterQueryLanguage);
     buf.putString(msg->filterQuery);     buf.putString(msg->filterQuery);
Line 3152 
Line 3160 
         return 0;         return 0;
  
     // These can all be one common function.     // These can all be one common function.
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
     Uint32Arg operationTimeout;     Uint32Arg operationTimeout;
     if (!in.getUint32Arg(operationTimeout))     if (!in.getUint32Arg(operationTimeout))
Line 3224 
Line 3232 
  
     Boolean endOfSequence;     Boolean endOfSequence;
     if (!in.getBoolean(endOfSequence))     if (!in.getBoolean(endOfSequence))
       {
         return 0;         return 0;
       }
  
     String enumerationContext;     String enumerationContext;
     if (!in.getString(enumerationContext))     if (!in.getString(enumerationContext))
       {
         return 0;         return 0;
       }
  
     CIMOpenEnumerateInstancesResponseMessage* msg =     CIMOpenEnumerateInstancesResponseMessage* msg =
         new CIMOpenEnumerateInstancesResponseMessage(         new CIMOpenEnumerateInstancesResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext);
             QueueIdStack());  
  
     // Instead of resolving the binary data here, we delegate this     // Instead of resolving the binary data here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 3283 
Line 3295 
     // [CLASSNAME]     // [CLASSNAME]
     buf.putName(msg->className);     buf.putName(msg->className);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
     buf.putUint32Arg(msg->operationTimeout);     buf.putUint32Arg(msg->operationTimeout);
     buf.putString(msg->filterQueryLanguage);     buf.putString(msg->filterQueryLanguage);
     buf.putString(msg->filterQuery);     buf.putString(msg->filterQuery);
Line 3316 
Line 3328 
  
     // These can all be one common function.     // These can all be one common function.
  
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
     Uint32Arg operationTimeout;     Uint32Arg operationTimeout;
     if (!in.getUint32Arg(operationTimeout))     if (!in.getUint32Arg(operationTimeout))
Line 3379 
Line 3391 
  
     Boolean endOfSequence;     Boolean endOfSequence;
     if (!in.getBoolean(endOfSequence))     if (!in.getBoolean(endOfSequence))
       {
         return 0;         return 0;
       }
  
     String enumerationContext;     String enumerationContext;
     if (!in.getString(enumerationContext))     if (!in.getString(enumerationContext))
     {     {
         return 0;         return 0;
     }     }
   
     CIMOpenEnumerateInstancePathsResponseMessage* msg =     CIMOpenEnumerateInstancePathsResponseMessage* msg =
         new CIMOpenEnumerateInstancePathsResponseMessage(         new CIMOpenEnumerateInstancePathsResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext);
             QueueIdStack());  
  
     // Instead of resolving the binary data here, we delegate this     // Instead of resolving the binary data here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 3450 
Line 3465 
     // [PROPERTY-LIST]     // [PROPERTY-LIST]
     buf.putPropertyList(msg->propertyList);     buf.putPropertyList(msg->propertyList);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
     buf.putUint32Arg(msg->operationTimeout);     buf.putUint32Arg(msg->operationTimeout);
     buf.putString(msg->filterQueryLanguage);     buf.putString(msg->filterQueryLanguage);
     buf.putString(msg->filterQuery);     buf.putString(msg->filterQuery);
Line 3504 
Line 3519 
         return 0;         return 0;
  
     // These can all be one common function.     // These can all be one common function.
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
     Uint32Arg operationTimeout;     Uint32Arg operationTimeout;
     if (!in.getUint32Arg(operationTimeout))     if (!in.getUint32Arg(operationTimeout))
Line 3580 
Line 3595 
         new CIMOpenReferenceInstancesResponseMessage(         new CIMOpenReferenceInstancesResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext);
             QueueIdStack());  
  
     // Instead of resolving the binary data here, we delegate this     // Instead of resolving the binary data here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 3633 
Line 3648 
     // [ROLE]     // [ROLE]
     buf.putString(msg->role);     buf.putString(msg->role);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
     buf.putUint32Arg(msg->operationTimeout);     buf.putUint32Arg(msg->operationTimeout);
     buf.putString(msg->filterQueryLanguage);     buf.putString(msg->filterQueryLanguage);
     buf.putString(msg->filterQuery);     buf.putString(msg->filterQuery);
Line 3679 
Line 3694 
         return 0;         return 0;
  
     // These can all be one common function.     // These can all be one common function.
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
     Uint32Arg operationTimeout;     Uint32Arg operationTimeout;
     if (!in.getUint32Arg(operationTimeout))     if (!in.getUint32Arg(operationTimeout))
Line 3753 
Line 3768 
         new CIMOpenReferenceInstancePathsResponseMessage(         new CIMOpenReferenceInstancePathsResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext);
             QueueIdStack());  
  
     // Instead of resolving the binary data right here, we delegate this     // Instead of resolving the binary data right here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 3820 
Line 3835 
     // [PROPERTY-LIST]     // [PROPERTY-LIST]
     buf.putPropertyList(msg->propertyList);     buf.putPropertyList(msg->propertyList);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
     buf.putUint32Arg(msg->operationTimeout);     buf.putUint32Arg(msg->operationTimeout);
     buf.putString(msg->filterQueryLanguage);     buf.putString(msg->filterQueryLanguage);
     buf.putString(msg->filterQuery);     buf.putString(msg->filterQuery);
Line 3888 
Line 3903 
         return 0;         return 0;
  
     // These can all be one common function.     // These can all be one common function.
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
     Uint32Arg operationTimeout;     Uint32Arg operationTimeout;
     if (!in.getUint32Arg(operationTimeout))     if (!in.getUint32Arg(operationTimeout))
Line 3966 
Line 3981 
         new CIMOpenAssociatorInstancesResponseMessage(         new CIMOpenAssociatorInstancesResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext );
             QueueIdStack());  
  
     // Instead of resolving the binary data right here, we delegate this     // Instead of resolving the binary data right here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 4027 
Line 4042 
     // [RESULT-ROLE]     // [RESULT-ROLE]
     buf.putString(msg->resultRole);     buf.putString(msg->resultRole);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
     buf.putUint32Arg(msg->operationTimeout);     buf.putUint32Arg(msg->operationTimeout);
     buf.putString(msg->filterQueryLanguage);     buf.putString(msg->filterQueryLanguage);
     buf.putString(msg->filterQuery);     buf.putString(msg->filterQuery);
Line 4084 
Line 4099 
         return 0;         return 0;
  
     // These can all be one common function.     // These can all be one common function.
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
   
     Uint32Arg operationTimeout;     Uint32Arg operationTimeout;
     if (!in.getUint32Arg(operationTimeout))     if (!in.getUint32Arg(operationTimeout))
         return 0;         return 0;
   
     String filterQueryLanguage;     String filterQueryLanguage;
     if (!in.getString(filterQueryLanguage))     if (!in.getString(filterQueryLanguage))
         return 0;         return 0;
   
     String filterQuery;     String filterQuery;
     if (!in.getString(filterQuery))     if (!in.getString(filterQuery))
         return 0;         return 0;
Line 4149 
Line 4167 
  
     Boolean endOfSequence;     Boolean endOfSequence;
     if (!in.getBoolean(endOfSequence))     if (!in.getBoolean(endOfSequence))
       {
         return 0;         return 0;
       }
  
     String enumerationContext;     String enumerationContext;
     if (!in.getString(enumerationContext))     if (!in.getString(enumerationContext))
       {
         return 0;         return 0;
       }
  
     CIMOpenAssociatorInstancePathsResponseMessage* msg =     CIMOpenAssociatorInstancePathsResponseMessage* msg =
         new CIMOpenAssociatorInstancePathsResponseMessage(         new CIMOpenAssociatorInstancePathsResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext);
             QueueIdStack());  
  
     // Instead of resolving the binary data right here, we delegate this     // Instead of resolving the binary data right here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 4205 
Line 4227 
     // [EnumerationContext]     // [EnumerationContext]
     buf.putString(msg->enumerationContext);     buf.putString(msg->enumerationContext);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
 } }
  
 static CIMPullInstancesWithPathRequestMessage* static CIMPullInstancesWithPathRequestMessage*
Line 4224 
Line 4246 
  
     CIMNamespaceName nameSpace;     CIMNamespaceName nameSpace;
     if (!in.getNamespaceName(nameSpace))     if (!in.getNamespaceName(nameSpace))
       {
         return 0;         return 0;
       }
  
     // [EnumerationContext]     // [EnumerationContext]
     String enumerationContext;     String enumerationContext;
Line 4233 
Line 4257 
         return 0;         return 0;
     }     }
  
     // [MACTCOUNT]      // [MAXCOUNT]
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
       {
        return 0;        return 0;
       }
  
     AutoPtr<CIMPullInstancesWithPathRequestMessage> request(     AutoPtr<CIMPullInstancesWithPathRequestMessage> request(
         new CIMPullInstancesWithPathRequestMessage(         new CIMPullInstancesWithPathRequestMessage(
Line 4283 
Line 4309 
  
     Boolean endOfSequence;     Boolean endOfSequence;
     if (!in.getBoolean(endOfSequence))     if (!in.getBoolean(endOfSequence))
       {
         return 0;         return 0;
       }
  
     String enumerationContext;     String enumerationContext;
     if (!in.getString(enumerationContext))     if (!in.getString(enumerationContext))
       {
         return 0;         return 0;
       }
  
     CIMPullInstancesWithPathResponseMessage* msg =     CIMPullInstancesWithPathResponseMessage* msg =
         new CIMPullInstancesWithPathResponseMessage(         new CIMPullInstancesWithPathResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
             enumerationContext,              enumerationContext);
             QueueIdStack());  
  
     // Instead of resolving the binary data right here, we delegate this     // Instead of resolving the binary data right here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 4338 
Line 4368 
     // [EnumerationContext]     // [EnumerationContext]
     buf.putString(msg->enumerationContext);     buf.putString(msg->enumerationContext);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
 } }
  
 static CIMPullInstancePathsRequestMessage* static CIMPullInstancePathsRequestMessage*
Line 4357 
Line 4387 
  
     CIMNamespaceName nameSpace;     CIMNamespaceName nameSpace;
     if (!in.getNamespaceName(nameSpace))     if (!in.getNamespaceName(nameSpace))
       {
         return 0;         return 0;
       }
  
     // [EnumerationContext]     // [EnumerationContext]
     String enumerationContext;     String enumerationContext;
Line 4367 
Line 4399 
     }     }
  
     // [MAXOBJECTCOUNT]     // [MAXOBJECTCOUNT]
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
  
     AutoPtr<CIMPullInstancePathsRequestMessage> request(     AutoPtr<CIMPullInstancePathsRequestMessage> request(
Line 4417 
Line 4449 
  
     Boolean endOfSequence;     Boolean endOfSequence;
     if (!in.getBoolean(endOfSequence))     if (!in.getBoolean(endOfSequence))
       {
         return 0;         return 0;
       }
  
     String enumerationContext;     String enumerationContext;
     if (!in.getString(enumerationContext))     if (!in.getString(enumerationContext))
       {
         return 0;         return 0;
       }
  
     CIMPullInstancePathsResponseMessage* msg =     CIMPullInstancePathsResponseMessage* msg =
         new CIMPullInstancePathsResponseMessage(         new CIMPullInstancePathsResponseMessage(
             messageId,             messageId,
             cimException,             cimException,
               QueueIdStack(),
             endOfSequence,             endOfSequence,
               enumerationContext);
   
       // Instead of resolving the binary data right here, we delegate this
       // to a later point in time when the data is actually retrieved through
       // a call to getNamedInstances, which is going to resolve the binary
       // data when the callback function is registered.
       // This allows an alternate client implementation to gain direct access
       // to the binary data and pass this for example to the JNI implementation
       // of the JSR48 CIM Client for Java.
       CIMResponseData& responseData = msg->getResponseData();
       responseData.setRemainingBinaryData(in);
   
       msg->binaryRequest=true;
       return msg;
   }
   
   
   //==============================================================================
   //
   // PullInstances
   //
   //==============================================================================
   
   static void _encodePullInstancesRequest(
       CIMBuffer& buf,
       CIMPullInstancesRequestMessage* msg,
       CIMName& name)
   {
       /* See ../Client/CIMOperationRequestEncoder.cpp */
   
       static const CIMName NAME("PullInstances");
       name = NAME;
   
       // [HEADER]
   
       Uint32 flags = 0;
   
       _putHeader(buf, flags, msg->messageId, OP_PullInstances);
   
       // [NAMESPACE]
       buf.putNamespaceName(msg->nameSpace);
   
       // [EnumerationContext]
       buf.putString(msg->enumerationContext);
   
       buf.putUint32(msg->maxObjectCount);
   }
   
   static CIMPullInstancesRequestMessage*
       _decodePullInstancesRequest(
       CIMBuffer& in,
       Uint32 queueId,
       Uint32 returnQueueId,
       Uint32 flags,
       const String& messageId)
   {
       /* See ../Server/CIMOperationRequestDecoder.cpp */
   
       STAT_GETSTARTTIME
   
       // [NAMESPACE]
   
       CIMNamespaceName nameSpace;
       if (!in.getNamespaceName(nameSpace))
       {
           return 0;
       }
   
       // [EnumerationContext]
       String enumerationContext;
       if (!in.getString(enumerationContext))
       {
           return 0;
       }
   
       // [MAXCOUNT]
       Uint32 maxObjectCount;
       if (!in.getUint32(maxObjectCount))
       {
          return 0;
       }
   
       AutoPtr<CIMPullInstancesRequestMessage> request(
           new CIMPullInstancesRequestMessage(
               messageId,
               nameSpace,
             enumerationContext,             enumerationContext,
             QueueIdStack());              maxObjectCount,
               QueueIdStack(queueId, returnQueueId)));
   
       request->binaryRequest = true;
   
       STAT_SERVERSTART
   
       return request.release();
   }
   
   // For the pull Response messages the interface is the message and the,
   // not just the responseData.
   static void _encodePullInstancesResponseBody(
       CIMBuffer& out,
       CIMPullInstancesResponseMessage* msg,
       CIMResponseData& data,
       CIMName& name)
   {
       /* See ../Server/CIMOperationResponseEncoder.cpp */
   
       static const CIMName NAME("PullInstances");
       name = NAME;
       // [endOfSequence]
       out.putBoolean(msg->endOfSequence);
   
       // [enumerationContext]
       out.putString(msg->enumerationContext);
   
       data.encodeBinaryResponse(out);
   }
   
   static CIMPullInstancesResponseMessage*
       _decodePullInstancesResponse(
       CIMBuffer& in,
       const String& messageId)
   {
       CIMException cimException;
   
       Boolean endOfSequence;
       if (!in.getBoolean(endOfSequence))
       {
           return 0;
       }
   
       String enumerationContext;
       if (!in.getString(enumerationContext))
       {
           return 0;
       }
   
       CIMPullInstancesResponseMessage* msg =
           new CIMPullInstancesResponseMessage(
               messageId,
               cimException,
               QueueIdStack(),
               endOfSequence,
               enumerationContext);
  
     // Instead of resolving the binary data right here, we delegate this     // Instead of resolving the binary data right here, we delegate this
     // to a later point in time when the data is actually retrieved through     // to a later point in time when the data is actually retrieved through
Line 4638 
Line 4817 
     msg->binaryRequest=true;     msg->binaryRequest=true;
     return msg;     return msg;
 } }
   //==============================================================================
   //
   // OpenQueryInstances
   //
   //==============================================================================
   
   static void _encodeOpenQueryInstancesRequest(
       CIMBuffer& buf,
       CIMOpenQueryInstancesRequestMessage* msg,
       CIMName& name)
   {
       /* See ../Client/CIMOperationRequestEncoder.cpp */
   
       static const CIMName NAME("OpenQueryInstances");
   
       // [HEADER]
   
       Uint32 flags = 0;
   
       if (msg->continueOnError)
           flags |= CONTINUE_ON_ERROR;
   
       _putHeader(buf, flags, msg->messageId, OP_OpenQueryInstances);
   
       // [NAMESPACE]
       buf.putNamespaceName(msg->nameSpace);
   
       // [filterQuery and filterQueryLanguage]
       buf.putString(msg->query);
       buf.putString(msg->queryLanguage);
   
       // [returnQueryResultClass]
       buf.putBoolean(msg->returnQueryResultClass);
   
       buf.putUint32(msg->maxObjectCount);
       buf.putUint32Arg(msg->operationTimeout);
   }
   
   static CIMOpenQueryInstancesRequestMessage*
       _decodeOpenQueryInstancesRequest(
       CIMBuffer& in,
       Uint32 queueId,
       Uint32 returnQueueId,
       Uint32 flags,
       const String& messageId)
   {
       /* See ../Server/CIMOperationRequestDecoder.cpp */
   
       STAT_GETSTARTTIME
   
       Boolean continueOnError = flags & CONTINUE_ON_ERROR;
   
       // [NAMESPACE]
       CIMNamespaceName nameSpace;
       if (!in.getNamespaceName(nameSpace))
           return 0;
   
       // [FILTERQUERY and FILTERQUERYSTRING]
       String filterQuery;
       if (!in.getString(filterQuery))
           return 0;
       String filterQueryLanguage;
       if (!in.getString(filterQueryLanguage))
           return 0;
   
       // [RETURNQUERYRESULTCLASS]
       Boolean returnQueryResultClass;
       if (!in.getBoolean(returnQueryResultClass))
           return 0;
   
       // These can all be one common function.
       Uint32 maxObjectCount;
       if (!in.getUint32(maxObjectCount))
          return 0;
       Uint32Arg operationTimeout;
       if (!in.getUint32Arg(operationTimeout))
           return 0;
   
       AutoPtr<CIMOpenQueryInstancesRequestMessage> request(
           new CIMOpenQueryInstancesRequestMessage(
               messageId,
               nameSpace,
               filterQuery,
               filterQueryLanguage,
               returnQueryResultClass,
               operationTimeout,
               continueOnError,
               maxObjectCount,
               QueueIdStack(queueId, returnQueueId)));
   
       request->binaryRequest = true;
   
       STAT_SERVERSTART
   
       return request.release();
   }
   
   static void _encodeOpenQueryInstancesResponseBody(
       CIMBuffer& out,
       CIMOpenQueryInstancesResponseMessage* msg,
       CIMResponseData& data,
       CIMName& name)
   {
       /* See ../Server/CIMOperationResponseEncoder.cpp */
   
       out.putClass(msg->queryResultClass);
   
       // [endOfSequence]
       out.putBoolean(msg->endOfSequence);
   
       // [enumerationContext]
       out.putString(msg->enumerationContext);
   
       data.encodeBinaryResponse(out);
   }
   
   static CIMOpenQueryInstancesResponseMessage*
       _decodeOpenQueryInstancesResponse(
       CIMBuffer& in,
       const String& messageId)
   {
       CIMException cimException;
   
       // KS_TODO Should we set validation???
       // Turn on validation: This is a debugging tool
   //#if defined(ENABLE_VALIDATION)
   //    buf.setValidate(true);
   //#endif
   
       Boolean endOfSequence;
       if (!in.getBoolean(endOfSequence))
           return 0;
   
       String enumerationContext;
       if (!in.getString(enumerationContext))
           return 0;
   
       CIMOpenQueryInstancesResponseMessage* msg =
           new CIMOpenQueryInstancesResponseMessage(
               messageId,
               cimException,
               CIMClass(),
               QueueIdStack(),
               endOfSequence,
               enumerationContext);
   
       // Instead of resolving the binary data here, delegate this
       // to a later point in time when the data is actually retrieved through
       // a call to CIMResponseData::getInstances, which
       // resolves the binary data as it is passed to the next interface.
       // This allows an alternate client implementation to gain direct access
       // to the binary data and pass this for example to the JNI implementation
       // of the JSR48 CIM Client for Java.
       CIMResponseData& responseData = msg->getResponseData();
       responseData.setRemainingBinaryData(in);
   
       msg->binaryRequest=true;
       return msg;
   }
  
 // EXP_PULL_END // EXP_PULL_END
  
Line 4801 
Line 5139 
         case OP_OpenEnumerateInstances:         case OP_OpenEnumerateInstances:
             return _decodeOpenEnumerateInstancesRequest(             return _decodeOpenEnumerateInstancesRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_OpenEnumerateInstancePaths:         case OP_OpenEnumerateInstancePaths:
             return _decodeOpenEnumerateInstancePathsRequest(             return _decodeOpenEnumerateInstancePathsRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_OpenReferenceInstances:         case OP_OpenReferenceInstances:
             return _decodeOpenReferenceInstancesRequest(             return _decodeOpenReferenceInstancesRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_OpenReferenceInstancePaths:         case OP_OpenReferenceInstancePaths:
             return _decodeOpenReferenceInstancePathsRequest(             return _decodeOpenReferenceInstancePathsRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_OpenAssociatorInstances:         case OP_OpenAssociatorInstances:
             return _decodeOpenAssociatorInstancesRequest(             return _decodeOpenAssociatorInstancesRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_OpenAssociatorInstancePaths:         case OP_OpenAssociatorInstancePaths:
             return _decodeOpenAssociatorInstancePathsRequest(             return _decodeOpenAssociatorInstancePathsRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_PullInstancesWithPath:         case OP_PullInstancesWithPath:
             return _decodePullInstancesWithPathRequest(             return _decodePullInstancesWithPathRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_PullInstancePaths:         case OP_PullInstancePaths:
             return _decodePullInstancePathsRequest(             return _decodePullInstancePathsRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_CloseEnumeration:         case OP_CloseEnumeration:
             return _decodeCloseEnumerationRequest(             return _decodeCloseEnumerationRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
         case OP_EnumerationCount:         case OP_EnumerationCount:
             return _decodeEnumerationCountRequest(             return _decodeEnumerationCountRequest(
                 in, queueId, returnQueueId, flags, messageId);                 in, queueId, returnQueueId, flags, messageId);
             break;  
 //EXP_PULL_END //EXP_PULL_END
         default:         default:
             // Unexpected message type              PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
             PEGASUS_ASSERT(0);  
             return 0;             return 0;
     }     }
 } }
Line 4852 
Line 5179 
 // //
 //============================================================================== //==============================================================================
  
 CIMResponseMessage* BinaryCodec::decodeResponse(  
     const Buffer& in)  
 {  
     CIMBuffer buf((char*)in.getData(), in.size());  
     CIMBufferReleaser buf_(buf);  
   
     return decodeResponse(buf);  
 }  
  
 CIMResponseMessage* BinaryCodec::decodeResponse( CIMResponseMessage* BinaryCodec::decodeResponse(
     CIMBuffer& buf)     CIMBuffer& buf)
Line 4983 
Line 5302 
         case OP_CloseEnumeration:         case OP_CloseEnumeration:
             msg = _decodeCloseEnumerationResponse(buf, messageId);             msg = _decodeCloseEnumerationResponse(buf, messageId);
             break;             break;
           case OP_OpenQueryInstances:
               msg = _decodeCloseEnumerationResponse(buf, messageId);
               break;
 //EXP_PULL_END //EXP_PULL_END
         default:         default:
             // Unexpected message type             // Unexpected message type
             PEGASUS_ASSERT(0);              PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
             break;             break;
     }     }
  
Line 5011 
Line 5333 
     const Buffer& body,     const Buffer& body,
     Uint64 serverResponseTime,     Uint64 serverResponseTime,
     Boolean isFirst,     Boolean isFirst,
     Boolean isLast)      Boolean)
 { {
     Buffer out;     Buffer out;
  
Line 5035 
Line 5357 
     {     {
         out.append(body.getData(), body.size());         out.append(body.getData(), body.size());
     }     }
     // EXP_PULL TODO - TBD Review this.      // EXP_PULL_BEGIN
     // If there are any parameters include them here.      // If there are any output parameters include them here.
     // Assumes that it is prebuilt with all components     // Assumes that it is prebuilt with all components
     //     //
     if (rtnParams.size() != 0)     if (rtnParams.size() != 0)
Line 5044 
Line 5366 
         out << rtnParams;         out << rtnParams;
     }     }
     //     //
     // //EXP_PULL_END      // EXP_PULL_END
  
     return out;     return out;
 } }
Line 5297 
Line 5619 
                 (CIMEnumerationCountRequestMessage*)msg, name);                 (CIMEnumerationCountRequestMessage*)msg, name);
             break;             break;
         }         }
           case CIM_OPEN_QUERY_INSTANCES_REQUEST_MESSAGE:
           {
               _encodeOpenQueryInstancesRequest(buf,
                   (CIMOpenQueryInstancesRequestMessage*)msg, name);
               break;
           }
 //EXP_PULL_END //EXP_PULL_END
  
         default:         default:
             // Unexpected message type             // Unexpected message type
             PEGASUS_ASSERT(0);              PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
             return false;             return false;
     }     }
  
Line 5632 
Line 5960 
  
         default:         default:
             // Unexpected message type             // Unexpected message type
             PEGASUS_ASSERT(0);              PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);)
             return false;             return false;
     }     }
  


Legend:
Removed from v.1.12.2.4  
changed lines
  Added in v.1.12.2.15

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2