version 1.127, 2010/06/06 17:04:18
|
version 1.127.2.3, 2012/02/15 17:47:18
|
|
|
// | // |
// M-POST /cimom HTTP/1.1 | // M-POST /cimom HTTP/1.1 |
// HOST: www.erewhon.com | // HOST: www.erewhon.com |
// Content-Type: application/xml; charset="utf-8" |
// Content-Type: application/xml; charset=utf-8 |
// Content-Length: xxxx | // Content-Length: xxxx |
// Man: http://www.dmtf.org/cim/operation ; ns=73 | // Man: http://www.dmtf.org/cim/operation ; ns=73 |
// 73-CIMOperation: MethodCall | // 73-CIMOperation: MethodCall |
|
|
} | } |
} | } |
| |
// Calculate the beginning of the content from the message size and |
|
// the content length. |
|
|
|
content = (char*) httpMessage->message.getData() + |
|
httpMessage->message.size() - contentLength; |
|
|
|
// Validate the "Content-Type" header: | // Validate the "Content-Type" header: |
| |
const char* cimContentType; | const char* cimContentType; |
|
|
(((!String::equalNoCase(type, "application/xml") && | (((!String::equalNoCase(type, "application/xml") && |
!String::equalNoCase(type, "text/xml")) || | !String::equalNoCase(type, "text/xml")) || |
!String::equalNoCase(charset, "utf-8")) | !String::equalNoCase(charset, "utf-8")) |
#if defined(PEGASUS_ENABLE_PROTOCOL_BINARY) |
|
&& !(binaryRequest = String::equalNoCase(type, | && !(binaryRequest = String::equalNoCase(type, |
"application/x-openpegasus")) | "application/x-openpegasus")) |
#endif |
|
)) | )) |
{ | { |
MessageLoaderParms parms( | MessageLoaderParms parms( |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
// Calculate the beginning of the content from the message size and |
|
// the content length. |
|
if (binaryRequest) |
|
{ |
|
// binary the "Content" also contains a few padding '\0' to align |
|
// data structures to 8byte boundary |
|
// the padding '\0' are also part of the counted contentLength |
|
Uint32 headerEnd = httpMessage->message.size() - contentLength; |
|
Uint32 binContentStart = CIMBuffer::round(headerEnd); |
|
|
|
contentLength = contentLength - (binContentStart - headerEnd); |
|
content = (char*) httpMessage->message.getData() + binContentStart; |
|
} |
|
else |
|
{ |
|
content = (char*) httpMessage->message.getData() + |
|
httpMessage->message.size() - contentLength; |
|
} |
|
|
// Validating content falls within UTF8 | // Validating content falls within UTF8 |
// (required to be complaint with section C12 of Unicode 4.0 spec, | // (required to be complaint with section C12 of Unicode 4.0 spec, |
// chapter 3.) | // chapter 3.) |
else if (!binaryRequest) |
if (!binaryRequest) |
{ | { |
Uint32 count = 0; | Uint32 count = 0; |
while(count<contentLength) | while(count<contentLength) |
|
|
{ | { |
binaryResponse = false; | binaryResponse = false; |
} | } |
|
httpMessage->binaryResponse=binaryResponse; |
| |
// If it is a method call, then dispatch it to be handled: | // If it is a method call, then dispatch it to be handled: |
| |
|
|
return; | return; |
} | } |
| |
|
// Trace as binary display if binary request |
|
if(binaryRequest) |
|
{ |
|
PEG_TRACE((TRC_XML,Tracer::LEVEL4, |
|
"CIMOperationRequestdecoder - Binary content: Not Shown.")); |
|
} |
|
else |
|
{ |
PEG_TRACE((TRC_XML,Tracer::LEVEL4, | PEG_TRACE((TRC_XML,Tracer::LEVEL4, |
"CIMOperationRequestdecoder - XML content: %s", | "CIMOperationRequestdecoder - XML content: %s", |
content)); | content)); |
|
} |
| |
// | // |
// Handle binary messages: | // Handle binary messages: |
|
|
| |
if (binaryRequest) | if (binaryRequest) |
{ | { |
Buffer buf(content, contentLength); |
CIMBuffer buf(content, contentLength); |
|
CIMBufferReleaser buf_(buf); |
| |
request.reset(BinaryCodec::decodeRequest(buf, queueId, _returnQueueId)); | request.reset(BinaryCodec::decodeRequest(buf, queueId, _returnQueueId)); |
| |
|
|
else if (System::strcasecmp(cimMethodName, "ExecQuery") == 0) | else if (System::strcasecmp(cimMethodName, "ExecQuery") == 0) |
request.reset(decodeExecQueryRequest( | request.reset(decodeExecQueryRequest( |
queueId, parser, messageId, nameSpace)); | queueId, parser, messageId, nameSpace)); |
|
// Pull Operations decoders |
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenEnumerateInstances") == 0) |
|
request.reset(decodeOpenEnumerateInstancesRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenEnumerateInstancePaths") == 0) |
|
request.reset(decodeOpenEnumerateInstancePathsRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenReferenceInstances") == 0) |
|
request.reset(decodeOpenReferenceInstancesRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenReferenceInstancePaths") == 0) |
|
request.reset(decodeOpenReferenceInstancePathsRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenAssociatorInstances") == 0) |
|
request.reset(decodeOpenAssociatorInstancesRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenAssociatorInstancePaths") == 0) |
|
request.reset(decodeOpenAssociatorInstancePathsRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "PullInstancesWithPath") == 0) |
|
request.reset(decodePullInstancesWithPathRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "PullInstancePaths") == 0) |
|
request.reset(decodePullInstancePathsRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "CloseEnumeration") == 0) |
|
request.reset(decodeCloseEnumerationRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "EnumerationCount") == 0) |
|
request.reset(decodeEnumerationCountRequest( |
|
queueId, parser, messageId, nameSpace)); |
|
// End Of Pull Operations |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, | throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
Boolean includeQualifiers = false; | Boolean includeQualifiers = false; |
Boolean includeClassOrigin = false; | Boolean includeClassOrigin = false; |
CIMPropertyList propertyList; | CIMPropertyList propertyList; |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; | Boolean gotClassName = false; |
Boolean gotDeepInheritance = false; | Boolean gotDeepInheritance = false; |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
{ | { |
Array<String> propertyListArray; | Array<String> propertyListArray; |
pl.get(propertyListArray); | pl.get(propertyListArray); |
Array<CIMName> cimNameArray; |
propertyList.append(propertyListArray); |
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} | } |
} | } |
duplicateParameter = gotPropertyList; | duplicateParameter = gotPropertyList; |
|
|
return request.release(); | return request.release(); |
} | } |
| |
|
// EXP_PULL_BEGIN |
|
CIMOpenEnumerateInstancesRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenEnumerateInstancesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMName className; |
|
Boolean deepInheritance = true; |
|
Boolean includeQualifiers = false; |
|
Boolean includeClassOrigin = false; |
|
CIMPropertyList propertyList; |
|
String filterQueryLanguage = String::EMPTY; |
|
String filterQuery = String::EMPTY; |
|
Uint32Arg operationTimeout; |
|
Boolean continueOnError = false; |
|
Uint32Arg maxObjectCount = 0; |
|
String enumerationContext = String::EMPTY; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotClassName = false; |
|
Boolean gotDeepInheritance = false; |
|
Boolean gotLocalOnly = false; |
|
Boolean gotQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean gotCIMEnumerationContext = false; |
|
Boolean gotFilterQueryLanguage = false; |
|
Boolean gotFilterQuery = false; |
|
Boolean gotOperationTimeout = false; |
|
Boolean gotContinueOnError = false; |
|
Boolean gotEnumerationContext = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "ClassName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getClassNameElement(parser, className, true); |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} |
|
else if (System::strcasecmp(name, "DeepInheritance") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, deepInheritance, true); |
|
duplicateParameter = gotDeepInheritance; |
|
gotDeepInheritance = true; |
|
} |
|
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQueryLanguage") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQueryLanguage, true); |
|
duplicateParameter = gotFilterQueryLanguage; |
|
gotFilterQueryLanguage = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQuery") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQuery, true); |
|
duplicateParameter = gotFilterQuery; |
|
gotFilterQuery = true; |
|
} |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
else if (System::strcasecmp(name, "OperationTimeout") == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, operationTimeout, true); |
|
duplicateParameter = gotOperationTimeout; |
|
gotOperationTimeout = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ContinueOnError") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, continueOnError, true); |
|
duplicateParameter = gotContinueOnError; |
|
gotContinueOnError = true; |
|
} |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else if (System::strcasecmp(name, "PropertyList") == 0) |
|
{ |
|
if (!emptyTag) |
|
{ |
|
CIMValue pl; |
|
if (XmlReader::getValueArrayElement(parser, CIMTYPE_STRING, pl)) |
|
{ |
|
Array<String> propertyListArray; |
|
pl.get(propertyListArray); |
|
Array<CIMName> cimNameArray; |
|
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} |
|
} |
|
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotClassName) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
|
|
AutoPtr<CIMOpenEnumerateInstancesRequestMessage> request( |
|
new CIMOpenEnumerateInstancesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
className, |
|
deepInheritance, |
|
includeClassOrigin, |
|
propertyList, |
|
filterQueryLanguage, |
|
filterQuery, |
|
operationTimeout, |
|
continueOnError, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
|
|
CIMOpenEnumerateInstancePathsRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenEnumerateInstancePathsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMName className; |
|
String filterQueryLanguage = String::EMPTY; |
|
String filterQuery = String::EMPTY; |
|
Uint32Arg operationTimeout = 0; |
|
Boolean continueOnError = false; |
|
Uint32Arg maxObjectCount = 0; |
|
String enumerationContext = String::EMPTY; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotClassName = false; |
|
Boolean gotDeepInheritance = false; |
|
Boolean gotCIMEnumerationContext = false; |
|
Boolean gotFilterQueryLanguage = false; |
|
Boolean gotFilterQuery = false; |
|
Boolean gotOperationTimeout = false; |
|
Boolean gotContinueOnError = false; |
|
Boolean gotEnumerationContext = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "ClassName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getClassNameElement(parser, className, true); |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQueryLanguage") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQueryLanguage, true); |
|
duplicateParameter = gotFilterQueryLanguage; |
|
gotFilterQueryLanguage = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQuery") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQuery, true); |
|
duplicateParameter = gotFilterQuery; |
|
gotFilterQuery = true; |
|
} |
|
|
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
else if (System::strcasecmp(name, "OperationTimeout") == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, operationTimeout, false); |
|
duplicateParameter = gotOperationTimeout; |
|
gotOperationTimeout = true; |
|
} |
|
// [IN,OPTIONAL] Boolean ContinueOnError = false, |
|
else if (System::strcasecmp(name, "ContinueOnError") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, continueOnError, true); |
|
duplicateParameter = gotContinueOnError; |
|
gotContinueOnError = true; |
|
} |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0. NULL not allowed |
|
// NULL value component not allowed. |
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotClassName) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
|
|
|
|
AutoPtr<CIMOpenEnumerateInstancePathsRequestMessage> request( |
|
new CIMOpenEnumerateInstancePathsRequestMessage( |
|
messageId, |
|
nameSpace, |
|
className, |
|
filterQueryLanguage, |
|
filterQuery, |
|
operationTimeout, |
|
continueOnError, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMOpenReferenceInstancesRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenReferenceInstancesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMObjectPath objectName; |
|
CIMName resultClass; |
|
String role; |
|
Boolean includeClassOrigin = false; |
|
CIMPropertyList propertyList; |
|
String filterQueryLanguage = String::EMPTY; |
|
String filterQuery = String::EMPTY; |
|
Uint32Arg operationTimeout = 0; |
|
Boolean continueOnError = false; |
|
Uint32Arg maxObjectCount = 0; |
|
String enumerationContext = String::EMPTY; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotObjectName = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotPropertyList = false; |
|
Boolean gotEnumerationContext = false; |
|
Boolean gotFilterQueryLanguage = false; |
|
Boolean gotFilterQuery = false; |
|
Boolean gotOperationTimeout = false; |
|
Boolean gotContinueOnError = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ResultClass") == 0) |
|
{ |
|
// ResultClass may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, resultClass, false); |
|
} |
|
duplicateParameter = gotResultClass; |
|
gotResultClass = true; |
|
} |
|
else if (System::strcasecmp(name, "Role") == 0) |
|
{ |
|
// Role may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, role, false); |
|
} |
|
duplicateParameter = gotRole; |
|
gotRole = true; |
|
} |
|
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "PropertyList") == 0) |
|
{ |
|
if (!emptyTag) |
|
{ |
|
CIMValue pl; |
|
if (XmlReader::getValueArrayElement(parser, CIMTYPE_STRING, pl)) |
|
{ |
|
Array<String> propertyListArray; |
|
pl.get(propertyListArray); |
|
Array<CIMName> cimNameArray; |
|
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} |
|
} |
|
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} |
|
else if (System::strcasecmp(name, "FilterQueryLanguage") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQueryLanguage, true); |
|
duplicateParameter = gotFilterQueryLanguage; |
|
gotFilterQueryLanguage = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQuery") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQuery, true); |
|
duplicateParameter = gotFilterQuery; |
|
gotFilterQuery = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "OperationTimeout") == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, operationTimeout, true); |
|
duplicateParameter = gotOperationTimeout; |
|
gotOperationTimeout = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ContinueOnError") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, continueOnError, true); |
|
duplicateParameter = gotContinueOnError; |
|
gotContinueOnError = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, name); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotObjectName) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
|
|
AutoPtr<CIMOpenReferenceInstancesRequestMessage> request( |
|
new CIMOpenReferenceInstancesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName, |
|
resultClass, |
|
role, |
|
includeClassOrigin, |
|
propertyList, |
|
filterQueryLanguage, |
|
filterQuery, |
|
operationTimeout, |
|
continueOnError, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
|
|
CIMOpenReferenceInstancePathsRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenReferenceInstancePathsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMObjectPath objectName; |
|
CIMName resultClass; |
|
String role; |
|
String filterQueryLanguage = String::EMPTY; |
|
String filterQuery = String::EMPTY; |
|
Uint32Arg operationTimeout = 0; |
|
Boolean continueOnError = false; |
|
Uint32Arg maxObjectCount = 0; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotObjectName = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotFilterQueryLanguage = false; |
|
Boolean gotFilterQuery = false; |
|
Boolean gotOperationTimeout = false; |
|
Boolean gotContinueOnError = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ResultClass") == 0) |
|
{ |
|
// |
|
// ResultClass may be NULL |
|
// |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, resultClass, false); |
|
} |
|
duplicateParameter = gotResultClass; |
|
gotResultClass = true; |
|
} |
|
else if (System::strcasecmp(name, "Role") == 0) |
|
{ |
|
// |
|
// Role may be NULL |
|
// |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, role, false); |
|
} |
|
duplicateParameter = gotRole; |
|
gotRole = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQueryLanguage") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQueryLanguage, true); |
|
duplicateParameter = gotFilterQueryLanguage; |
|
gotFilterQueryLanguage = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQuery") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQuery, true); |
|
duplicateParameter = gotFilterQuery; |
|
gotFilterQuery = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "OperationTimeout") == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, operationTimeout, true); |
|
duplicateParameter = gotOperationTimeout; |
|
gotOperationTimeout = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ContinueOnError") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, continueOnError, true); |
|
duplicateParameter = gotContinueOnError; |
|
gotContinueOnError = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotObjectName) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
|
|
|
|
AutoPtr<CIMOpenReferenceInstancePathsRequestMessage> request( |
|
new CIMOpenReferenceInstancePathsRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName, |
|
resultClass, |
|
role, |
|
filterQueryLanguage, |
|
filterQuery, |
|
operationTimeout, |
|
continueOnError, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMOpenAssociatorInstancesRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenAssociatorInstancesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMObjectPath objectName; |
|
CIMName assocClass; |
|
CIMName resultClass; |
|
String role; |
|
String resultRole; |
|
Boolean includeClassOrigin = false; |
|
CIMPropertyList propertyList; |
|
String filterQueryLanguage = String::EMPTY; |
|
String filterQuery = String::EMPTY; |
|
Uint32Arg operationTimeout; |
|
Boolean continueOnError = false; |
|
Uint32Arg maxObjectCount; |
|
String enumerationContext = String::EMPTY; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotObjectName = false; |
|
Boolean gotAssocClass = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotResultRole = false;; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean gotFilterQueryLanguage = false; |
|
Boolean gotFilterQuery = false; |
|
Boolean gotOperationTimeout = false; |
|
Boolean gotContinueOnError = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} |
|
else if (System::strcasecmp(name, "AssocClass") == 0) |
|
{ |
|
// |
|
// AssocClass may be NULL |
|
// |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, assocClass, false); |
|
} |
|
duplicateParameter = gotAssocClass; |
|
gotAssocClass = true; |
|
} |
|
else if (System::strcasecmp(name, "ResultClass") == 0) |
|
{ |
|
// ResultClass may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, resultClass, false); |
|
} |
|
duplicateParameter = gotResultClass; |
|
gotResultClass = true; |
|
} |
|
else if (System::strcasecmp(name, "Role") == 0) |
|
{ |
|
// Role may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, role, false); |
|
} |
|
duplicateParameter = gotRole; |
|
gotRole = true; |
|
} |
|
else if (System::strcasecmp(name, "ResultRole") == 0) |
|
{ |
|
// ResultRole may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, resultRole, false); |
|
} |
|
duplicateParameter = gotResultRole; |
|
gotResultRole = true; |
|
} |
|
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQueryLanguage") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQueryLanguage, true); |
|
duplicateParameter = gotFilterQueryLanguage; |
|
gotFilterQueryLanguage = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQuery") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQuery, true); |
|
duplicateParameter = gotFilterQuery; |
|
gotFilterQuery = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "OperationTimeout") == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, operationTimeout, true); |
|
duplicateParameter = gotOperationTimeout; |
|
gotOperationTimeout = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ContinueOnError") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, continueOnError, true); |
|
duplicateParameter = gotContinueOnError; |
|
gotContinueOnError = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else if (System::strcasecmp(name, "PropertyList") == 0) |
|
{ |
|
if (!emptyTag) |
|
{ |
|
CIMValue pl; |
|
if (XmlReader::getValueArrayElement(parser, CIMTYPE_STRING, pl)) |
|
{ |
|
Array<String> propertyListArray; |
|
pl.get(propertyListArray); |
|
Array<CIMName> cimNameArray; |
|
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
propertyList.set(cimNameArray); |
|
} |
|
} |
|
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotObjectName) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
|
|
|
|
AutoPtr<CIMOpenAssociatorInstancesRequestMessage> request( |
|
new CIMOpenAssociatorInstancesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName, |
|
assocClass, |
|
resultClass, |
|
role, |
|
resultRole, |
|
includeClassOrigin, |
|
propertyList, |
|
filterQueryLanguage, |
|
filterQuery, |
|
operationTimeout, |
|
continueOnError, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMOpenAssociatorInstancePathsRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenAssociatorInstancePathsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMObjectPath objectName; |
|
CIMName assocClass; |
|
CIMName resultClass; |
|
String role; |
|
String resultRole; |
|
String filterQueryLanguage = String::EMPTY; |
|
String filterQuery = String::EMPTY; |
|
Uint32Arg operationTimeout; |
|
Boolean continueOnError = false; |
|
Uint32Arg maxObjectCount; |
|
String enumerationContext = String::EMPTY; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotObjectName = false; |
|
Boolean gotAssocClass = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotResultRole = false;; |
|
Boolean gotFilterQueryLanguage = false; |
|
Boolean gotFilterQuery = false; |
|
Boolean gotOperationTimeout = false; |
|
Boolean gotContinueOnError = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} |
|
else if (System::strcasecmp(name, "AssocClass") == 0) |
|
{ |
|
// AssocClass may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, assocClass, false); |
|
} |
|
duplicateParameter = gotAssocClass; |
|
gotAssocClass = true; |
|
} |
|
else if (System::strcasecmp(name, "ResultClass") == 0) |
|
{ |
|
// ResultClass may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, resultClass, false); |
|
} |
|
duplicateParameter = gotResultClass; |
|
gotResultClass = true; |
|
} |
|
else if (System::strcasecmp(name, "Role") == 0) |
|
{ |
|
// Role may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, role, false); |
|
} |
|
duplicateParameter = gotRole; |
|
gotRole = true; |
|
} |
|
else if (System::strcasecmp(name, "ResultRole") == 0) |
|
{ |
|
// ResultRole may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, resultRole, false); |
|
} |
|
duplicateParameter = gotResultRole; |
|
gotResultRole = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQueryLanguage") == 0) |
|
{ |
|
//XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, filterQueryLanguage, true); |
|
duplicateParameter = gotFilterQueryLanguage; |
|
gotFilterQueryLanguage = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "FilterQuery") == 0) |
|
{ |
|
XmlReader::getStringValueElement(parser, filterQuery, true); |
|
duplicateParameter = gotFilterQuery; |
|
gotFilterQuery = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "OperationTimeout") == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, operationTimeout, true); |
|
duplicateParameter = gotOperationTimeout; |
|
gotOperationTimeout = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "ContinueOnError") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, continueOnError, true); |
|
duplicateParameter = gotContinueOnError; |
|
gotContinueOnError = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotObjectName) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
|
|
|
|
AutoPtr<CIMOpenAssociatorInstancePathsRequestMessage> request( |
|
new CIMOpenAssociatorInstancePathsRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName, |
|
assocClass, |
|
resultClass, |
|
role, |
|
resultRole, |
|
filterQueryLanguage, |
|
filterQuery, |
|
operationTimeout, |
|
continueOnError, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMPullInstancesWithPathRequestMessage* |
|
CIMOperationRequestDecoder::decodePullInstancesWithPathRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
String enumerationContext = String::EMPTY; |
|
Uint32Arg maxObjectCount = 0; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotEnumerationContext = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "EnumerationContext") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, enumerationContext, true); |
|
duplicateParameter = gotEnumerationContext; |
|
gotEnumerationContext = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
|
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, "Duplicate IPARAM received"); |
|
} |
|
} |
|
|
|
if (!gotEnumerationContext) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"EnumerationContext IPARAM required"); |
|
} |
|
|
|
if (!gotMaxObjectCount) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"MaxObjectCount IPARAM required"); |
|
} |
|
|
|
AutoPtr<CIMPullInstancesWithPathRequestMessage> request( |
|
new CIMPullInstancesWithPathRequestMessage( |
|
messageId, |
|
nameSpace, |
|
enumerationContext, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMPullInstancePathsRequestMessage* |
|
CIMOperationRequestDecoder::decodePullInstancePathsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
String enumerationContext = String::EMPTY; |
|
Uint32Arg maxObjectCount = 0; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean gotEnumerationContext = false; |
|
Boolean gotMaxObjectCount = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "EnumerationContext") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, enumerationContext, true); |
|
duplicateParameter = gotEnumerationContext; |
|
gotEnumerationContext = true; |
|
} |
|
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
|
duplicateParameter = gotMaxObjectCount; |
|
gotMaxObjectCount = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
"Invalid IPARAMVALUE tag "); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotEnumerationContext) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"EnumerationContext IPARAM required"); |
|
} |
|
|
|
if (!gotMaxObjectCount) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"MaxObjectCount IPARAM required"); |
|
} |
|
|
|
AutoPtr<CIMPullInstancePathsRequestMessage> request( |
|
new CIMPullInstancePathsRequestMessage( |
|
messageId, |
|
nameSpace, |
|
enumerationContext, |
|
maxObjectCount, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMCloseEnumerationRequestMessage* |
|
CIMOperationRequestDecoder::decodeCloseEnumerationRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
String enumerationContext = String::EMPTY; |
|
Boolean duplicateParameter = false; |
|
Boolean gotEnumerationContext = false; |
|
|
|
Boolean emptyTag; |
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "EnumerationContext") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, enumerationContext, true); |
|
duplicateParameter = gotEnumerationContext; |
|
gotEnumerationContext = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotEnumerationContext) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"EnumerationContext IPARAM required"); |
|
} |
|
|
|
AutoPtr<CIMCloseEnumerationRequestMessage> request( |
|
new CIMCloseEnumerationRequestMessage( |
|
messageId, |
|
nameSpace, |
|
enumerationContext, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
|
|
CIMEnumerationCountRequestMessage* |
|
CIMOperationRequestDecoder::decodeEnumerationCountRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
String enumerationContext = String::EMPTY; |
|
Boolean duplicateParameter = false; |
|
Boolean gotEnumerationContext = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "EnumerationContext") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, enumerationContext, true); |
|
duplicateParameter = gotEnumerationContext; |
|
gotEnumerationContext = true; |
|
} |
|
else |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
|
|
if (!gotEnumerationContext) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"Missing EnumerationContext Parameter"); |
|
} |
|
|
|
|
|
AutoPtr<CIMEnumerationCountRequestMessage> request( |
|
new CIMEnumerationCountRequestMessage( |
|
messageId, |
|
nameSpace, |
|
enumerationContext, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
//EXP_PULL_END |
|
|
void CIMOperationRequestDecoder::setServerTerminating(Boolean flag) | void CIMOperationRequestDecoder::setServerTerminating(Boolean flag) |
{ | { |
_serverTerminating = flag; | _serverTerminating = flag; |