version 1.5, 2004/10/17 20:40:01
|
version 1.11, 2006/01/30 16:18:01
|
|
|
//%2004//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development | // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. | // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
|
|
// IBM Corp.; EMC Corporation, The Open Group. | // IBM Corp.; EMC Corporation, The Open Group. |
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; | // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; |
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. | // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; VERITAS Software Corporation; The Open Group. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
// Author: Chip Vincent (cvincent@us.ibm.com) | // Author: Chip Vincent (cvincent@us.ibm.com) |
// | // |
// Modified By: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// Modified By: |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
// Dave Rosckes (rosckes@us.ibm.com) | // Dave Rosckes (rosckes@us.ibm.com) |
|
// Brian G. Campbell, EMC (campbell_brian@emc.com) - PEP140/phase2 |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
| |
#include <Pegasus/Common/Config.h> | #include <Pegasus/Common/Config.h> |
#include <Pegasus/Common/ResponseHandler.h> | #include <Pegasus/Common/ResponseHandler.h> |
#include <Pegasus/Common/Logger.h> |
|
| |
#include <Pegasus/ProviderManager2/Linkage.h> | #include <Pegasus/ProviderManager2/Linkage.h> |
| |
|
|
class PEGASUS_PPM_LINKAGE SimpleResponseHandler : virtual public ResponseHandler | class PEGASUS_PPM_LINKAGE SimpleResponseHandler : virtual public ResponseHandler |
{ | { |
public: | public: |
SimpleResponseHandler(void) |
SimpleResponseHandler(void); |
{ |
virtual ~SimpleResponseHandler(void); |
} |
|
| |
virtual ~SimpleResponseHandler(void) |
virtual void processing(void); |
{ |
|
} |
|
| |
virtual void processing(void) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: processing()"); |
|
// do nothing |
|
} |
|
| |
virtual void complete(void) |
// return the number of objects in this handler |
{ |
virtual Uint32 size(void) const; |
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: complete()"); |
|
| |
// do nothing |
// clear any objects in this handler |
} |
virtual void clear(void); |
| |
// l10n |
ContentLanguageList getLanguages(void); |
ContentLanguages getLanguages(void) |
|
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: getLanguages()"); |
|
| |
ContentLanguages langs; |
protected: |
try |
virtual void send(Boolean isComplete); |
{ |
|
// Try to get the ContentLanguages out of the OperationContext |
|
// in the base ResponseHandler. |
|
OperationContext context = getContext(); |
|
ContentLanguageListContainer cntr = context.get |
|
(ContentLanguageListContainer::NAME); |
|
langs = cntr.getLanguages(); |
|
} |
|
catch (const Exception &) |
|
{ |
|
// The content language container must not exist. |
|
// Return the empty ContentLanguages. |
|
} |
|
| |
return langs; |
|
} |
|
}; | }; |
| |
class PEGASUS_PPM_LINKAGE SimpleInstanceResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler | class PEGASUS_PPM_LINKAGE SimpleInstanceResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler |
{ | { |
public: | public: |
SimpleInstanceResponseHandler(void) |
SimpleInstanceResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliver(const CIMInstance & instance) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
| |
_objects.append(instance); |
virtual Uint32 size(void) const; |
} |
|
| |
virtual void deliver(const Array<CIMInstance> & instances) |
virtual void clear(void); |
{ |
|
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = instances.size(); i < n; i++) |
|
{ |
|
deliver(instances[i]); |
|
} |
|
} |
|
| |
const Array<CIMInstance> getObjects(void) const |
virtual void deliver(const CIMInstance & instance); |
{ |
|
return _objects; |
virtual void deliver(const Array<CIMInstance> & instances); |
} |
|
|
const Array<CIMInstance> getObjects(void) const; |
| |
private: | private: |
Array<CIMInstance> _objects; | Array<CIMInstance> _objects; |
|
|
class PEGASUS_PPM_LINKAGE SimpleObjectPathResponseHandler : public SimpleResponseHandler, public ObjectPathResponseHandler | class PEGASUS_PPM_LINKAGE SimpleObjectPathResponseHandler : public SimpleResponseHandler, public ObjectPathResponseHandler |
{ | { |
public: | public: |
SimpleObjectPathResponseHandler(void) |
SimpleObjectPathResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliver(const CIMObjectPath & objectPath) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
_objects.append(objectPath); |
|
} |
|
| |
virtual void deliver(const Array<CIMObjectPath> & objectPaths) |
virtual Uint32 size(void) const; |
{ |
|
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = objectPaths.size(); i < n; i++) |
|
{ |
|
deliver(objectPaths[i]); |
|
} |
|
} |
|
| |
const Array<CIMObjectPath> getObjects(void) const |
virtual void clear(void); |
{ |
|
return _objects; |
virtual void deliver(const CIMObjectPath & objectPath); |
} |
|
|
virtual void deliver(const Array<CIMObjectPath> & objectPaths); |
|
|
|
const Array<CIMObjectPath> getObjects(void) const; |
| |
private: | private: |
Array<CIMObjectPath> _objects; | Array<CIMObjectPath> _objects; |
|
|
class PEGASUS_PPM_LINKAGE SimpleMethodResultResponseHandler : public SimpleResponseHandler, public MethodResultResponseHandler | class PEGASUS_PPM_LINKAGE SimpleMethodResultResponseHandler : public SimpleResponseHandler, public MethodResultResponseHandler |
{ | { |
public: | public: |
SimpleMethodResultResponseHandler(void) |
SimpleMethodResultResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliverParamValue(const CIMParamValue & outParamValue) |
virtual void complete(void); |
{ |
|
_objects.append(outParamValue); |
|
} |
|
| |
virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) |
// NOTE: this is the total size (count) of ALL parameters! |
{ |
virtual Uint32 size(void) const; |
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = outParamValues.size(); i < n; i++) |
|
{ |
|
deliverParamValue(outParamValues[i]); |
|
} |
|
} |
|
| |
virtual void deliver(const CIMValue & returnValue) |
virtual void clear(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
_returnValue = returnValue; |
|
} |
|
| |
const Array<CIMParamValue> getParamValues(void) const |
virtual void deliverParamValue(const CIMParamValue & outParamValue); |
{ |
|
return _objects; |
|
} |
|
| |
const CIMValue getReturnValue(void) const |
virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues); |
{ |
|
return _returnValue; |
virtual void deliver(const CIMValue & returnValue); |
} |
|
|
const Array<CIMParamValue> getParamValues(void) const; |
|
|
|
const CIMValue getReturnValue(void) const; |
| |
private: | private: |
Array<CIMParamValue> _objects; | Array<CIMParamValue> _objects; |
|
|
class PEGASUS_PPM_LINKAGE SimpleIndicationResponseHandler : public SimpleResponseHandler, public IndicationResponseHandler | class PEGASUS_PPM_LINKAGE SimpleIndicationResponseHandler : public SimpleResponseHandler, public IndicationResponseHandler |
{ | { |
public: | public: |
SimpleIndicationResponseHandler(void) |
SimpleIndicationResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliver(const CIMIndication & indication) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
| |
_objects.append(indication); |
virtual Uint32 size(void) const; |
} |
|
| |
virtual void deliver(const Array<CIMIndication> & indications) |
virtual void clear(void); |
{ |
|
// call deliver for each object in the array |
virtual void deliver(const CIMIndication & indication); |
for(Uint32 i = 0, n = indications.size(); i < n; i++) |
|
{ |
virtual void deliver(const Array<CIMIndication> & indications); |
deliver(indications[i]); |
|
} |
|
} |
|
| |
virtual void deliver( | virtual void deliver( |
const OperationContext & context, | const OperationContext & context, |
const CIMIndication & indication) |
const CIMIndication & indication); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
|
|
_objects.append(indication); |
|
} |
|
| |
virtual void deliver( | virtual void deliver( |
const OperationContext & context, | const OperationContext & context, |
const Array<CIMIndication> & indications) |
const Array<CIMIndication> & indications); |
{ |
|
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = indications.size(); i < n; i++) |
|
{ |
|
deliver(indications[i]); |
|
} |
|
} |
|
| |
const Array<CIMIndication> getObjects(void) const |
const Array<CIMIndication> getObjects(void) const; |
{ |
|
return _objects; |
|
} |
|
| |
|
// ATTN: why is this variable public? |
CIMInstance _provider; | CIMInstance _provider; |
| |
private: | private: |
|
|
class PEGASUS_PPM_LINKAGE SimpleObjectResponseHandler : public SimpleResponseHandler, public ObjectResponseHandler | class PEGASUS_PPM_LINKAGE SimpleObjectResponseHandler : public SimpleResponseHandler, public ObjectResponseHandler |
{ | { |
public: | public: |
SimpleObjectResponseHandler(void) |
SimpleObjectResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliver(const CIMObject & object) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
| |
_objects.append(object); |
virtual Uint32 size(void) const; |
} |
|
| |
virtual void deliver(const Array<CIMObject> & objects) |
virtual void clear(void); |
{ |
|
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = objects.size(); i < n; i++) |
|
{ |
|
deliver(objects[i]); |
|
} |
|
} |
|
| |
const Array<CIMObject> getObjects(void) const |
virtual void deliver(const CIMObject & object); |
{ |
|
return _objects; |
virtual void deliver(const Array<CIMObject> & objects); |
} |
|
|
const Array<CIMObject> getObjects(void) const; |
| |
private: | private: |
Array<CIMObject> _objects; | Array<CIMObject> _objects; |
|
|
class PEGASUS_PPM_LINKAGE SimpleInstance2ObjectResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler | class PEGASUS_PPM_LINKAGE SimpleInstance2ObjectResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler |
{ | { |
public: | public: |
SimpleInstance2ObjectResponseHandler(void) |
SimpleInstance2ObjectResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliver(const CIMInstance & object) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
| |
_objects.append(CIMObject(object)); |
virtual Uint32 size(void) const; |
} |
|
| |
virtual void deliver(const Array<CIMInstance> & objects) |
virtual void clear(void); |
{ |
|
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = objects.size(); i < n; i++) |
|
{ |
|
deliver(objects[i]); |
|
} |
|
} |
|
| |
const Array<CIMObject> getObjects(void) const |
virtual void deliver(const CIMInstance & object); |
{ |
|
return _objects; |
virtual void deliver(const Array<CIMInstance> & objects); |
} |
|
|
const Array<CIMObject> getObjects(void) const; |
| |
private: | private: |
Array<CIMObject> _objects; | Array<CIMObject> _objects; |
|
|
class PEGASUS_PPM_LINKAGE SimpleValueResponseHandler : public SimpleResponseHandler, public ValueResponseHandler | class PEGASUS_PPM_LINKAGE SimpleValueResponseHandler : public SimpleResponseHandler, public ValueResponseHandler |
{ | { |
public: | public: |
SimpleValueResponseHandler(void) |
SimpleValueResponseHandler(void); |
{ |
|
} |
|
| |
void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
void complete(void) { SimpleResponseHandler::complete(); } |
|
| |
virtual void deliver(const CIMValue & value) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
| |
_objects.append(value); |
virtual Uint32 size(void) const; |
} |
|
| |
virtual void deliver(const Array<CIMValue> & values) |
virtual void clear(void); |
{ |
|
// call deliver for each object in the array |
|
for(Uint32 i = 0, n = values.size(); i < n; i++) |
|
{ |
|
deliver(values[i]); |
|
} |
|
} |
|
| |
const Array<CIMValue> getObjects(void) const |
virtual void deliver(const CIMValue & value); |
{ |
|
return _objects; |
virtual void deliver(const Array<CIMValue> & values); |
} |
|
|
const Array<CIMValue> getObjects(void) const; |
| |
private: | private: |
Array<CIMValue> _objects; | Array<CIMValue> _objects; |