version 1.3.2.9, 2009/11/10 09:43:32
|
version 1.10, 2013/01/22 14:18:39
|
|
|
#include <Pegasus/Common/CIMBuffer.h> | #include <Pegasus/Common/CIMBuffer.h> |
#include <Pegasus/Common/SCMOClass.h> | #include <Pegasus/Common/SCMOClass.h> |
#include <Pegasus/Common/SCMOInstance.h> | #include <Pegasus/Common/SCMOInstance.h> |
#include <Pegasus/Common/SCMODump.h> |
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
|
|
RESP_OBJECTS = 4, | RESP_OBJECTS = 4, |
RESP_OBJECTPATHS =5 | RESP_OBJECTPATHS =5 |
}; | }; |
|
//includeClassOrigin & _includeQualifiers are set to true by default. |
|
//_propertyList is initialized to an empty propertylist to enable |
|
// sending all properties by default. |
|
CIMResponseData(ResponseDataContent content): |
|
_encoding(0),_dataType(content),_includeQualifiers(true), |
|
_includeClassOrigin(true),_propertyList(CIMPropertyList()) |
|
{ |
|
} |
|
|
|
CIMResponseData(const CIMResponseData & x): |
|
_encoding(x._encoding), |
|
_dataType(x._dataType), |
|
_referencesData(x._referencesData), |
|
_instanceData(x._instanceData), |
|
_hostsData(x._hostsData), |
|
_nameSpacesData(x._nameSpacesData), |
|
_binaryData(x._binaryData), |
|
_defaultNamespace(x._defaultNamespace), |
|
_defaultHostname(x._defaultHostname), |
|
_instanceNames(x._instanceNames), |
|
_instances(x._instances), |
|
_objects(x._objects), |
|
_scmoInstances(x._scmoInstances), |
|
_includeQualifiers(x._includeQualifiers), |
|
_includeClassOrigin(x._includeClassOrigin), |
|
_propertyList(x._propertyList) |
|
{ |
|
} |
| |
CIMResponseData(ResponseDataContent content):_encoding(0),_dataType(content) |
~CIMResponseData() |
{}; |
{ |
|
} |
| |
// C++ objects interface handling | // C++ objects interface handling |
| |
|
|
_instanceNames=x; | _instanceNames=x; |
_encoding |= RESP_ENC_CIM; | _encoding |= RESP_ENC_CIM; |
} | } |
void appendInstanceName(const CIMObjectPath& x) |
|
{ |
|
_instanceNames.append(x); |
|
_encoding |= RESP_ENC_CIM; |
|
} |
|
| |
// Instance handling | // Instance handling |
CIMInstance& getInstance(); | CIMInstance& getInstance(); |
|
|
_encoding |= RESP_ENC_SCMO; | _encoding |= RESP_ENC_SCMO; |
} | } |
| |
// Binary data is just a data stream |
|
Array<Uint8>& getBinary(); | Array<Uint8>& getBinary(); |
bool setBinary(CIMBuffer& in, bool hasLen=true); |
|
|
// Set the binary stream in the CIMBuffer into the CIMResponseData |
|
bool setBinary(CIMBuffer& in); |
|
|
|
// Set any data from the CIMBuffer remaining after the current CIMBuffer |
|
// position pointer into the CIMResponseData Object. |
|
bool setRemainingBinaryData(CIMBuffer& in); |
| |
// Xml data is unformatted, no need to differentiate between instance | // Xml data is unformatted, no need to differentiate between instance |
// instances and object paths or objects | // instances and object paths or objects |
|
|
// official Xml format(CIM over Http) used to communicate to clients | // official Xml format(CIM over Http) used to communicate to clients |
void encodeXmlResponse(Buffer& out); | void encodeXmlResponse(Buffer& out); |
| |
|
//This function is called from buildResponce to set CIMResponcedata |
|
//with respective values of IncludeQualifiers,IncludeClassOrigin and |
|
//propertyFilter. |
|
void setRequestProperties( |
|
const Boolean includeQualifiers, |
|
const Boolean includeClassOrigin, |
|
const CIMPropertyList& propertyList); |
|
|
|
void setPropertyList(const CIMPropertyList& propertyList) |
|
{ |
|
_propertyList = propertyList; |
|
} |
|
CIMPropertyList & getPropertyList() |
|
{ |
|
return _propertyList; |
|
} |
|
|
private: | private: |
| |
// helper functions to transform different formats into one-another | // helper functions to transform different formats into one-another |
|
|
SCMOInstance _getSCMOFromCIMObject(const CIMObject& cimObj); | SCMOInstance _getSCMOFromCIMObject(const CIMObject& cimObj); |
SCMOInstance _getSCMOFromCIMObjectPath(const CIMObjectPath& cimPath); | SCMOInstance _getSCMOFromCIMObjectPath(const CIMObjectPath& cimPath); |
SCMOClass* _getSCMOClass(const char* ns,const char* cls); | SCMOClass* _getSCMOClass(const char* ns,const char* cls); |
|
void _deserializeInstance(Uint32 idx,CIMInstance& cimInstance); |
|
void _deserializeObject(Uint32 idx,CIMObject& cimObject); |
|
Boolean _deserializeReference(Uint32 idx,CIMObjectPath& cimObjectPath); |
|
Boolean _deserializeInstanceName(Uint32 idx,CIMObjectPath& cimObjectPath); |
| |
// Bitflags in this integer will reflect what data representation types | // Bitflags in this integer will reflect what data representation types |
// are currently stored in this CIMResponseData object | // are currently stored in this CIMResponseData object |
|
|
Array<String> _hostsData; | Array<String> _hostsData; |
Array<CIMNamespaceName> _nameSpacesData; | Array<CIMNamespaceName> _nameSpacesData; |
| |
|
|
// For binary encoding. | // For binary encoding. |
Array<Uint8> _binaryData; | Array<Uint8> _binaryData; |
|
CIMNamespaceName _defaultNamespace; |
|
String _defaultHostname; |
| |
// Default C++ encoding | // Default C++ encoding |
Array<CIMObjectPath> _instanceNames; | Array<CIMObjectPath> _instanceNames; |
|
|
| |
// SCMO encoding | // SCMO encoding |
Array<SCMOInstance> _scmoInstances; | Array<SCMOInstance> _scmoInstances; |
|
Boolean _includeQualifiers; |
|
Boolean _includeClassOrigin; |
|
CIMPropertyList _propertyList; |
| |
}; | }; |
| |