version 1.6, 2004/10/25 18:26:00
|
version 1.9, 2005/03/23 17:58:02
|
|
|
//%2004//////////////////////////////////////////////////////////////////////// |
//%2005//////////////////////////////////////////////////////////////////////// |
// | // |
// 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. |
// | // |
// 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 | // 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) |
|
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: processing()"); |
|
// do nothing |
|
} |
|
| |
virtual void complete(void) |
virtual void processing(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: complete()"); |
|
| |
send(true); |
virtual void complete(void); |
} |
|
| |
// return the number of objects in this handler | // return the number of objects in this handler |
virtual Uint32 size() const { return 0; } |
virtual Uint32 size(void) const; |
| |
// clear any objects in this handler | // clear any objects in this handler |
virtual void clear() {} |
virtual void clear(void); |
| |
// l10n |
|
ContentLanguages getLanguages(void); | ContentLanguages getLanguages(void); |
| |
protected: | protected: |
// send (deliver) asynchronously with restrictions |
|
virtual void send(Boolean isComplete); | virtual void send(Boolean isComplete); |
| |
}; | }; |
|
|
class PEGASUS_PPM_LINKAGE SimpleInstanceResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler | class PEGASUS_PPM_LINKAGE SimpleInstanceResponseHandler : public SimpleResponseHandler, public InstanceResponseHandler |
{ | { |
public: | public: |
SimpleInstanceResponseHandler(void) |
SimpleInstanceResponseHandler(void); |
{ |
|
} |
|
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
virtual Uint32 size() const { return _objects.size(); } |
|
virtual void clear() { _objects.clear(); } |
|
| |
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; |
send(false); |
|
} |
|
| |
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); |
{ |
|
} |
|
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
virtual Uint32 size() const { return _objects.size(); } |
|
virtual void clear() { _objects.clear(); } |
|
| |
virtual void deliver(const CIMObjectPath & objectPath) |
virtual void complete(void); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
_objects.append(objectPath); |
|
send(false); |
|
} |
|
| |
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); |
{ |
|
} |
virtual void processing(void); |
|
|
|
virtual void complete(void); |
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
|
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
// NOTE: this is the total size (count) of ALL parameters! | // NOTE: this is the total size (count) of ALL parameters! |
virtual Uint32 size() const { return _objects.size(); } |
virtual Uint32 size(void) const; |
virtual void clear() { _objects.clear(); _returnValue.clear(); } |
|
| |
virtual void deliverParamValue(const CIMParamValue & outParamValue) |
virtual void clear(void); |
{ |
|
_objects.append(outParamValue); |
|
// async delivers not yet supported for parameters |
|
//send(false); |
|
} |
|
| |
virtual void deliverParamValue(const Array<CIMParamValue> & outParamValues) |
virtual void deliverParamValue(const CIMParamValue & outParamValue); |
{ |
|
// 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 deliverParamValue(const Array<CIMParamValue> & outParamValues); |
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"SimpleResponseHandler: deliver()"); |
|
_returnValue = returnValue; |
|
send(false); |
|
} |
|
| |
const Array<CIMParamValue> getParamValues(void) const |
virtual void deliver(const CIMValue & returnValue); |
{ |
|
return _objects; |
|
} |
|
| |
const CIMValue getReturnValue(void) const |
const Array<CIMParamValue> getParamValues(void) const; |
{ |
|
return _returnValue; |
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); |
{ |
|
} |
|
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
virtual Uint32 size() const { return _objects.size(); } |
|
virtual void clear() { _objects.clear(); } |
|
| |
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; |
send(false); |
|
} |
|
| |
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); |
{ |
|
} |
|
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
virtual Uint32 size() const { return _objects.size(); } |
|
virtual void clear() { _objects.clear(); } |
|
| |
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; |
send(false); |
|
} |
|
| |
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); |
{ |
|
} |
|
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
virtual Uint32 size() const { return _objects.size(); } |
|
virtual void clear() { _objects.clear(); } |
|
| |
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; |
// async delivers not yet supported |
|
//send(false); |
|
} |
|
| |
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); |
{ |
|
} |
|
| |
virtual void processing(void) { SimpleResponseHandler::processing(); } |
virtual void processing(void); |
virtual void complete(void) { SimpleResponseHandler::complete(); } |
|
virtual Uint32 size() const { return _objects.size(); } |
|
virtual void clear() { _objects.clear(); } |
|
| |
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; |
send(false); |
|
} |
|
| |
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; |