version 1.127, 2010/06/06 17:04:18
|
version 1.127.2.7, 2013/07/20 18:32:58
|
|
|
#include <Pegasus/Common/CommonUTF.h> | #include <Pegasus/Common/CommonUTF.h> |
#include <Pegasus/Common/MessageLoader.h> | #include <Pegasus/Common/MessageLoader.h> |
#include <Pegasus/Common/BinaryCodec.h> | #include <Pegasus/Common/BinaryCodec.h> |
|
#include <Pegasus/Common/OperationContextInternal.h> |
|
#include <Pegasus/General/CIMError.h> |
|
|
|
#ifdef PEGASUS_PAM_SESSION_SECURITY |
|
#include <Pegasus/Security/Authentication/PAMSessionBasicAuthenticator.h> |
|
#include <Pegasus/Security/Authentication/AuthenticationStatus.h> |
|
#endif |
|
|
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
/****************************************************************************** |
|
** |
|
** Local Functions |
|
** |
|
******************************************************************************/ |
|
// KS_TODO_PULL Expand use of these two functions to all operations. |
|
// Create a propertyList with the internal tags set. Used for property |
|
// lists that involve instances. Tags used in output Xml Processing |
|
void _createPropertyListWithTags(XmlParser& parser, CIMPropertyList& pl) |
|
{ |
|
CIMValue val; |
|
if (XmlReader::getValueArrayElement(parser, CIMTYPE_STRING, val)) |
|
{ |
|
Array<String> propertyListArray; |
|
val.get(propertyListArray); |
|
pl.append(propertyListArray); |
|
} |
|
} |
|
|
|
// Create a PropertyList without the propertyList internal tags. Used for |
|
// propertylists on class operations. |
|
void _createPropertyListWithoutTags(XmlParser& parser, CIMPropertyList& pl) |
|
{ |
|
CIMValue val; |
|
if (XmlReader::getValueArrayElement(parser, CIMTYPE_STRING, val)) |
|
{ |
|
Array<String> propertyListArray; |
|
val.get(propertyListArray); |
|
Array<CIMName> cimNameArray; |
|
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
pl.set(cimNameArray); |
|
} |
|
} |
|
|
|
/****************************************************************************** |
|
** |
|
** CIMOperationRequestDecoder Class |
|
** |
|
******************************************************************************/ |
|
// throw CIM_ERR_NOT_SUPPORTED with no additional text |
|
void _throwCIMExceptionCIMErrNotSupported(const String& param = String::EMPTY) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, param); |
|
} |
|
|
|
// Throw CIM_ERR_INVALID_PARAMETER with optional parameter name(s) |
|
void _throwCIMExceptionInvalidParameter(const String& param = String::EMPTY) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, param); |
|
} |
|
|
|
// Common call for all cases where duplicate IparameterValues recieved |
|
// in a single operation. Throw InvalidParameter exception with optional |
|
// additional data. |
|
void _throwCIMExceptionDuplicateParameter(const String& name = String::EMPTY) |
|
{ |
|
_throwCIMExceptionInvalidParameter(name); |
|
} |
|
|
|
// Common call for cases where Invalid IParameterValue names recived |
|
void _throwCIMExceptionInvalidIParamName(const String& param = String::EMPTY) |
|
{ |
|
_throwCIMExceptionCIMErrNotSupported(param); |
|
} |
|
|
|
#ifdef PEGASUS_PAM_SESSION_SECURITY |
|
void CIMOperationRequestDecoder::_updateExpiredPassword( |
|
Uint32 queueId, |
|
HttpMethod httpMethod, |
|
const String& messageId, |
|
Boolean closeConnect, |
|
const ContentLanguageList& httpContentLanguages, |
|
CIMMessage * request, |
|
const String& userName, |
|
const String& oldPass) |
|
{ |
|
static CIMName meth = CIMName("UpdateExpiredPassword"); |
|
static CIMName clName = CIMName("PG_Account"); |
|
|
|
|
|
// this has to be an invokeMethod and |
|
if (CIM_INVOKE_METHOD_REQUEST_MESSAGE != request->getType()) |
|
{ |
|
sendHttpError( |
|
queueId, |
|
HTTP_STATUS_BADREQUEST, |
|
"invalid header", |
|
"Header \'Pragma: UpdateExpiredPassword\' not valid for this " |
|
"CIMMethod.", |
|
closeConnect); |
|
|
|
return; |
|
} |
|
|
|
CIMInvokeMethodRequestMessage* msg = |
|
dynamic_cast<CIMInvokeMethodRequestMessage*>(request); |
|
|
|
// class PG_Account |
|
// method UpdateExpiredPassword |
|
// InterOp namespace |
|
if ((!clName.equal(msg->className)) || |
|
(!(meth.equal(msg->methodName))) || |
|
(!msg->nameSpace.equal(PEGASUS_NAMESPACENAME_INTEROP.getString()))) |
|
{ |
|
// not of interest for us, chicken out |
|
sendHttpError( |
|
queueId, |
|
HTTP_STATUS_BADREQUEST, |
|
"invalid header", |
|
"Header \'Pragma: UpdateExpiredPassword\' not valid for this " |
|
"class, method or namespace.", |
|
closeConnect); |
|
return; |
|
} |
|
|
|
String newPass; |
|
Boolean found = false; |
|
|
|
try |
|
{ |
|
// Get new password from request - String-type Parameter UserPassword |
|
Array<CIMParamValue> inParm = msg->inParameters; |
|
for (Uint32 i=0; i < inParm.size(); i++) |
|
{ |
|
CIMParamValue x = inParm[i]; |
|
if (String::equalNoCase(x.getParameterName(),"UserPassword")) |
|
{ |
|
CIMValue passValue = x.getValue(); |
|
passValue.get(newPass); |
|
found = true; |
|
break; |
|
} |
|
} |
|
} catch(Exception &e) |
|
{ |
|
// already know it is an invokeMethod, see checks above |
|
sendMethodError( |
|
queueId, |
|
httpMethod, |
|
messageId, |
|
meth.getString(), |
|
PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, e.getMessage()), |
|
closeConnect); |
|
return; |
|
} |
|
if (!found) |
|
{ |
|
sendMethodError( |
|
queueId, |
|
httpMethod, |
|
messageId, |
|
meth.getString(), |
|
PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, "Missing Parameter UserPassword"), |
|
closeConnect); |
|
return; |
|
} |
|
// Call password update function from PAMSession.h |
|
AuthenticationStatus authStat = |
|
PAMSessionBasicAuthenticator::updateExpiredPassword( |
|
userName, |
|
oldPass, |
|
newPass); |
|
|
|
if (authStat.isSuccess()) |
|
{ |
|
// Send success message |
|
Buffer message; |
|
Buffer emptyBody; |
|
|
|
message = XmlWriter::formatSimpleMethodRspMessage( |
|
meth, |
|
messageId, |
|
httpMethod, |
|
httpContentLanguages, |
|
emptyBody, |
|
0, |
|
true, |
|
true); |
|
|
|
sendResponse(queueId, message,closeConnect); |
|
} |
|
else |
|
{ |
|
sendHttpError( |
|
queueId, |
|
authStat.getHttpStatus(), |
|
String::EMPTY, |
|
authStat.getErrorDetail(), |
|
closeConnect); |
|
} |
|
} |
|
#endif |
|
|
|
|
|
|
|
|
CIMOperationRequestDecoder::CIMOperationRequestDecoder( | CIMOperationRequestDecoder::CIMOperationRequestDecoder( |
MessageQueue* outputQueue, | MessageQueue* outputQueue, |
Uint32 returnQueueId) | Uint32 returnQueueId) |
|
|
sendResponse(queueId, message,closeConnect); | sendResponse(queueId, message,closeConnect); |
} | } |
| |
|
void CIMOperationRequestDecoder::sendUserAccountExpired( |
|
Uint32 queueId, |
|
HttpMethod httpMethod, |
|
const String& messageId, |
|
const String& methodName, |
|
Boolean closeConnect, |
|
Boolean isIMethod) |
|
{ |
|
Buffer message; |
|
|
|
CIMError errorInst; |
|
errorInst.setErrorType(CIMError::ERROR_TYPE_OTHER); |
|
errorInst.setOtherErrorType("Expired Password"); |
|
errorInst.setProbableCause(CIMError::PROBABLE_CAUSE_AUTHENTICATION_FAILURE); |
|
|
|
CIMException myExc( |
|
CIM_ERR_ACCESS_DENIED, |
|
"User Account Expired", |
|
errorInst.getInstance()); |
|
|
|
if (isIMethod) |
|
{ |
|
message = XmlWriter::formatSimpleIMethodErrorRspMessage( |
|
methodName, |
|
messageId, |
|
httpMethod, |
|
myExc); |
|
} |
|
else |
|
{ |
|
message = XmlWriter::formatSimpleMethodErrorRspMessage( |
|
methodName, |
|
messageId, |
|
httpMethod, |
|
myExc); |
|
} |
|
|
|
sendResponse(queueId, message,closeConnect); |
|
} |
|
|
void CIMOperationRequestDecoder::sendHttpError( | void CIMOperationRequestDecoder::sendHttpError( |
Uint32 queueId, | Uint32 queueId, |
const String& status, | const String& status, |
|
|
| |
default: | default: |
// Unexpected message type | // Unexpected message type |
PEGASUS_ASSERT(0); |
PEGASUS_UNREACHABLE(PEGASUS_ASSERT(0);) |
break; | break; |
} | } |
| |
|
|
// | // |
// 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 |
|
|
| |
Uint32 queueId = httpMessage->queueId; | Uint32 queueId = httpMessage->queueId; |
| |
// Save userName and authType: |
// Save userName, userRole, userPass and authType: |
| |
String userName; | String userName; |
|
String userRole; |
|
String userPass; |
|
Boolean isExpiredPassword = false; |
|
Boolean updateExpiredPassword; |
String authType; | String authType; |
Boolean closeConnect = httpMessage->getCloseConnect(); | Boolean closeConnect = httpMessage->getCloseConnect(); |
| |
|
|
| |
userName = httpMessage->authInfo->getAuthenticatedUser(); | userName = httpMessage->authInfo->getAuthenticatedUser(); |
authType = httpMessage->authInfo->getAuthType(); | authType = httpMessage->authInfo->getAuthType(); |
|
userRole = httpMessage->authInfo->getUserRole(); |
|
userPass = httpMessage->authInfo->getAuthenticatedPassword(); |
|
|
|
#ifdef PEGASUS_PAM_SESSION_SECURITY |
|
isExpiredPassword = httpMessage->authInfo->isExpiredPassword(); |
|
#endif |
| |
// Parse the HTTP message: | // Parse the HTTP message: |
| |
|
|
// Validate the "CIMOperation" header: | // Validate the "CIMOperation" header: |
| |
const char* cimOperation; | const char* cimOperation; |
Boolean operationHeaderFound = HTTPMessage::lookupHeader( |
|
headers, "CIMOperation", cimOperation, true); |
|
// If the CIMOperation header was missing, the HTTPAuthenticatorDelegator | // If the CIMOperation header was missing, the HTTPAuthenticatorDelegator |
// would not have passed the message to us. | // would not have passed the message to us. |
PEGASUS_ASSERT(operationHeaderFound); |
PEGASUS_FCT_EXECUTE_AND_ASSERT( |
|
true, |
|
HTTPMessage::lookupHeader(headers, "CIMOperation", cimOperation, true)); |
| |
if (System::strcasecmp(cimOperation, "MethodCall") != 0) | if (System::strcasecmp(cimOperation, "MethodCall") != 0) |
{ | { |
|
|
cimProtocolVersion = "1.0"; | cimProtocolVersion = "1.0"; |
} | } |
| |
|
// Validate if Pragma: UpdateExpiredPassword is set |
|
updateExpiredPassword = false; |
|
|
|
String pragmaValue; |
|
if(HTTPMessage::lookupHeader(headers,"Pragma",pragmaValue)) |
|
{ |
|
updateExpiredPassword = |
|
(PEG_NOT_FOUND != pragmaValue.find("UpdateExpiredPassword")); |
|
} |
|
|
String cimMethod; | String cimMethod; |
if (HTTPMessage::lookupHeader(headers, "CIMMethod", cimMethod, true)) | if (HTTPMessage::lookupHeader(headers, "CIMMethod", cimMethod, true)) |
{ | { |
|
|
} | } |
} | } |
| |
// 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: |
| |
|
|
cimObject, | cimObject, |
authType, | authType, |
userName, | userName, |
|
userRole, |
|
userPass, |
|
isExpiredPassword, |
|
updateExpiredPassword, |
httpMessage->ipAddress, | httpMessage->ipAddress, |
httpMessage->acceptLanguages, | httpMessage->acceptLanguages, |
httpMessage->contentLanguages, | httpMessage->contentLanguages, |
|
|
const String& cimObjectInHeader, | const String& cimObjectInHeader, |
const String& authType, | const String& authType, |
const String& userName, | const String& userName, |
|
const String& userRole, |
|
const String& userPass, |
|
Boolean isExpiredPassword, |
|
Boolean updateExpiredPassword, |
const String& ipAddress, | const String& ipAddress, |
const AcceptLanguageList& httpAcceptLanguages, | const AcceptLanguageList& httpAcceptLanguages, |
const ContentLanguageList& httpContentLanguages, | const ContentLanguageList& httpContentLanguages, |
|
|
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: |
// | // |
| |
AutoPtr<CIMOperationRequestMessage> request; | AutoPtr<CIMOperationRequestMessage> request; |
|
String messageId; |
|
Boolean isIMethodCall = true; |
| |
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)); |
| |
|
|
{ | { |
XmlParser parser(content); | XmlParser parser(content); |
XmlEntry entry; | XmlEntry entry; |
String messageId; |
|
const char* cimMethodName = ""; | const char* cimMethodName = ""; |
| |
// | // |
|
|
| |
if (XmlReader::getIMethodCallStartTag(parser, cimMethodName)) | if (XmlReader::getIMethodCallStartTag(parser, cimMethodName)) |
{ | { |
|
isIMethodCall = true; |
// The Specification for CIM Operations over HTTP reads: | // The Specification for CIM Operations over HTTP reads: |
// 3.3.6. CIMMethod | // 3.3.6. CIMMethod |
// | // |
|
|
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)); |
|
|
|
else if (System::strcasecmp( |
|
cimMethodName, "OpenQueryInstances") == 0) |
|
request.reset(decodeOpenQueryInstancesRequest( |
|
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, |
|
|
else if (XmlReader::getMethodCallStartTag(parser, cimMethodName)) | else if (XmlReader::getMethodCallStartTag(parser, cimMethodName)) |
{ | { |
CIMObjectPath reference; | CIMObjectPath reference; |
|
isIMethodCall = false; |
| |
// The Specification for CIM Operations over HTTP reads: | // The Specification for CIM Operations over HTTP reads: |
// 3.3.6. CIMMethod | // 3.3.6. CIMMethod |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
return; | return; |
} | } |
|
catch (TooManyElementsException& e) |
|
{ |
|
PEG_TRACE((TRC_XML,Tracer::LEVEL1, |
|
"CIMOperationRequestDecoder::handleMethodCall - " |
|
"TooManyElementsException has occurred. Message: %s", |
|
(const char*) e.getMessage().getCString())); |
|
|
|
sendHttpError( |
|
queueId, |
|
HTTP_STATUS_BADREQUEST, |
|
"request-with-too-many-elements", |
|
e.getMessage(), |
|
closeConnect); |
|
PEG_METHOD_EXIT(); |
|
return; |
|
} |
catch (Exception& e) | catch (Exception& e) |
{ | { |
// Don't know why I got this exception. Seems like a bad thing. | // Don't know why I got this exception. Seems like a bad thing. |
|
|
if (cimmsg != NULL) | if (cimmsg != NULL) |
{ | { |
cimmsg->operationContext.insert(IdentityContainer(userName)); | cimmsg->operationContext.insert(IdentityContainer(userName)); |
|
cimmsg->operationContext.insert(UserRoleContainer(userRole)); |
cimmsg->operationContext.set( | cimmsg->operationContext.set( |
AcceptLanguageListContainer(httpAcceptLanguages)); | AcceptLanguageListContainer(httpAcceptLanguages)); |
cimmsg->operationContext.set( | cimmsg->operationContext.set( |
|
|
} | } |
// l10n end | // l10n end |
| |
|
#ifdef PEGASUS_PAM_SESSION_SECURITY |
|
|
|
// Whatever happens on the authentication, we need to check for |
|
// a change of an expired password |
|
// Since the definition for password updates is not completely |
|
// defined in DMTF yet, keep this feature PAM_SESSION only |
|
// This also only works with CIM-XML right now. |
|
if (isExpiredPassword) |
|
{ |
|
// only try password update if req. Pragma is set |
|
if (updateExpiredPassword) |
|
{ |
|
// update expired password |
|
// fct. _updateExpiredPassword returns false |
|
// if the request was NOT for PG_Account etc. |
|
_updateExpiredPassword( |
|
queueId, |
|
httpMethod, |
|
messageId, |
|
closeConnect, |
|
httpContentLanguages, |
|
cimmsg, |
|
userName, |
|
userPass); |
|
} |
|
else |
|
{ |
|
sendUserAccountExpired( |
|
queueId, |
|
httpMethod, |
|
messageId, |
|
cimMethodInHeader, |
|
closeConnect, |
|
isIMethodCall); |
|
} |
|
PEG_METHOD_EXIT(); |
|
return; |
|
} |
|
#endif |
|
|
request->setCloseConnect(closeConnect); | request->setCloseConnect(closeConnect); |
_outputQueue->enqueue(request.release()); | _outputQueue->enqueue(request.release()); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
|
/************************************************************************** |
CIMCreateClassRequestMessage* |
** |
CIMOperationRequestDecoder::decodeCreateClassRequest( |
** Decode CIM Operation Type Common IParameter types. |
Uint32 queueId, |
** Each class defines processing for a particular IPARAM type |
XmlParser& parser, |
** (ex. boolean)or parameter name (i.e. propertyListIParam) |
const String& messageId, |
** Each struct defines: |
const CIMNamespaceName& nameSpace) |
** got - Boolean defines whether this parameter has been found |
|
** value - The value container for this type |
|
** iParamFound(...) - function sets the duplicate flag and the got flag |
|
** get - Function to get the defined parameter from the |
|
** parser |
|
** NOTE: at least one has multiple get.. functions. |
|
** NOTE: Some of these are defined for a particular attribute (ex. |
|
** propertyListIparam) so the attribute name is integrated into the |
|
** methods and others for a whole class of attributes (Boolean, |
|
** String,ClassName etc.) so the attribute name is defined as part |
|
** of the constructor. |
|
***************************************************************************/ |
|
// Common xml attribute accessor for all boolean attributes. The |
|
// attribute name is defined in the constructor. |
|
// The usage pattern is: |
|
// Boolean duplicate; // Flag to indicate multiple calls |
|
// |
|
// booleanIParam xyz("xyz"); default is false for attribute xyz |
|
// |
|
// if(xyz.get(parser, name, emptyTag) // parses to test if name == xyz |
|
// iParamFound(duplicate); // set flag to indicate exists etc. |
|
class booleanIParam |
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
public: |
"CIMOperationRequestDecoder::decodeCreateClassRequest()"); |
Boolean got; |
|
Boolean value; |
| |
STAT_GETSTARTTIME |
// constructor with default value = false |
|
booleanIParam(const char* name): got(false),value(false),iParamName(name){} |
| |
CIMClass newClass; |
// constructor with initial value specifically set from the input |
Boolean duplicateParameter = false; |
booleanIParam(const char* name, Boolean _value): |
Boolean gotClass = false; |
got(false),value(_value),iParamName(name){} |
Boolean emptyTag; |
|
| |
for (const char* name; |
~booleanIParam(){} |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
|
void iParamFound(Boolean& duplicate) |
{ | { |
if (System::strcasecmp(name, "NewClass") == 0) |
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// get the value of the parameter if the parameter if it exists. |
|
// Note that the attribute name is defined in the constructor |
|
// Value is required. |
|
// @param parser |
|
// @param testName attribute name from parse. |
|
// @emptyTag returns true if emptyTag returned true from parser |
|
Boolean get(XmlParser& parser, const char * testName, Boolean& emptyTag) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
if (System::strcasecmp(iParamName.getCString(), testName) == 0) |
if (!XmlReader::getClassElement(parser, newClass)) |
|
{ | { |
throw PEGASUS_CIM_EXCEPTION( |
XmlReader::rejectNullIParamValue(parser, emptyTag, |
CIM_ERR_INVALID_PARAMETER, "NewClass"); |
iParamName.getCString()); |
|
XmlReader::getBooleanValueElement(parser, value, true); |
|
return true; |
} | } |
duplicateParameter = gotClass; |
return false; |
gotClass = true; |
|
} | } |
else |
private: |
|
String iParamName; |
|
// hide unused default constructor and assign, copy constructors |
|
booleanIParam(); |
|
booleanIParam(const booleanIParam&); |
|
booleanIParam& operator = (const booleanIParam&); |
|
}; |
|
|
|
// decode Iparam to CIMName representing class names. This struct |
|
// has two get functions: |
|
// get - parse where the parameter value is required |
|
// getOptional - parse where the parameter value is optional |
|
|
|
class classNameIParam |
{ | { |
PEG_METHOD_EXIT(); |
public: |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
Boolean got; |
|
CIMName value; |
|
|
|
// Set the flag to inidcate that this IParam has been gotten and also |
|
// set the flag defined by the duplicate parameter |
|
// @param duplicate Boolean that is set to previous value of the got |
|
// variable indicating whether this is second call to this IParam |
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// construct an IParam definition with name. |
|
// @param name const char* defining name of IParam to match |
|
// @return true if IParam found with _attrName |
|
classNameIParam(const char* name): got(false), iParamName(name){} |
|
|
|
~classNameIParam(){} |
|
|
|
// Get Required value element.Test for name parameter as IParam with |
|
// name and if found, if value not NULL, parse the className and |
|
// set into value |
|
Boolean get(XmlParser& parser, const char* name, Boolean& emptyTag) |
|
{ |
|
if (System::strcasecmp(name,iParamName.getCString()) == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getClassNameElement(parser, value, true); |
|
return true; |
|
} |
|
return false; |
|
} |
|
// Get Iparam with optional value. |
|
Boolean getOptional(XmlParser& parser, const char* name, |
|
Boolean& emptyTag) |
|
{ |
|
if (System::strcasecmp(name, iParamName.getCString()) == 0) |
|
{ |
|
// value may be NULL |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, value, false); |
|
} |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
String iParamName; |
|
// hide unused default constructor and assign, copy constructors |
|
classNameIParam(); |
|
classNameIParam(const classNameIParam&); |
|
classNameIParam& operator = (const classNameIParam&); |
|
}; |
|
|
|
// test for "InstanceName" iParam and if found, return CIMObjectPath |
|
// in value |
|
class instanceNameIParam |
|
{ |
|
public: |
|
Boolean got; |
|
CIMObjectPath value; |
|
|
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
instanceNameIParam(): got(false){} |
|
|
|
~instanceNameIParam(){} |
|
|
|
Boolean get(XmlParser& parser, const char * name, Boolean& emptyTag) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getInstanceNameElement(parser, value); |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
// hide unused assign, copy constructors |
|
instanceNameIParam(const instanceNameIParam&); |
|
instanceNameIParam& operator = (const instanceNameIParam&); |
|
}; |
|
|
|
// test for "ObjectName" attribute and if found, return CIMObjectPath |
|
// This struct has an extra attribute, the flag isClassNameElement which |
|
// returns true if the objectName was a classPath and not an instance |
|
// path. |
|
// If Xmlreader returns true, this is class only element, no |
|
// key bindings. That state must be set into the request |
|
// message (ex. objectName.isClassElement) |
|
// @param (Optional) Name of IParam. Default is ObjectName. Note |
|
// that pull operations use InstanceName as IParamName. |
|
class objectNameIParam |
|
{ |
|
public: |
|
Boolean got; |
|
CIMObjectPath value; |
|
Boolean isClassNameElement; |
|
|
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// Constructor using default IParam name |
|
objectNameIParam(): got(false), isClassNameElement(false), |
|
iParamName("ObjectName"){} |
|
|
|
// Constructor with IParam name included |
|
objectNameIParam(const char* name): got(false), isClassNameElement(false), |
|
iParamName(name){} |
|
|
|
~objectNameIParam(){} |
|
|
|
Boolean get(XmlParser& parser, const char * name, Boolean& emptyTag) |
|
{ |
|
if (System::strcasecmp(name, iParamName.getCString()) == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
isClassNameElement = |
|
XmlReader::getObjectNameElement(parser, value); |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
String iParamName; |
|
// hide unused assign, copy constructors |
|
objectNameIParam(const objectNameIParam&); |
|
objectNameIParam& operator = (const objectNameIParam&); |
|
}; |
|
|
|
// test for "PropertyList" attribute and, if found, return property list |
|
// in the value element. |
|
class propertyListIParam |
|
{ |
|
public: |
|
Boolean got; |
|
CIMPropertyList value; |
|
|
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// construct a propertyListIParam object |
|
propertyListIParam(): got(false){} |
|
|
|
~propertyListIParam(){} |
|
|
|
Boolean get(XmlParser& parser, const char* name, Boolean& emptyTag) |
|
{ |
|
if (System::strcasecmp(name, "PropertyList") == 0) |
|
{ |
|
if (!emptyTag) |
|
{ |
|
CIMValue pl; |
|
if (XmlReader::getValueArrayElement(parser, CIMTYPE_STRING, pl)) |
|
{ |
|
Array<String> propertyListArray; |
|
pl.get(propertyListArray); |
|
// NOTE: Cannot use the propertyList.set(...) method |
|
// here because set does not create propertyList tags |
|
value.append(propertyListArray); |
|
} |
|
} |
|
return true; |
|
} |
|
return false; |
} | } |
| |
|
// This version of the get function usees the propertyList set function |
|
// to set the property list array into the propertyList object. It |
|
// can only be used for those Operations where the propertylist is NOT |
|
// used by the Server in the response (i.e. getClass and modifyInstance). |
|
// |
|
Boolean getSpecial(XmlParser& parser, const char* name, Boolean& emptyTag) |
|
{ |
|
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; |
|
// Map the strings to CIMNames. |
|
for (Uint32 i = 0; i < propertyListArray.size(); i++) |
|
{ |
|
cimNameArray.append(propertyListArray[i]); |
|
} |
|
// use set to put list into property list without |
|
// setting propertyList tags. |
|
value.set(cimNameArray); |
|
} |
|
} |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
// hide unused default assign, copy constructors |
|
propertyListIParam(const propertyListIParam&); |
|
propertyListIParam& operator = (const propertyListIParam&); |
|
}; |
|
|
|
// Attribute decoder for String Parameters |
|
// The constructor MUST include the attribute name. |
|
// The second defines whether a value is required. |
|
// If true and there is no value, the XmlReader does an exception. |
|
class stringIParam |
|
{ |
|
public: |
|
Boolean got; |
|
String value; |
|
|
|
// constructor with definition of attribute and default for the |
|
// required flag. |
|
// @param name const char* with name of IParam to match |
|
// @param valueRequired Boolean that defines whether value is required |
|
stringIParam(const char* name, Boolean _valueRequired): |
|
got(false), iParamName(name), valueRequired(_valueRequired){} |
|
|
|
~stringIParam(){} |
|
|
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// get the attribute if it exists. The attribute name is defined in |
|
// the constructor |
|
// @param parser |
|
// @param testName attribute name from parse. |
|
// @emptyTag returns true if emptyTag returned true from parser |
|
// @return Returns true if testName matches the IParam defined by current |
|
// position in the parser |
|
Boolean get(XmlParser& parser, const char * testName, Boolean& emptyTag) |
|
{ |
|
if (System::strcasecmp(iParamName.getCString(), testName) == 0) |
|
{ |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getStringValueElement(parser, value, valueRequired); |
|
} |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
String iParamName; |
|
Boolean valueRequired; |
|
stringIParam(); |
|
stringIParam(const stringIParam&); |
|
stringIParam& operator = (const stringIParam&); |
|
}; |
|
|
|
// Attribute decoder for Uint32Arg Parameters |
|
// The constructor MUST include the attribute name. |
|
// The second defines whether a value is required. |
|
// If true and there is no value, the XmlReader does an exception. |
|
// |
|
//// KS_TODO NEED REVIEW ON THIS ONE |
|
class uint32ArgIParam |
|
{ |
|
public: |
|
Boolean got; |
|
Uint32Arg value; |
|
|
|
// constructor with definition of iParam name and default for the |
|
// required flag (false). Default value of parameter is NULL if |
|
// no value is supplied. |
|
// @param name const char* with name of IParam to match |
|
uint32ArgIParam(const char* name): |
|
got(false), iParamName(name), valueRequired(false){} |
|
|
|
// constructor with definition of iParam name and default for the |
|
// required flag (false). Default value of parameter is integer defined |
|
// by supplied value. |
|
// @param name const char* with name of IParam to match |
|
uint32ArgIParam(const char* name, Uint32 _int): |
|
got(false), value(_int), iParamName(name), valueRequired(false){} |
|
|
|
// constructor with definition of attribute and default for the |
|
// required flag. |
|
// @param name const char* with name of IParam to match |
|
// @param valueRequired Boolean that defines whether value is required |
|
//// uint32ArgIParam(const char* name, Boolean _valueRequired): |
|
//// got(false), iParamName(name), valueRequired(_valueRequired){} |
|
|
|
~uint32ArgIParam(){} |
|
|
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// get the attribute if it exists. The attribute name is defined in |
|
// the constructor |
|
// @param parser |
|
// @param testName attribute name from parse. |
|
// @emptyTag returns true if emptyTag returned true from parser |
|
// @return Returns true if testName matches the IParam defined by current |
|
// position in the parser |
|
Boolean get(XmlParser& parser, const char * testName, Boolean& emptyTag) |
|
{ |
|
if (valueRequired) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, testName); |
|
} |
|
if (System::strcasecmp(iParamName.getCString(), testName) == 0) |
|
{ |
|
XmlReader::getUint32ArgValueElement(parser, value, true); |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
String iParamName; |
|
Boolean valueRequired; |
|
uint32ArgIParam(); |
|
uint32ArgIParam(const uint32ArgIParam&); |
|
uint32ArgIParam& operator = (const uint32ArgIParam&); |
|
}; |
|
|
|
// Attribute decoder for Uint32 Parameters |
|
// The constructor MUST include the attribute name. |
|
// The second defines whether a value is required. |
|
// If true and there is no value, the XmlReader does an exception. |
|
class uint32IParam |
|
{ |
|
public: |
|
Boolean got; |
|
Uint32 value; |
|
|
|
// constructor with definition of iParam name and default for the |
|
// required flag (false). Default value of parameter is NULL if |
|
// no value is supplied. |
|
// @param name const char* with name of IParam to match |
|
uint32IParam(const char* name): |
|
got(false), iParamName(name), valueRequired(false){} |
|
|
|
// constructor with definition of iParam name and default for the |
|
// required flag (false). Default value of parameter is integer defined |
|
// by supplied value. |
|
// @param name const char* with name of IParam to match |
|
uint32IParam(const char* name, Uint32 _int): |
|
got(false), value(_int), iParamName(name), valueRequired(false){} |
|
|
|
// constructor with definition of attribute and default for the |
|
// required flag. |
|
// @param name const char* with name of IParam to match |
|
// @param valueRequired Boolean that defines whether value is required |
|
//// uint32IParam(const char* name, Boolean _valueRequired): |
|
//// got(false), iParamName(name), valueRequired(_valueRequired){} |
|
|
|
~uint32IParam(){} |
|
|
|
void iParamFound(Boolean& duplicate) |
|
{ |
|
duplicate = got; |
|
got = true; |
|
} |
|
|
|
// get the attribute if it exists. The attribute name is defined in |
|
// the constructor |
|
// @param parser |
|
// @param testName attribute name from parse. |
|
// @emptyTag returns true if emptyTag returned true from parser |
|
// @return Returns true if testName matches the IParam defined by current |
|
// position in the parser |
|
Boolean get(XmlParser& parser, const char * testName, Boolean& emptyTag) |
|
{ |
|
if (valueRequired) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, testName); |
|
} |
|
if (System::strcasecmp(iParamName.getCString(), testName) == 0) |
|
{ |
|
XmlReader::getUint32ValueElement(parser, value, true); |
|
return true; |
|
} |
|
return false; |
|
} |
|
private: |
|
String iParamName; |
|
Boolean valueRequired; |
|
uint32IParam(); |
|
uint32IParam(const uint32IParam&); |
|
uint32IParam& operator = (const uint32IParam&); |
|
}; |
|
|
|
/************************************************************************ |
|
** |
|
** Common functions used by the decoders to avoid duplicate code. |
|
** |
|
**************************************************************************/ |
|
// test for valid end of XML and duplicate parameters on input |
|
// This function returns if OK or executes appropriate exceptions if there |
|
// is either a duplicate (duplicateParameter == true) or the |
|
// end tag IPARAMVALUE is not found. |
|
void _checkMissingEndTagOrDuplicateParamValue( |
|
XmlParser& parser, Boolean duplicateParameter, Boolean emptyTag) |
|
{ |
if (!emptyTag) | if (!emptyTag) |
{ | { |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); | XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
|
| |
if (duplicateParameter) | if (duplicateParameter) |
{ | { |
PEG_METHOD_EXIT(); |
_throwCIMExceptionDuplicateParameter(); |
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} | } |
} | } |
| |
if (!gotClass) |
// test if Required paramters exist (i.e. the got variable is |
|
// true. Generates exception if exist == false |
|
void _testRequiredParametersExist(Boolean exist) |
{ | { |
PEG_METHOD_EXIT(); |
if (!exist) |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
{ |
|
_throwCIMExceptionInvalidParameter(); |
|
} |
|
} |
|
/************************************************************************** |
|
** |
|
** Decode each CIMOperation type, processing the parameters for that type |
|
** and producing either a CIMMessage of the appropriate type or |
|
** an exception. |
|
** |
|
***************************************************************************/ |
|
|
|
CIMCreateClassRequestMessage* |
|
CIMOperationRequestDecoder::decodeCreateClassRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMClass newClass; |
|
Boolean gotNewClass = false; |
|
|
|
Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "NewClass") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
if (!XmlReader::getClassElement(parser, newClass)) |
|
{ |
|
_throwCIMExceptionInvalidParameter("NewClass"); |
|
} |
|
duplicateParameter = gotNewClass; |
|
gotNewClass = true; |
} | } |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(gotNewClass); |
| |
AutoPtr<CIMCreateClassRequestMessage> request( | AutoPtr<CIMCreateClassRequestMessage> request( |
new CIMCreateClassRequestMessage( | new CIMCreateClassRequestMessage( |
|
|
| |
STAT_SERVERSTART | STAT_SERVERSTART |
| |
PEG_METHOD_EXIT(); |
|
return request.release(); | return request.release(); |
} | } |
| |
|
|
const String& messageId, | const String& messageId, |
const CIMNamespaceName& nameSpace) | const CIMNamespaceName& nameSpace) |
{ | { |
PEG_METHOD_ENTER(TRC_DISPATCHER, |
|
"CIMOperationRequestDecoder::decodeGetClassRequest()"); |
|
|
|
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMName className; |
// GetClass Parameters |
Boolean localOnly = true; |
classNameIParam className("ClassName"); |
Boolean includeQualifiers = true; |
booleanIParam localOnly("localOnly",true); |
Boolean includeClassOrigin = false; |
booleanIParam includeQualifiers("IncludeQualifiers", true); |
CIMPropertyList propertyList; |
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; |
|
Boolean gotLocalOnly = false; |
|
Boolean gotIncludeQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ClassName") == 0) |
if(className.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
className.iParamFound(duplicateParameter); |
XmlReader::getClassNameElement(parser, className, true); |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} | } |
else if (System::strcasecmp(name, "LocalOnly") == 0) |
else if(localOnly.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
localOnly.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, localOnly, true); |
|
duplicateParameter = gotLocalOnly; |
|
gotLocalOnly = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeQualifiers") == 0) |
else if(includeQualifiers.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeQualifiers.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
|
duplicateParameter = gotIncludeQualifiers; |
|
gotIncludeQualifiers = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
else if(includeClassOrigin.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeClassOrigin.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} | } |
else if (System::strcasecmp(name, "PropertyList") == 0) |
else if(propertyList.getSpecial(parser, name, emptyTag)) |
{ |
|
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.iParamFound(duplicateParameter); |
} |
|
propertyList.set(cimNameArray); |
|
} |
|
} |
|
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} | } |
else | else |
{ | { |
PEG_METHOD_EXIT(); |
_throwCIMExceptionInvalidIParamName(); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
|
|
if (duplicateParameter) |
|
{ |
|
PEG_METHOD_EXIT(); |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} | } |
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
} | } |
| |
if (!gotClassName) |
// test for required parameters |
{ |
_testRequiredParametersExist(className.got); |
PEG_METHOD_EXIT(); |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
|
// Build message |
AutoPtr<CIMGetClassRequestMessage> request(new CIMGetClassRequestMessage( | AutoPtr<CIMGetClassRequestMessage> request(new CIMGetClassRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
className, |
className.value, |
localOnly, |
localOnly.value, |
includeQualifiers, |
includeQualifiers.value, |
includeClassOrigin, |
includeClassOrigin.value, |
propertyList, |
propertyList.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
| |
PEG_METHOD_EXIT(); |
|
return request.release(); | return request.release(); |
} | } |
| |
|
|
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMClass modifiedClass; | CIMClass modifiedClass; |
Boolean duplicateParameter = false; |
|
Boolean gotClass = false; | Boolean gotClass = false; |
|
|
Boolean emptyTag; | Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
if (!XmlReader::getClassElement(parser, modifiedClass)) | if (!XmlReader::getClassElement(parser, modifiedClass)) |
{ | { |
throw PEGASUS_CIM_EXCEPTION( |
_throwCIMExceptionInvalidParameter("ModifiedClass"); |
CIM_ERR_INVALID_PARAMETER, "ModifiedClass"); |
|
} | } |
duplicateParameter = gotClass; | duplicateParameter = gotClass; |
gotClass = true; | gotClass = true; |
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotClass) |
_testRequiredParametersExist(gotClass); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMModifyClassRequestMessage> request( | AutoPtr<CIMModifyClassRequestMessage> request( |
new CIMModifyClassRequestMessage( | new CIMModifyClassRequestMessage( |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMName className; |
classNameIParam className("ClassName"); |
Boolean deepInheritance = false; |
booleanIParam deepInheritance("DeepInheritance"); |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; |
|
Boolean gotDeepInheritance = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ClassName") == 0) |
if(className.getOptional(parser, name, emptyTag)) |
{ | { |
// |
className.iParamFound(duplicateParameter); |
// ClassName may be NULL |
|
// |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, className, false); |
|
} | } |
duplicateParameter = gotClassName; |
else if(deepInheritance.get(parser, name, emptyTag)) |
gotClassName = true; |
|
} |
|
else if (System::strcasecmp(name, "DeepInheritance") == 0) |
|
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
deepInheritance.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, deepInheritance, true); |
|
duplicateParameter = gotDeepInheritance; |
|
gotDeepInheritance = true; |
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!emptyTag) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
if (duplicateParameter) |
// NOTE: className not required for this operation |
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
| |
AutoPtr<CIMEnumerateClassNamesRequestMessage> request( | AutoPtr<CIMEnumerateClassNamesRequestMessage> request( |
new CIMEnumerateClassNamesRequestMessage( | new CIMEnumerateClassNamesRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
className, |
className.value, |
deepInheritance, |
deepInheritance.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMName className; |
// EnumerateClasses Parameters |
Boolean deepInheritance = false; |
classNameIParam className("ClassName"); |
Boolean localOnly = true; |
booleanIParam deepInheritance("deepInheritance"); |
Boolean includeQualifiers = true; |
booleanIParam localOnly("localOnly",true); |
Boolean includeClassOrigin = false; |
booleanIParam includeQualifiers("IncludeQualifiers", true); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; |
|
Boolean gotDeepInheritance = false; |
|
Boolean gotLocalOnly = false; |
|
Boolean gotIncludeQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ClassName") == 0) |
if(className.getOptional(parser, name, emptyTag)) |
{ |
|
// |
|
// ClassName may be NULL |
|
// |
|
if (!emptyTag) |
|
{ | { |
XmlReader::getClassNameElement(parser, className, false); |
className.iParamFound(duplicateParameter); |
} |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} | } |
else if (System::strcasecmp(name, "DeepInheritance") == 0) |
else if(deepInheritance.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
deepInheritance.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, deepInheritance, true); |
|
duplicateParameter = gotDeepInheritance; |
|
gotDeepInheritance = true; |
|
} | } |
else if (System::strcasecmp(name, "LocalOnly") == 0) |
else if(localOnly.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
localOnly.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, localOnly, true); |
|
duplicateParameter = gotLocalOnly; |
|
gotLocalOnly = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeQualifiers") == 0) |
else if(includeQualifiers.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeQualifiers.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
|
duplicateParameter = gotIncludeQualifiers; |
|
gotIncludeQualifiers = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
else if(includeClassOrigin.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeClassOrigin.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!emptyTag) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
if (duplicateParameter) |
// NOTE: Class name not required for this enumerate. |
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
| |
AutoPtr<CIMEnumerateClassesRequestMessage> request( | AutoPtr<CIMEnumerateClassesRequestMessage> request( |
new CIMEnumerateClassesRequestMessage( | new CIMEnumerateClassesRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
className, |
className.value, |
deepInheritance, |
deepInheritance.value, |
localOnly, |
localOnly.value, |
includeQualifiers, |
includeQualifiers.value, |
includeClassOrigin, |
includeClassOrigin.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMName className; |
classNameIParam className("ClassName"); |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ClassName") == 0) |
if(className.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
className.iParamFound(duplicateParameter); |
XmlReader::getClassNameElement(parser, className); |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotClassName) |
_testRequiredParametersExist(className.got); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMDeleteClassRequestMessage> request( | AutoPtr<CIMDeleteClassRequestMessage> request( |
new CIMDeleteClassRequestMessage( | new CIMDeleteClassRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
className, |
className.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMInstance newInstance; | CIMInstance newInstance; |
Boolean duplicateParameter = false; |
|
Boolean gotInstance = false; | Boolean gotInstance = false; |
|
|
Boolean emptyTag; | Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!emptyTag) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
if (duplicateParameter) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} |
|
| |
if (!gotInstance) |
_testRequiredParametersExist(gotInstance); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMCreateInstanceRequestMessage> request( | AutoPtr<CIMCreateInstanceRequestMessage> request( |
new CIMCreateInstanceRequestMessage( | new CIMCreateInstanceRequestMessage( |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath instanceName; |
instanceNameIParam instanceName; |
Boolean includeQualifiers = false; |
// This attribute is accepted for compatibility reasons, but is |
Boolean includeClassOrigin = false; |
// not honored because it is deprecated. |
CIMPropertyList propertyList; |
booleanIParam localOnly("localOnly",true); |
|
booleanIParam includeQualifiers("IncludeQualifiers"); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotInstanceName = false; |
|
Boolean gotLocalOnly = false; |
|
Boolean gotIncludeQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "InstanceName") == 0) |
if(instanceName.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
instanceName.iParamFound(duplicateParameter); |
XmlReader::getInstanceNameElement(parser, instanceName); |
|
duplicateParameter = gotInstanceName; |
|
gotInstanceName = true; |
|
} | } |
else if (System::strcasecmp(name, "LocalOnly") == 0) |
// localOnly is accepted for compatibility reasons, but is |
{ |
|
// This attribute is accepted for compatibility reasons, but is |
|
// not honored because it is deprecated. | // not honored because it is deprecated. |
Boolean localOnly; |
else if(localOnly.get(parser, name, emptyTag)) |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, localOnly, true); |
|
duplicateParameter = gotLocalOnly; |
|
gotLocalOnly = true; |
|
} |
|
else if (System::strcasecmp(name, "IncludeQualifiers") == 0) |
|
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
localOnly.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
|
duplicateParameter = gotIncludeQualifiers; |
|
gotIncludeQualifiers = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
else if(includeQualifiers.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeQualifiers.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} | } |
else if (System::strcasecmp(name, "PropertyList") == 0) |
else if(includeClassOrigin.get(parser, name, emptyTag)) |
{ |
|
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]); |
includeClassOrigin.iParamFound(duplicateParameter); |
} |
|
propertyList.set(cimNameArray); |
|
} |
|
} |
|
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} | } |
else |
else if(propertyList.get(parser, name, emptyTag)) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
propertyList.iParamFound(duplicateParameter); |
} | } |
|
else |
if (!emptyTag) |
|
{ | { |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotInstanceName) |
_testRequiredParametersExist(instanceName.got); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMGetInstanceRequestMessage> request( | AutoPtr<CIMGetInstanceRequestMessage> request( |
new CIMGetInstanceRequestMessage( | new CIMGetInstanceRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
instanceName, |
instanceName.value, |
#ifdef PEGASUS_DISABLE_INSTANCE_QUALIFIERS | #ifdef PEGASUS_DISABLE_INSTANCE_QUALIFIERS |
false, | false, |
#else | #else |
includeQualifiers, |
includeQualifiers.value, |
#endif | #endif |
includeClassOrigin, |
includeClassOrigin.value, |
propertyList, |
propertyList.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
|
|
CIMModifyInstanceRequestMessage* | CIMModifyInstanceRequestMessage* |
CIMOperationRequestDecoder::decodeModifyInstanceRequest( | CIMOperationRequestDecoder::decodeModifyInstanceRequest( |
Uint32 queueId, | Uint32 queueId, |
|
|
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMInstance modifiedInstance; | CIMInstance modifiedInstance; |
Boolean includeQualifiers = true; |
|
CIMPropertyList propertyList; |
|
Boolean duplicateParameter = false; |
|
Boolean gotInstance = false; | Boolean gotInstance = false; |
Boolean gotIncludeQualifiers = false; |
|
Boolean gotPropertyList = false; |
booleanIParam includeQualifiers("IncludeQualifiers", true); |
|
propertyListIParam propertyList; |
|
|
Boolean emptyTag; | Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
|
duplicateParameter = gotInstance; | duplicateParameter = gotInstance; |
gotInstance = true; | gotInstance = true; |
} | } |
else if (System::strcasecmp(name, "IncludeQualifiers") == 0) |
else if(includeQualifiers.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeQualifiers.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
|
duplicateParameter = gotIncludeQualifiers; |
|
gotIncludeQualifiers = true; |
|
} | } |
else if (System::strcasecmp(name, "PropertyList") == 0) |
else if(propertyList.getSpecial(parser, name, emptyTag)) |
{ |
|
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.iParamFound(duplicateParameter); |
} |
|
propertyList.set(cimNameArray); |
|
} |
|
} |
|
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
_checkMissingEndTagOrDuplicateParamValue( |
{ |
parser, duplicateParameter, emptyTag); |
throw PEGASUS_CIM_EXCEPTION( |
|
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotInstance) |
_testRequiredParametersExist(gotInstance); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMModifyInstanceRequestMessage> request( | AutoPtr<CIMModifyInstanceRequestMessage> request( |
new CIMModifyInstanceRequestMessage( | new CIMModifyInstanceRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
modifiedInstance, | modifiedInstance, |
includeQualifiers, |
includeQualifiers.value, |
propertyList, |
propertyList.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMName className; |
// EnumerateInstance Parameters |
Boolean deepInheritance = true; |
classNameIParam className("ClassName"); |
Boolean includeQualifiers = false; |
booleanIParam deepInheritance("DeepInheritance", true); |
Boolean includeClassOrigin = false; |
// localOnly is accepted for compatibility reasons, but is |
CIMPropertyList propertyList; |
// not honored because it is deprecated. |
|
booleanIParam localOnly("localOnly", true); |
|
booleanIParam includeQualifiers("IncludeQualifiers"); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; |
|
Boolean gotDeepInheritance = false; |
|
Boolean gotLocalOnly = false; |
|
Boolean gotIncludeQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ClassName") == 0) |
if(className.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
className.iParamFound(duplicateParameter); |
XmlReader::getClassNameElement(parser, className, true); |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} | } |
else if (System::strcasecmp(name, "DeepInheritance") == 0) |
else if(deepInheritance.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
deepInheritance.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, deepInheritance, true); |
|
duplicateParameter = gotDeepInheritance; |
|
gotDeepInheritance = true; |
|
} | } |
else if (System::strcasecmp(name, "LocalOnly") == 0) |
|
{ |
|
// This attribute is accepted for compatibility reasons, but is | // This attribute is accepted for compatibility reasons, but is |
// not honored because it is deprecated. | // not honored because it is deprecated. |
Boolean localOnly; |
else if(localOnly.get(parser, name, emptyTag)) |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getBooleanValueElement(parser, localOnly, true); |
|
duplicateParameter = gotLocalOnly; |
|
gotLocalOnly = true; |
|
} |
|
else if (System::strcasecmp(name, "IncludeQualifiers") == 0) |
|
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
localOnly.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
|
duplicateParameter = gotIncludeQualifiers; |
|
gotIncludeQualifiers = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
else if(includeQualifiers.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
includeQualifiers.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} | } |
else if (System::strcasecmp(name, "PropertyList") == 0) |
else if(includeClassOrigin.get(parser, name, emptyTag)) |
{ | { |
if (!emptyTag) |
includeClassOrigin.iParamFound(duplicateParameter); |
{ |
|
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); |
|
} | } |
} |
else if(propertyList.get(parser, name, emptyTag)) |
duplicateParameter = gotPropertyList; |
|
gotPropertyList = true; |
|
} |
|
else |
|
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
propertyList.iParamFound(duplicateParameter); |
} | } |
|
else |
if (!emptyTag) |
|
{ | { |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotClassName) |
_testRequiredParametersExist(className.got); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMEnumerateInstancesRequestMessage> request( | AutoPtr<CIMEnumerateInstancesRequestMessage> request( |
new CIMEnumerateInstancesRequestMessage( | new CIMEnumerateInstancesRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
className, |
className.value, |
deepInheritance, |
deepInheritance.value, |
#ifdef PEGASUS_DISABLE_INSTANCE_QUALIFIERS | #ifdef PEGASUS_DISABLE_INSTANCE_QUALIFIERS |
false, | false, |
#else | #else |
includeQualifiers, |
includeQualifiers.value, |
#endif | #endif |
includeClassOrigin, |
includeClassOrigin.value, |
propertyList, |
propertyList.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMName className; |
classNameIParam className("ClassName"); |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotClassName = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ClassName") == 0) |
if(className.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
className.iParamFound(duplicateParameter); |
XmlReader::getClassNameElement(parser, className, true); |
|
duplicateParameter = gotClassName; |
|
gotClassName = true; |
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotClassName) |
_testRequiredParametersExist(className.got); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMEnumerateInstanceNamesRequestMessage> request( | AutoPtr<CIMEnumerateInstanceNamesRequestMessage> request( |
new CIMEnumerateInstanceNamesRequestMessage( | new CIMEnumerateInstanceNamesRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
className, |
className.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath instanceName; |
instanceNameIParam instanceName; |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotInstanceName = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "InstanceName") == 0) |
if(instanceName.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
instanceName.iParamFound(duplicateParameter); |
XmlReader::getInstanceNameElement(parser, instanceName); |
|
duplicateParameter = gotInstanceName; |
|
gotInstanceName = true; |
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotInstanceName) |
_testRequiredParametersExist(instanceName.got); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMDeleteInstanceRequestMessage> request( | AutoPtr<CIMDeleteInstanceRequestMessage> request( |
new CIMDeleteInstanceRequestMessage( | new CIMDeleteInstanceRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
instanceName, |
instanceName.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotQualifierDeclaration) |
_testRequiredParametersExist(gotQualifierDeclaration); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMSetQualifierRequestMessage> request( | AutoPtr<CIMSetQualifierRequestMessage> request( |
new CIMSetQualifierRequestMessage( | new CIMSetQualifierRequestMessage( |
|
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} |
|
|
|
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} | } |
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotQualifierName) |
_testRequiredParametersExist(gotQualifierName); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMGetQualifierRequestMessage> request( | AutoPtr<CIMGetQualifierRequestMessage> request( |
new CIMGetQualifierRequestMessage( | new CIMGetQualifierRequestMessage( |
|
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
// No IPARAMVALUEs are defined for this operation | // No IPARAMVALUEs are defined for this operation |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
AutoPtr<CIMEnumerateQualifiersRequestMessage> request( | AutoPtr<CIMEnumerateQualifiersRequestMessage> request( |
|
|
| |
String qualifierNameString; | String qualifierNameString; |
CIMName qualifierName; | CIMName qualifierName; |
Boolean duplicateParameter = false; |
|
Boolean gotQualifierName = false; | Boolean gotQualifierName = false; |
|
|
Boolean emptyTag; | Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!emptyTag) |
|
{ |
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
|
} |
|
| |
if (duplicateParameter) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION( |
parser, duplicateParameter, emptyTag); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
} | } |
| |
if (!gotQualifierName) |
_testRequiredParametersExist(gotQualifierName); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} |
|
| |
AutoPtr<CIMDeleteQualifierRequestMessage> request( | AutoPtr<CIMDeleteQualifierRequestMessage> request( |
new CIMDeleteQualifierRequestMessage( | new CIMDeleteQualifierRequestMessage( |
|
|
const CIMNamespaceName& nameSpace) | const CIMNamespaceName& nameSpace) |
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
|
objectNameIParam objectName; |
|
classNameIParam resultClass("ResultClass"); |
|
stringIParam role("role", false); |
| |
CIMObjectPath objectName; |
|
CIMName resultClass; |
|
String role; |
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotObjectName = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ObjectName") == 0) |
if(objectName.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
objectName.iParamFound(duplicateParameter); |
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} | } |
else if (System::strcasecmp(name, "ResultClass") == 0) |
else if (resultClass.getOptional(parser, name, emptyTag)) |
{ | { |
// |
resultClass.iParamFound(duplicateParameter); |
// ResultClass may be NULL |
} |
// |
else if(role.get(parser, name, emptyTag)) |
if (!emptyTag) |
{ |
|
role.iParamFound(duplicateParameter); |
|
} |
|
else |
{ | { |
XmlReader::getClassNameElement(parser, resultClass, false); |
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
} | } |
duplicateParameter = gotResultClass; |
|
gotResultClass = true; |
_testRequiredParametersExist(objectName.got); |
|
|
|
AutoPtr<CIMReferenceNamesRequestMessage> request( |
|
new CIMReferenceNamesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName.value, |
|
resultClass.value, |
|
role.value, |
|
QueueIdStack(queueId, _returnQueueId), |
|
objectName.isClassNameElement)); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
} | } |
else if (System::strcasecmp(name, "Role") == 0) |
|
|
CIMReferencesRequestMessage* |
|
CIMOperationRequestDecoder::decodeReferencesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
{ | { |
// |
STAT_GETSTARTTIME |
// Role may be NULL |
|
// |
objectNameIParam objectName; |
if (!emptyTag) |
classNameIParam resultClass("ResultClass"); |
|
stringIParam role("role", false); |
|
booleanIParam includeQualifiers("IncludeQualifiers"); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
XmlReader::getStringValueElement(parser, role, false); |
if(objectName.get(parser, name, emptyTag)) |
|
{ |
|
objectName.iParamFound(duplicateParameter); |
|
} |
|
else if(role.get(parser, name, emptyTag)) |
|
{ |
|
role.iParamFound(duplicateParameter); |
|
} |
|
else if (resultClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
resultClass.iParamFound(duplicateParameter); |
|
} |
|
else if(includeQualifiers.get(parser, name, emptyTag)) |
|
{ |
|
includeQualifiers.iParamFound(duplicateParameter); |
|
} |
|
else if(includeClassOrigin.get(parser, name, emptyTag)) |
|
{ |
|
includeClassOrigin.iParamFound(duplicateParameter); |
} | } |
duplicateParameter = gotRole; |
else if(propertyList.get(parser, name, emptyTag)) |
gotRole = true; |
{ |
|
propertyList.iParamFound(duplicateParameter); |
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!emptyTag) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
if (duplicateParameter) |
_testRequiredParametersExist(objectName.got); |
{ |
|
throw PEGASUS_CIM_EXCEPTION( |
AutoPtr<CIMReferencesRequestMessage> request( |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
new CIMReferencesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName.value, |
|
resultClass.value, |
|
role.value, |
|
includeQualifiers.value, |
|
includeClassOrigin.value, |
|
propertyList.value, |
|
QueueIdStack(queueId, _returnQueueId), |
|
objectName.isClassNameElement)); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
} | } |
|
|
|
CIMAssociatorNamesRequestMessage* |
|
CIMOperationRequestDecoder::decodeAssociatorNamesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
objectNameIParam objectName; |
|
classNameIParam assocClass("AssocClass"); |
|
classNameIParam resultClass("ResultClass"); |
|
stringIParam role("role", false); |
|
stringIParam resultRole("Resultrole", false); |
|
|
|
Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(objectName.get(parser, name, emptyTag)) |
|
{ |
|
objectName.iParamFound(duplicateParameter); |
|
} |
|
else if (assocClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
assocClass.iParamFound(duplicateParameter); |
|
} |
|
else if (resultClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
resultClass.iParamFound(duplicateParameter); |
|
} |
|
else if(role.get(parser, name, emptyTag)) |
|
{ |
|
role.iParamFound(duplicateParameter); |
|
} |
|
else if(resultRole.get(parser, name, emptyTag)) |
|
{ |
|
resultRole.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
|
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(objectName.got); |
|
|
|
AutoPtr<CIMAssociatorNamesRequestMessage> request( |
|
new CIMAssociatorNamesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName.value, |
|
assocClass.value, |
|
resultClass.value, |
|
role.value, |
|
resultRole.value, |
|
QueueIdStack(queueId, _returnQueueId), |
|
objectName.isClassNameElement)); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMAssociatorsRequestMessage* |
|
CIMOperationRequestDecoder::decodeAssociatorsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
// Associator Operation Parameters |
|
objectNameIParam objectName; |
|
classNameIParam assocClass("AssocClass"); |
|
classNameIParam resultClass("ResultClass"); |
|
stringIParam resultRole("Resultrole", false); |
|
stringIParam role("role", false); |
|
booleanIParam includeQualifiers("IncludeQualifiers"); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(objectName.get(parser, name, emptyTag)) |
|
{ |
|
objectName.iParamFound(duplicateParameter); |
|
} |
|
else if (assocClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
assocClass.iParamFound(duplicateParameter); |
|
} |
|
else if (resultClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
resultClass.iParamFound(duplicateParameter); |
|
} |
|
else if(role.get(parser, name, emptyTag)) |
|
{ |
|
role.iParamFound(duplicateParameter); |
|
} |
|
else if(resultRole.get(parser, name, emptyTag)) |
|
{ |
|
resultRole.iParamFound(duplicateParameter); |
|
} |
|
else if(includeQualifiers.get(parser, name, emptyTag)) |
|
{ |
|
includeQualifiers.iParamFound(duplicateParameter); |
|
} |
|
else if(includeClassOrigin.get(parser, name, emptyTag)) |
|
{ |
|
includeClassOrigin.iParamFound(duplicateParameter); |
|
} |
|
else if(propertyList.get(parser, name, emptyTag)) |
|
{ |
|
propertyList.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(objectName.got); |
|
|
|
AutoPtr<CIMAssociatorsRequestMessage> request( |
|
new CIMAssociatorsRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName.value, |
|
assocClass.value, |
|
resultClass.value, |
|
role.value, |
|
resultRole.value, |
|
includeQualifiers.value, |
|
includeClassOrigin.value, |
|
propertyList.value, |
|
QueueIdStack(queueId, _returnQueueId), |
|
objectName.isClassNameElement)); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMGetPropertyRequestMessage* |
|
CIMOperationRequestDecoder::decodeGetPropertyRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMObjectPath instanceName; |
|
String propertyName; |
|
Boolean duplicateParameter = false; |
|
Boolean gotInstanceName = false; |
|
Boolean gotPropertyName = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getInstanceNameElement(parser, instanceName); |
|
duplicateParameter = gotInstanceName; |
|
gotInstanceName = true; |
|
} |
|
else if (System::strcasecmp(name, "PropertyName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, propertyName, true); |
|
duplicateParameter = gotPropertyName; |
|
gotPropertyName = true; |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(gotInstanceName && gotPropertyName); |
|
|
|
AutoPtr<CIMGetPropertyRequestMessage> request( |
|
new CIMGetPropertyRequestMessage( |
|
messageId, |
|
nameSpace, |
|
instanceName, |
|
propertyName, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMSetPropertyRequestMessage* |
|
CIMOperationRequestDecoder::decodeSetPropertyRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMObjectPath instanceName; |
|
String propertyName; |
|
CIMValue propertyValue; |
|
Boolean duplicateParameter = false; |
|
Boolean gotInstanceName = false; |
|
Boolean gotPropertyName = false; |
|
Boolean gotNewValue = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if (System::strcasecmp(name, "InstanceName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getInstanceNameElement(parser, instanceName); |
|
duplicateParameter = gotInstanceName; |
|
gotInstanceName = true; |
|
} |
|
else if (System::strcasecmp(name, "PropertyName") == 0) |
|
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, propertyName, true); |
|
duplicateParameter = gotPropertyName; |
|
gotPropertyName = true; |
|
} |
|
else if (System::strcasecmp(name, "NewValue") == 0) |
|
{ |
|
if (emptyTag || !XmlReader::getPropertyValue(parser, propertyValue)) |
|
{ |
|
propertyValue.setNullValue(CIMTYPE_STRING, false); |
|
} |
|
duplicateParameter = gotNewValue; |
|
gotNewValue = true; |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(gotInstanceName && gotPropertyName); |
|
|
|
AutoPtr<CIMSetPropertyRequestMessage> request( |
|
new CIMSetPropertyRequestMessage( |
|
messageId, |
|
nameSpace, |
|
instanceName, |
|
propertyName, |
|
propertyValue, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMExecQueryRequestMessage* CIMOperationRequestDecoder::decodeExecQueryRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
// define execQuery parameters. Values are required parameters exist. |
|
stringIParam queryLanguage("QueryLanguage", true); |
|
stringIParam query("Query", true); |
|
|
|
Boolean emptyTag; |
|
Boolean duplicateParameter = false; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(queryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
queryLanguage.iParamFound(duplicateParameter); |
|
} |
|
else if(query.get(parser, name, emptyTag)) |
|
{ |
|
query.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue(parser, |
|
duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(queryLanguage.got && query.got); |
|
|
|
AutoPtr<CIMExecQueryRequestMessage> request( |
|
new CIMExecQueryRequestMessage( |
|
messageId, |
|
nameSpace, |
|
queryLanguage.value, |
|
query.value, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMInvokeMethodRequestMessage* |
|
CIMOperationRequestDecoder::decodeInvokeMethodRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMObjectPath& reference, |
|
const String& cimMethodName) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
CIMParamValue paramValue; |
|
Array<CIMParamValue> inParameters; |
|
|
|
while (XmlReader::getParamValueElement(parser, paramValue)) |
|
{ |
|
inParameters.append(paramValue); |
|
} |
|
|
|
AutoPtr<CIMInvokeMethodRequestMessage> request( |
|
new CIMInvokeMethodRequestMessage( |
|
messageId, |
|
reference.getNameSpace(), |
|
reference, |
|
cimMethodName, |
|
inParameters, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
// EXP_PULL_BEGIN |
|
CIMOpenEnumerateInstancesRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenEnumerateInstancesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
// EnumerateInstance Parameters |
|
classNameIParam className("ClassName"); |
|
booleanIParam deepInheritance("DeepInheritance", true); |
|
booleanIParam includeQualifiers("IncludeQualifiers"); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
//// TODO confirm the false here |
|
stringIParam filterQueryLanguage("FilterQueryLanguage",false); |
|
stringIParam filterQuery("FilterQuery", false); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
|
Boolean duplicateParameter = false; |
|
|
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(className.get(parser, name, emptyTag)) |
|
{ |
|
className.iParamFound(duplicateParameter); |
|
} |
|
else if(deepInheritance.get(parser, name, emptyTag)) |
|
{ |
|
deepInheritance.iParamFound(duplicateParameter); |
|
} |
|
else if(includeQualifiers.get(parser, name, emptyTag)) |
|
{ |
|
includeQualifiers.iParamFound(duplicateParameter); |
|
} |
|
else if(includeClassOrigin.get(parser, name, emptyTag)) |
|
{ |
|
includeClassOrigin.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQueryLanguage = NULL, |
|
else if(filterQueryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
filterQueryLanguage.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQuery = NULL, |
|
else if(filterQuery.get(parser, name, emptyTag)) |
|
{ |
|
filterQuery.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] Boolean ContinueOnError = false, |
|
else if (continueOnError.get(parser, name, emptyTag)) |
|
{ |
|
continueOnError.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
|
{ |
|
operationTimeout.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
|
{ |
|
maxObjectCount.iParamFound(duplicateParameter); |
|
} |
|
else if(propertyList.get(parser, name, emptyTag)) |
|
{ |
|
propertyList.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(name); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
|
|
} |
|
|
|
_testRequiredParametersExist(className.got); |
|
|
|
AutoPtr<CIMOpenEnumerateInstancesRequestMessage> request( |
|
new CIMOpenEnumerateInstancesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
className.value, |
|
deepInheritance.value, |
|
includeClassOrigin.value, |
|
propertyList.value, |
|
filterQueryLanguage.value, |
|
filterQuery.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
|
|
CIMOpenEnumerateInstancePathsRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenEnumerateInstancePathsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
// EnumerateInstance Parameters |
|
classNameIParam className("ClassName"); |
|
//// TODO confirm the false here |
|
stringIParam filterQueryLanguage("FilterQueryLanguage",false); |
|
stringIParam filterQuery("FilterQuery", false); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(className.get(parser, name, emptyTag)) |
|
{ |
|
className.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQueryLanguage = NULL, |
|
else if(filterQueryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
filterQueryLanguage.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQuery = NULL, |
|
else if(filterQuery.get(parser, name, emptyTag)) |
|
{ |
|
filterQuery.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] Boolean ContinueOnError = false, |
|
else if (continueOnError.get(parser, name, emptyTag)) |
|
{ |
|
continueOnError.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
|
{ |
|
operationTimeout.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
|
{ |
|
maxObjectCount.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(name); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
|
|
} |
|
|
|
_testRequiredParametersExist(className.got); |
|
|
|
AutoPtr<CIMOpenEnumerateInstancePathsRequestMessage> request( |
|
new CIMOpenEnumerateInstancePathsRequestMessage( |
|
messageId, |
|
nameSpace, |
|
className.value, |
|
filterQueryLanguage.value, |
|
filterQuery.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
CIMOpenReferenceInstancesRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenReferenceInstancesRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
objectNameIParam objectName("InstanceName"); |
|
classNameIParam resultClass("ResultClass"); |
|
stringIParam role("role", false); |
|
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
|
stringIParam filterQueryLanguage("FilterQueryLanguage",false); |
|
stringIParam filterQuery("FilterQuery", false); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean emptyTag; |
|
|
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(objectName.get(parser, name, emptyTag)) |
|
{ |
|
objectName.iParamFound(duplicateParameter); |
|
} |
|
else if(role.get(parser, name, emptyTag)) |
|
{ |
|
role.iParamFound(duplicateParameter); |
|
} |
|
else if (resultClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
resultClass.iParamFound(duplicateParameter); |
|
} |
|
else if(includeClassOrigin.get(parser, name, emptyTag)) |
|
{ |
|
includeClassOrigin.iParamFound(duplicateParameter); |
|
} |
|
else if(propertyList.get(parser, name, emptyTag)) |
|
{ |
|
propertyList.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQueryLanguage = NULL, |
|
else if(filterQueryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
filterQueryLanguage.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQuery = NULL, |
|
else if(filterQuery.get(parser, name, emptyTag)) |
|
{ |
|
filterQuery.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] Boolean ContinueOnError = false, |
|
else if (continueOnError.get(parser, name, emptyTag)) |
|
{ |
|
continueOnError.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
|
{ |
|
operationTimeout.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
|
{ |
|
maxObjectCount.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
|
} |
|
|
|
// generate exception if endtag error or duplicate attributes |
|
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(objectName.got); |
|
|
|
AutoPtr<CIMOpenReferenceInstancesRequestMessage> request( |
|
new CIMOpenReferenceInstancesRequestMessage( |
|
messageId, |
|
nameSpace, |
|
objectName.value, |
|
resultClass.value, |
|
role.value, |
|
includeClassOrigin.value, |
|
propertyList.value, |
|
filterQueryLanguage.value, |
|
filterQuery.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
|
QueueIdStack(queueId, _returnQueueId))); |
|
|
|
STAT_SERVERSTART |
|
|
|
return request.release(); |
|
} |
|
|
|
|
|
CIMOpenReferenceInstancePathsRequestMessage* |
|
CIMOperationRequestDecoder::decodeOpenReferenceInstancePathsRequest( |
|
Uint32 queueId, |
|
XmlParser& parser, |
|
const String& messageId, |
|
const CIMNamespaceName& nameSpace) |
|
{ |
|
STAT_GETSTARTTIME |
|
|
|
objectNameIParam objectName("InstanceName"); |
|
classNameIParam resultClass("ResultClass"); |
|
stringIParam role("role", false); |
|
|
|
stringIParam filterQueryLanguage("FilterQueryLanguage",false); |
|
stringIParam filterQuery("FilterQuery", false); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
|
{ |
|
if(objectName.get(parser, name, emptyTag)) |
|
{ |
|
objectName.iParamFound(duplicateParameter); |
|
} |
|
else if(role.get(parser, name, emptyTag)) |
|
{ |
|
role.iParamFound(duplicateParameter); |
|
} |
|
else if (resultClass.getOptional(parser, name, emptyTag)) |
|
{ |
|
resultClass.iParamFound(duplicateParameter); |
|
} |
|
else if(filterQueryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
filterQueryLanguage.iParamFound(duplicateParameter); |
|
} |
|
else if(filterQuery.get(parser, name, emptyTag)) |
|
{ |
|
filterQuery.iParamFound(duplicateParameter); |
|
} |
|
else if (continueOnError.get(parser, name, emptyTag)) |
|
{ |
|
continueOnError.iParamFound(duplicateParameter); |
|
} |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
|
{ |
|
operationTimeout.iParamFound(duplicateParameter); |
|
} |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
|
{ |
|
maxObjectCount.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!gotObjectName) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
AutoPtr<CIMReferenceNamesRequestMessage> request( |
_testRequiredParametersExist(objectName.got); |
new CIMReferenceNamesRequestMessage( |
|
|
AutoPtr<CIMOpenReferenceInstancePathsRequestMessage> request( |
|
new CIMOpenReferenceInstancePathsRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
objectName, |
objectName.value, |
resultClass, |
resultClass.value, |
role, |
role.value, |
|
filterQueryLanguage.value, |
|
filterQuery.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMReferencesRequestMessage* |
CIMOpenAssociatorInstancesRequestMessage* |
CIMOperationRequestDecoder::decodeReferencesRequest( |
CIMOperationRequestDecoder::decodeOpenAssociatorInstancesRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath objectName; |
objectNameIParam objectName("InstanceName"); |
CIMName resultClass; |
classNameIParam assocClass("AssocClass"); |
String role; |
classNameIParam resultClass("ResultClass"); |
Boolean includeQualifiers = false; |
stringIParam resultRole("Resultrole", false); |
Boolean includeClassOrigin = false; |
stringIParam role("role", false); |
CIMPropertyList propertyList; |
booleanIParam includeClassOrigin("IncludeClassOrigin"); |
|
propertyListIParam propertyList; |
|
|
|
stringIParam filterQueryLanguage("FilterQueryLanguage",false); |
|
stringIParam filterQuery("FilterQuery", false); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotObjectName = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotIncludeQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ObjectName") == 0) |
if(objectName.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
objectName.iParamFound(duplicateParameter); |
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} | } |
else if (System::strcasecmp(name, "ResultClass") == 0) |
else if (assocClass.getOptional(parser, name, emptyTag)) |
{ | { |
// |
assocClass.iParamFound(duplicateParameter); |
// ResultClass may be NULL |
|
// |
|
if (!emptyTag) |
|
{ |
|
XmlReader::getClassNameElement(parser, resultClass, false); |
|
} | } |
duplicateParameter = gotResultClass; |
else if (resultClass.getOptional(parser, name, emptyTag)) |
gotResultClass = true; |
|
} |
|
else if (System::strcasecmp(name, "Role") == 0) |
|
{ |
|
// |
|
// Role may be NULL |
|
// |
|
if (!emptyTag) |
|
{ | { |
XmlReader::getStringValueElement(parser, role, false); |
resultClass.iParamFound(duplicateParameter); |
} |
|
duplicateParameter = gotRole; |
|
gotRole = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeQualifiers") == 0) |
else if(role.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
role.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
|
duplicateParameter = gotIncludeQualifiers; |
|
gotIncludeQualifiers = true; |
|
} | } |
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
else if(resultRole.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
resultRole.iParamFound(duplicateParameter); |
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
|
duplicateParameter = gotIncludeClassOrigin; |
|
gotIncludeClassOrigin = true; |
|
} | } |
else if (System::strcasecmp(name, "PropertyList") == 0) |
else if(includeClassOrigin.get(parser, name, emptyTag)) |
{ |
|
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]); |
includeClassOrigin.iParamFound(duplicateParameter); |
} | } |
propertyList.set(cimNameArray); |
else if(propertyList.get(parser, name, emptyTag)) |
|
{ |
|
propertyList.iParamFound(duplicateParameter); |
} | } |
|
else if(filterQueryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
filterQueryLanguage.iParamFound(duplicateParameter); |
} | } |
duplicateParameter = gotPropertyList; |
else if(filterQuery.get(parser, name, emptyTag)) |
gotPropertyList = true; |
{ |
|
filterQuery.iParamFound(duplicateParameter); |
} | } |
else |
else if (continueOnError.get(parser, name, emptyTag)) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
continueOnError.iParamFound(duplicateParameter); |
} | } |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
if (!emptyTag) |
|
{ | { |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
operationTimeout.iParamFound(duplicateParameter); |
} | } |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
if (duplicateParameter) |
|
{ | { |
throw PEGASUS_CIM_EXCEPTION( |
maxObjectCount.iParamFound(duplicateParameter); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} | } |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!gotObjectName) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
AutoPtr<CIMReferencesRequestMessage> request( |
_testRequiredParametersExist(objectName.got); |
new CIMReferencesRequestMessage( |
|
|
AutoPtr<CIMOpenAssociatorInstancesRequestMessage> request( |
|
new CIMOpenAssociatorInstancesRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
objectName, |
objectName.value, |
resultClass, |
assocClass.value, |
role, |
resultClass.value, |
includeQualifiers, |
role.value, |
includeClassOrigin, |
resultRole.value, |
propertyList, |
includeClassOrigin.value, |
|
propertyList.value, |
|
filterQueryLanguage.value, |
|
filterQuery.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMAssociatorNamesRequestMessage* |
CIMOpenAssociatorInstancePathsRequestMessage* |
CIMOperationRequestDecoder::decodeAssociatorNamesRequest( |
CIMOperationRequestDecoder::decodeOpenAssociatorInstancePathsRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath objectName; |
objectNameIParam objectName("InstanceName"); |
CIMName assocClass; |
classNameIParam assocClass("AssocClass"); |
CIMName resultClass; |
classNameIParam resultClass("ResultClass"); |
String role; |
stringIParam resultRole("Resultrole", false); |
String resultRole; |
stringIParam role("role", false); |
|
|
|
stringIParam filterQueryLanguage("FilterQueryLanguage",false); |
|
stringIParam filterQuery("FilterQuery", false); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotObjectName = false; |
|
Boolean gotAssocClass = false; |
|
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotResultRole = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ObjectName") == 0) |
if(objectName.get(parser, name, emptyTag)) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
objectName.iParamFound(duplicateParameter); |
XmlReader::getObjectNameElement(parser, objectName); |
|
duplicateParameter = gotObjectName; |
|
gotObjectName = true; |
|
} | } |
else if (System::strcasecmp(name, "AssocClass") == 0) |
else if (assocClass.getOptional(parser, name, emptyTag)) |
{ |
|
// |
|
// AssocClass may be NULL |
|
// |
|
if (!emptyTag) |
|
{ | { |
XmlReader::getClassNameElement(parser, assocClass, false); |
assocClass.iParamFound(duplicateParameter); |
} |
|
duplicateParameter = gotAssocClass; |
|
gotAssocClass = true; |
|
} | } |
else if (System::strcasecmp(name, "ResultClass") == 0) |
else if (resultClass.getOptional(parser, name, emptyTag)) |
{ |
|
// |
|
// ResultClass may be NULL |
|
// |
|
if (!emptyTag) |
|
{ | { |
XmlReader::getClassNameElement(parser, resultClass, false); |
resultClass.iParamFound(duplicateParameter); |
} | } |
duplicateParameter = gotResultClass; |
else if(role.get(parser, name, emptyTag)) |
gotResultClass = true; |
|
} |
|
else if (System::strcasecmp(name, "Role") == 0) |
|
{ |
|
// |
|
// Role may be NULL |
|
// |
|
if (!emptyTag) |
|
{ | { |
XmlReader::getStringValueElement(parser, role, false); |
role.iParamFound(duplicateParameter); |
} |
|
duplicateParameter = gotRole; |
|
gotRole = true; |
|
} | } |
else if (System::strcasecmp(name, "ResultRole") == 0) |
else if(resultRole.get(parser, name, emptyTag)) |
{ | { |
// |
resultRole.iParamFound(duplicateParameter); |
// ResultRole may be NULL |
} |
// |
else if(filterQueryLanguage.get(parser, name, emptyTag)) |
if (!emptyTag) |
|
{ | { |
XmlReader::getStringValueElement(parser, resultRole, false); |
filterQueryLanguage.iParamFound(duplicateParameter); |
} | } |
duplicateParameter = gotResultRole; |
else if(filterQuery.get(parser, name, emptyTag)) |
gotResultRole = true; |
{ |
|
filterQuery.iParamFound(duplicateParameter); |
} | } |
else |
else if (continueOnError.get(parser, name, emptyTag)) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
continueOnError.iParamFound(duplicateParameter); |
} | } |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
if (!emptyTag) |
|
{ | { |
XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
operationTimeout.iParamFound(duplicateParameter); |
} | } |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
if (duplicateParameter) |
|
{ | { |
throw PEGASUS_CIM_EXCEPTION( |
maxObjectCount.iParamFound(duplicateParameter); |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
|
} | } |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(); |
} | } |
| |
if (!gotObjectName) |
// generate exception if endtag error or duplicate attributes |
{ |
_checkMissingEndTagOrDuplicateParamValue( |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
parser, duplicateParameter, emptyTag); |
} | } |
| |
AutoPtr<CIMAssociatorNamesRequestMessage> request( |
_testRequiredParametersExist(objectName.got); |
new CIMAssociatorNamesRequestMessage( |
|
|
AutoPtr<CIMOpenAssociatorInstancePathsRequestMessage> request( |
|
new CIMOpenAssociatorInstancePathsRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
objectName, |
objectName.value, |
assocClass, |
assocClass.value, |
resultClass, |
resultClass.value, |
role, |
role.value, |
resultRole, |
resultRole.value, |
|
filterQueryLanguage.value, |
|
filterQuery.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMAssociatorsRequestMessage* |
CIMPullInstancesWithPathRequestMessage* |
CIMOperationRequestDecoder::decodeAssociatorsRequest( |
CIMOperationRequestDecoder::decodePullInstancesWithPathRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath objectName; |
String enumerationContext = String::EMPTY; |
CIMName assocClass; |
Uint32 maxObjectCount = 0; |
CIMName resultClass; |
|
String role; |
|
String resultRole; |
|
Boolean includeQualifiers = false; |
|
Boolean includeClassOrigin = false; |
|
CIMPropertyList propertyList; |
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotObjectName = false; |
Boolean gotEnumerationContext = false; |
Boolean gotAssocClass = false; |
Boolean gotMaxObjectCount = false; |
Boolean gotResultClass = false; |
|
Boolean gotRole = false; |
|
Boolean gotResultRole = false; |
|
Boolean gotIncludeQualifiers = false; |
|
Boolean gotIncludeClassOrigin = false; |
|
Boolean gotPropertyList = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "ObjectName") == 0) |
if (System::strcasecmp(name, "EnumerationContext") == 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, "IncludeQualifiers") == 0) |
|
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
XmlReader::getBooleanValueElement(parser, includeQualifiers, true); |
XmlReader::getStringValueElement(parser, enumerationContext, true); |
duplicateParameter = gotIncludeQualifiers; |
duplicateParameter = gotEnumerationContext; |
gotIncludeQualifiers = true; |
gotEnumerationContext = true; |
} | } |
else if (System::strcasecmp(name, "IncludeClassOrigin") == 0) |
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
XmlReader::getBooleanValueElement(parser, includeClassOrigin, true); |
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
duplicateParameter = gotIncludeClassOrigin; |
duplicateParameter = gotMaxObjectCount; |
gotIncludeClassOrigin = true; |
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 | else |
{ | { |
|
|
| |
if (duplicateParameter) | if (duplicateParameter) |
{ | { |
|
|
throw PEGASUS_CIM_EXCEPTION( | throw PEGASUS_CIM_EXCEPTION( |
CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
CIM_ERR_INVALID_PARAMETER, "Duplicate IPARAM received"); |
} | } |
} | } |
| |
if (!gotObjectName) |
if (!gotEnumerationContext) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"EnumerationContext IPARAM required"); |
} | } |
| |
AutoPtr<CIMAssociatorsRequestMessage> request( |
if (!gotMaxObjectCount) |
new CIMAssociatorsRequestMessage( |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"MaxObjectCount IPARAM required"); |
|
} |
|
|
|
AutoPtr<CIMPullInstancesWithPathRequestMessage> request( |
|
new CIMPullInstancesWithPathRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
objectName, |
enumerationContext, |
assocClass, |
maxObjectCount, |
resultClass, |
|
role, |
|
resultRole, |
|
includeQualifiers, |
|
includeClassOrigin, |
|
propertyList, |
|
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMGetPropertyRequestMessage* |
CIMPullInstancePathsRequestMessage* |
CIMOperationRequestDecoder::decodeGetPropertyRequest( |
CIMOperationRequestDecoder::decodePullInstancePathsRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath instanceName; |
String enumerationContext = String::EMPTY; |
String propertyName; |
Uint32 maxObjectCount = 0; |
|
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotInstanceName = false; |
Boolean gotEnumerationContext = false; |
Boolean gotPropertyName = false; |
Boolean gotMaxObjectCount = false; |
|
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "InstanceName") == 0) |
if (System::strcasecmp(name, "EnumerationContext") == 0) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
XmlReader::getInstanceNameElement(parser, instanceName); |
XmlReader::getStringValueElement(parser, enumerationContext, true); |
duplicateParameter = gotInstanceName; |
duplicateParameter = gotEnumerationContext; |
gotInstanceName = true; |
gotEnumerationContext = true; |
} | } |
else if (System::strcasecmp(name, "PropertyName") == 0) |
|
|
else if (System::strcasecmp(name, "MaxObjectCount") == 0) |
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
XmlReader::getStringValueElement(parser, propertyName, true); |
XmlReader::getUint32ValueElement(parser, maxObjectCount, true); |
duplicateParameter = gotPropertyName; |
duplicateParameter = gotMaxObjectCount; |
gotPropertyName = true; |
gotMaxObjectCount = true; |
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
"Invalid IPARAMVALUE tag "); |
} | } |
| |
if (!emptyTag) | if (!emptyTag) |
|
|
} | } |
} | } |
| |
if (!gotInstanceName || !gotPropertyName) |
if (!gotEnumerationContext) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"EnumerationContext IPARAM required"); |
} | } |
| |
AutoPtr<CIMGetPropertyRequestMessage> request( |
if (!gotMaxObjectCount) |
new CIMGetPropertyRequestMessage( |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"MaxObjectCount IPARAM required"); |
|
} |
|
|
|
AutoPtr<CIMPullInstancePathsRequestMessage> request( |
|
new CIMPullInstancePathsRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
instanceName, |
enumerationContext, |
propertyName, |
maxObjectCount, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMSetPropertyRequestMessage* |
CIMCloseEnumerationRequestMessage* |
CIMOperationRequestDecoder::decodeSetPropertyRequest( |
CIMOperationRequestDecoder::decodeCloseEnumerationRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMObjectPath instanceName; |
String enumerationContext = String::EMPTY; |
String propertyName; |
|
CIMValue propertyValue; |
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotInstanceName = false; |
Boolean gotEnumerationContext = false; |
Boolean gotPropertyName = false; |
|
Boolean gotNewValue = false; |
|
Boolean emptyTag; |
|
| |
|
Boolean emptyTag; |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "InstanceName") == 0) |
if (System::strcasecmp(name, "EnumerationContext") == 0) |
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getInstanceNameElement(parser, instanceName); |
|
duplicateParameter = gotInstanceName; |
|
gotInstanceName = true; |
|
} |
|
else if (System::strcasecmp(name, "PropertyName") == 0) |
|
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
XmlReader::getStringValueElement(parser, propertyName, true); |
XmlReader::getStringValueElement(parser, enumerationContext, true); |
duplicateParameter = gotPropertyName; |
duplicateParameter = gotEnumerationContext; |
gotPropertyName = true; |
gotEnumerationContext = true; |
} |
|
else if (System::strcasecmp(name, "NewValue") == 0) |
|
{ |
|
if (emptyTag || !XmlReader::getPropertyValue(parser, propertyValue)) |
|
{ |
|
propertyValue.setNullValue(CIMTYPE_STRING, false); |
|
} |
|
duplicateParameter = gotNewValue; |
|
gotNewValue = true; |
|
} | } |
else | else |
{ | { |
|
|
XmlReader::expectEndTag(parser, "IPARAMVALUE"); | XmlReader::expectEndTag(parser, "IPARAMVALUE"); |
} | } |
| |
|
|
if (duplicateParameter) | if (duplicateParameter) |
{ | { |
throw PEGASUS_CIM_EXCEPTION( | throw PEGASUS_CIM_EXCEPTION( |
|
|
} | } |
} | } |
| |
if (!gotInstanceName || !gotPropertyName) |
if (!gotEnumerationContext) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"EnumerationContext IPARAM required"); |
} | } |
| |
AutoPtr<CIMSetPropertyRequestMessage> request( |
AutoPtr<CIMCloseEnumerationRequestMessage> request( |
new CIMSetPropertyRequestMessage( |
new CIMCloseEnumerationRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
instanceName, |
enumerationContext, |
propertyName, |
|
propertyValue, |
|
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMExecQueryRequestMessage* CIMOperationRequestDecoder::decodeExecQueryRequest( |
|
|
CIMEnumerationCountRequestMessage* |
|
CIMOperationRequestDecoder::decodeEnumerationCountRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
|
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
String queryLanguage; |
String enumerationContext = String::EMPTY; |
String query; |
|
Boolean duplicateParameter = false; | Boolean duplicateParameter = false; |
Boolean gotQueryLanguage = false; |
Boolean gotEnumerationContext = false; |
Boolean gotQuery = false; |
|
Boolean emptyTag; | Boolean emptyTag; |
| |
for (const char* name; | for (const char* name; |
XmlReader::getIParamValueTag(parser, name, emptyTag); ) | XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
if (System::strcasecmp(name, "QueryLanguage") == 0) |
if (System::strcasecmp(name, "EnumerationContext") == 0) |
{ |
|
XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
|
XmlReader::getStringValueElement(parser, queryLanguage, true); |
|
duplicateParameter = gotQueryLanguage; |
|
gotQueryLanguage = true; |
|
} |
|
else if (System::strcasecmp(name, "Query") == 0) |
|
{ | { |
XmlReader::rejectNullIParamValue(parser, emptyTag, name); | XmlReader::rejectNullIParamValue(parser, emptyTag, name); |
XmlReader::getStringValueElement(parser, query, true); |
XmlReader::getStringValueElement(parser, enumerationContext, true); |
duplicateParameter = gotQuery; |
duplicateParameter = gotEnumerationContext; |
gotQuery = true; |
gotEnumerationContext = true; |
} | } |
else | else |
{ | { |
|
|
} | } |
} | } |
| |
if (!gotQueryLanguage || !gotQuery) |
if (!gotEnumerationContext) |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, String::EMPTY); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, |
|
"Missing EnumerationContext Parameter"); |
} | } |
| |
AutoPtr<CIMExecQueryRequestMessage> request( |
|
new CIMExecQueryRequestMessage( |
AutoPtr<CIMEnumerationCountRequestMessage> request( |
|
new CIMEnumerationCountRequestMessage( |
messageId, | messageId, |
nameSpace, | nameSpace, |
queryLanguage, |
enumerationContext, |
query, |
|
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
|
|
return request.release(); | return request.release(); |
} | } |
| |
CIMInvokeMethodRequestMessage* |
CIMOpenQueryInstancesRequestMessage* |
CIMOperationRequestDecoder::decodeInvokeMethodRequest( |
CIMOperationRequestDecoder::decodeOpenQueryInstancesRequest( |
Uint32 queueId, | Uint32 queueId, |
XmlParser& parser, | XmlParser& parser, |
const String& messageId, | const String& messageId, |
const CIMObjectPath& reference, |
const CIMNamespaceName& nameSpace) |
const String& cimMethodName) |
|
{ | { |
STAT_GETSTARTTIME | STAT_GETSTARTTIME |
| |
CIMParamValue paramValue; |
stringIParam filterQueryLanguage("FilterQueryLanguage",true); |
Array<CIMParamValue> inParameters; |
stringIParam filterQuery("FilterQuery", true); |
| |
while (XmlReader::getParamValueElement(parser, paramValue)) |
booleanIParam returnQueryResultClass("ReturnQueryResultClass"); |
|
booleanIParam continueOnError("ContinueOnError"); |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
uint32IParam maxObjectCount("MaxObjectCount", 0); |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
uint32ArgIParam operationTimeout("OperationTimeout"); |
|
|
|
Boolean duplicateParameter = false; |
|
Boolean emptyTag; |
|
|
|
for (const char* name; |
|
XmlReader::getIParamValueTag(parser, name, emptyTag); ) |
{ | { |
inParameters.append(paramValue); |
// [IN,OPTIONAL,NULL] string FilterQueryLanguage = NULL, |
|
if(filterQueryLanguage.get(parser, name, emptyTag)) |
|
{ |
|
filterQueryLanguage.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] string FilterQuery = NULL, |
|
else if(filterQuery.get(parser, name, emptyTag)) |
|
{ |
|
filterQuery.iParamFound(duplicateParameter); |
|
} |
|
else if (returnQueryResultClass.get(parser, name, emptyTag)) |
|
{ |
|
returnQueryResultClass.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] Boolean ContinueOnError = false, |
|
else if (continueOnError.get(parser, name, emptyTag)) |
|
{ |
|
continueOnError.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL,NULL] uint32 OperationTimeout = NULL, |
|
else if (operationTimeout.get(parser, name, emptyTag)) |
|
{ |
|
operationTimeout.iParamFound(duplicateParameter); |
|
} |
|
// [IN,OPTIONAL] uint32 MaxObjectCount = 0 |
|
else if (maxObjectCount.get(parser, name, emptyTag)) |
|
{ |
|
maxObjectCount.iParamFound(duplicateParameter); |
|
} |
|
else |
|
{ |
|
_throwCIMExceptionInvalidIParamName(name); |
} | } |
| |
AutoPtr<CIMInvokeMethodRequestMessage> request( |
// generate exception if endtag error or duplicate attributes |
new CIMInvokeMethodRequestMessage( |
_checkMissingEndTagOrDuplicateParamValue( |
|
parser, duplicateParameter, emptyTag); |
|
} |
|
|
|
_testRequiredParametersExist(filterQuery.got); |
|
_testRequiredParametersExist(filterQueryLanguage.got); |
|
|
|
AutoPtr<CIMOpenQueryInstancesRequestMessage> request( |
|
new CIMOpenQueryInstancesRequestMessage( |
messageId, | messageId, |
reference.getNameSpace(), |
nameSpace, |
reference, |
filterQuery.value, |
cimMethodName, |
filterQueryLanguage.value, |
inParameters, |
returnQueryResultClass.value, |
|
operationTimeout.value, |
|
continueOnError.value, |
|
maxObjectCount.value, |
QueueIdStack(queueId, _returnQueueId))); | QueueIdStack(queueId, _returnQueueId))); |
| |
STAT_SERVERSTART | STAT_SERVERSTART |
| |
return request.release(); | return request.release(); |
} | } |
|
//EXP_PULL_END |
| |
void CIMOperationRequestDecoder::setServerTerminating(Boolean flag) | void CIMOperationRequestDecoder::setServerTerminating(Boolean flag) |
{ | { |