(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.6

version 1.12.2.4, 2012/02/15 17:47:06 version 1.12.2.6, 2013/06/11 23:17:43
Line 103 
Line 103 
     OP_PullInstancePaths,     OP_PullInstancePaths,
     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"))
Line 335 
Line 338 
     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 552 
     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 3120 
     // [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 3158 
         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 3283 
Line 3289 
     // [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 3322 
  
     // 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 3450 
Line 3456 
     // [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 3510 
         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 3633 
Line 3639 
     // [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 3685 
         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 3820 
Line 3826 
     // [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 3894 
         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 4027 
Line 4033 
     // [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 4090 
         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 4205 
Line 4211 
     // [EnumerationContext]     // [EnumerationContext]
     buf.putString(msg->enumerationContext);     buf.putString(msg->enumerationContext);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
 } }
  
 static CIMPullInstancesWithPathRequestMessage* static CIMPullInstancesWithPathRequestMessage*
Line 4234 
Line 4240 
     }     }
  
     // [MACTCOUNT]     // [MACTCOUNT]
     Uint32Arg maxObjectCount;      Uint32 maxObjectCount;
     if (!in.getUint32Arg(maxObjectCount))      if (!in.getUint32(maxObjectCount))
        return 0;        return 0;
  
     AutoPtr<CIMPullInstancesWithPathRequestMessage> request(     AutoPtr<CIMPullInstancesWithPathRequestMessage> request(
Line 4338 
Line 4344 
     // [EnumerationContext]     // [EnumerationContext]
     buf.putString(msg->enumerationContext);     buf.putString(msg->enumerationContext);
  
     buf.putUint32Arg(msg->maxObjectCount);      buf.putUint32(msg->maxObjectCount);
 } }
  
 static CIMPullInstancePathsRequestMessage* static CIMPullInstancePathsRequestMessage*
Line 4367 
Line 4373 
     }     }
  
     // [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 4638 
Line 4644 
     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->filterQuery);
       buf.putString(msg->filterQueryLanguage);
   
       // [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(),
               endOfSequence,
               enumerationContext,
               QueueIdStack());
   
       // 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 4983 
Line 5148 
         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 5179 
     const Buffer& body,     const Buffer& body,
     Uint64 serverResponseTime,     Uint64 serverResponseTime,
     Boolean isFirst,     Boolean isFirst,
     Boolean isLast)      Boolean)
 { {
     Buffer out;     Buffer out;
  
Line 5297 
Line 5465 
                 (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 5806 
  
         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.6

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2