version 1.4, 2002/04/20 21:15:26
|
version 1.37, 2002/09/19 16:17:36
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001 The Open group, BMC Software, Tivoli Systems, IBM |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
|
// The Open Group, Tivoli Systems |
// | // |
// 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 |
|
|
// Modified By: Chip Vincent (cvincent@us.ibm.com) | // Modified By: Chip Vincent (cvincent@us.ibm.com) |
// Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) | // Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) | // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#include <Pegasus/Common/PegasusVersion.h> |
|
|
|
#include "ProviderRegistrationProvider.h" | #include "ProviderRegistrationProvider.h" |
| |
PEGASUS_NAMESPACE_BEGIN |
#include <Pegasus/Common/PegasusVersion.h> |
|
#include <Pegasus/Common/XmlWriter.h> |
/** |
#include <Pegasus/Common/Constants.h> |
The name of the PG_Provider class |
#include <Pegasus/Common/CIMMessage.h> |
*/ |
#include <Pegasus/Common/OperationContext.h> |
static const char _CLASS_PG_PROVIDER [] = "PG_Provider"; |
#include <Pegasus/Common/System.h> |
|
|
/** |
|
The name of the provider capabilities class |
|
*/ |
|
static const char _CLASS_PROVIDER_CAPABILITIES [] = "PG_ProviderCapabilities"; |
|
| |
/** |
PEGASUS_NAMESPACE_BEGIN |
The name of the provider module class |
|
*/ |
|
static const char _CLASS_PROVIDER_MODULE [] = "PG_ProviderModule"; |
|
| |
/** | /** |
The name of the operational status property | The name of the operational status property |
*/ | */ |
static const char _PROPERTY_OPERATIONALSTATUS [] = "OperationalStatus"; |
static const CIMName _PROPERTY_OPERATIONALSTATUS = |
|
CIMName ("OperationalStatus"); |
| |
/** | /** |
The name of the name property for PG_Provider class | The name of the name property for PG_Provider class |
*/ | */ |
static const char _PROPERTY_PROVIDER_NAME [] = "Name"; |
static const CIMName _PROPERTY_PROVIDER_NAME = CIMName ("Name"); |
| |
/** | /** |
The name of the Name property for PG_ProviderModule class | The name of the Name property for PG_ProviderModule class |
*/ | */ |
static const char _PROPERTY_PROVIDERMODULE_NAME [] = "Name"; |
static const CIMName _PROPERTY_PROVIDERMODULE_NAME = CIMName ("Name"); |
|
|
|
/** |
|
The name of the Vendor property for PG_ProviderModule class |
|
*/ |
|
static const CIMName _PROPERTY_VENDOR = CIMName ("Vendor"); |
| |
/** | /** |
The name of the Version property for PG_ProviderModule class | The name of the Version property for PG_ProviderModule class |
*/ | */ |
static const char _PROPERTY_VERSION [] = "Version"; |
static const CIMName _PROPERTY_VERSION = CIMName ("Version"); |
| |
/** | /** |
The name of the interface type property for PG_ProviderModule class | The name of the interface type property for PG_ProviderModule class |
*/ | */ |
static const char _PROPERTY_INTERFACETYPE [] = "InterfaceType"; |
static const CIMName _PROPERTY_INTERFACETYPE = CIMName ("InterfaceType"); |
| |
/** | /** |
The name of the interface version property for PG_ProviderModule class | The name of the interface version property for PG_ProviderModule class |
*/ | */ |
static const char _PROPERTY_INTERFACEVERSION [] = "InterfaceVersion"; |
static const CIMName _PROPERTY_INTERFACEVERSION = CIMName ("InterfaceVersion"); |
| |
/** | /** |
The name of the location property for PG_ProviderModule class | The name of the location property for PG_ProviderModule class |
*/ | */ |
static const char _PROPERTY_LOCATION [] = "Location"; |
static const CIMName _PROPERTY_LOCATION = CIMName ("Location"); |
| |
/** | /** |
The name of the CapabilityID property for provider capabilities class | The name of the CapabilityID property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_CAPABILITYID [] = "CapabilityID"; |
static const CIMName _PROPERTY_CAPABILITYID = CIMName ("CapabilityID"); |
| |
/** | /** |
The name of the provider module name property for provider capabilities class | The name of the provider module name property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_PROVIDERMODULENAME [] = "ProviderModuleName"; |
static const CIMName _PROPERTY_PROVIDERMODULENAME = |
|
CIMName ("ProviderModuleName"); |
| |
/** | /** |
The name of the provider name property for provider capabilities class | The name of the provider name property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_PROVIDERNAME [] = "ProviderName"; |
static const CIMName _PROPERTY_PROVIDERNAME = CIMName ("ProviderName"); |
| |
/** | /** |
The name of the classname property for provider capabilities class | The name of the classname property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_CLASSNAME [] = "ClassName"; |
static const CIMName _PROPERTY_CLASSNAME = CIMName ("ClassName"); |
| |
/** | /** |
The name of the Namespace property for provider capabilities class | The name of the Namespace property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_NAMESPACES [] = "Namespaces"; |
static const CIMName _PROPERTY_NAMESPACES = CIMName ("Namespaces"); |
| |
/** | /** |
The name of the provider type property for provider capabilities class | The name of the provider type property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_PROVIDERTYPE [] = "ProviderType"; |
static const CIMName _PROPERTY_PROVIDERTYPE = CIMName ("ProviderType"); |
| |
/** | /** |
The name of the supported properties property for provider capabilities class | The name of the supported properties property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_SUPPORTEDPROPERTIES [] = "SupportedProperties"; |
static const CIMName _PROPERTY_SUPPORTEDPROPERTIES = |
|
CIMName ("SupportedProperties"); |
| |
/** | /** |
The name of the supported methods property for provider capabilities class | The name of the supported methods property for provider capabilities class |
*/ | */ |
static const char _PROPERTY_SUPPORTEDMETHODS [] = "SupportedMethods"; |
static const CIMName _PROPERTY_SUPPORTEDMETHODS = CIMName ("SupportedMethods"); |
| |
/** | /** |
Registered instance provider type | Registered instance provider type |
|
|
/** | /** |
stopping provider method | stopping provider method |
*/ | */ |
static const char _STOP_PROVIDER[] = "Stop"; |
static const CIMName _STOP_PROVIDER = CIMName ("Stop"); |
| |
/** | /** |
starting provider method | starting provider method |
*/ | */ |
static const char _START_PROVIDER[] = "Start"; |
static const CIMName _START_PROVIDER = CIMName ("Start"); |
| |
/** | /** |
Provider status | Provider status |
*/ | */ |
static const Uint16 _PROVIDER_OK = 2; |
static const Uint16 _MODULE_OK = 2; |
|
|
|
static const Uint16 _MODULE_STOPPING = 9; |
| |
static const Uint16 _PROVIDER_STOPPED = 10; |
static const Uint16 _MODULE_STOPPED = 10; |
| |
ProviderRegistrationProvider::ProviderRegistrationProvider( | ProviderRegistrationProvider::ProviderRegistrationProvider( |
ProviderRegistrationManager * providerRegistrationManager) | ProviderRegistrationManager * providerRegistrationManager) |
|
:_id(peg_credential_types::PROVIDER) |
{ | { |
_providerRegistrationManager = providerRegistrationManager; | _providerRegistrationManager = providerRegistrationManager; |
|
|
|
_controller = &(ModuleController::get_client_handle(_id, &_client_handle)); |
|
if(_client_handle == NULL) |
|
throw UninitializedObjectException(); |
} | } |
| |
ProviderRegistrationProvider::~ProviderRegistrationProvider(void) | ProviderRegistrationProvider::~ProviderRegistrationProvider(void) |
{ | { |
|
if (_providerRegistrationManager) |
|
{ |
|
delete _providerRegistrationManager; |
|
} |
|
|
|
if (_client_handle) |
|
{ |
|
delete _client_handle; |
|
} |
|
|
} | } |
| |
void ProviderRegistrationProvider::initialize(CIMOMHandle & cimom) | void ProviderRegistrationProvider::initialize(CIMOMHandle & cimom) |
|
|
// get registered provider | // get registered provider |
void ProviderRegistrationProvider::getInstance( | void ProviderRegistrationProvider::getInstance( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & instanceReference, |
const CIMObjectPath & instanceReference, |
const Uint32 flags, |
const Boolean includeQualifiers, |
|
const Boolean includeClassOrigin, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
ResponseHandler<CIMInstance> & handler) |
InstanceResponseHandler & handler) |
{ | { |
| |
|
if(!instanceReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP)) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
instanceReference.getNameSpace().getString()); |
|
} |
|
|
// ensure the class existing in the specified namespace | // ensure the class existing in the specified namespace |
String className = instanceReference.getClassName(); |
CIMName className = instanceReference.getClassName(); |
| |
if(!String::equalNoCase(className, _CLASS_PG_PROVIDER) && |
if(!className.equal (PEGASUS_CLASSNAME_PROVIDER) && |
!String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES) && |
!className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES) && |
!String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
!className.equal (PEGASUS_CLASSNAME_PROVIDERMODULE)) |
{ | { |
throw CIMException(CIM_ERR_INVALID_CLASS); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
className.getString()); |
} | } |
| |
// begin processing the request | // begin processing the request |
|
|
// get all registered providers | // get all registered providers |
void ProviderRegistrationProvider::enumerateInstances( | void ProviderRegistrationProvider::enumerateInstances( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & classReference, |
const CIMObjectPath & classReference, |
const Uint32 flags, |
const Boolean includeQualifiers, |
|
const Boolean includeClassOrigin, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
ResponseHandler<CIMInstance> & handler) |
InstanceResponseHandler & handler) |
|
{ |
|
if(!classReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP)) |
{ | { |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
classReference.getNameSpace().getString()); |
|
} |
|
|
// ensure the class existing in the specified namespace | // ensure the class existing in the specified namespace |
String className = classReference.getClassName(); |
CIMName className = classReference.getClassName(); |
| |
if(!String::equalNoCase(className, _CLASS_PG_PROVIDER) && |
if(!className.equal (PEGASUS_CLASSNAME_PROVIDER) && |
!String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES) && |
!className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES) && |
!String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
!className.equal (PEGASUS_CLASSNAME_PROVIDERMODULE)) |
{ | { |
throw CIMException(CIM_ERR_INVALID_CLASS); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
className.getString()); |
} | } |
| |
// begin processing the request | // begin processing the request |
handler.processing(); | handler.processing(); |
| |
Array<CIMNamedInstance> enumInstances; |
Array<CIMInstance> enumInstances; |
| |
try | try |
{ | { |
|
|
throw (e); | throw (e); |
} | } |
| |
// ATTN: remove when CIMNamedInstance removed. |
handler.deliver(enumInstances); |
for(Uint32 i = 0, n = enumInstances.size(); i < n; i++) |
|
{ |
|
handler.deliver(enumInstances[i].getInstance()); |
|
} |
|
| |
// complete processing the request | // complete processing the request |
handler.complete(); | handler.complete(); |
|
|
// get all registered provider names | // get all registered provider names |
void ProviderRegistrationProvider::enumerateInstanceNames( | void ProviderRegistrationProvider::enumerateInstanceNames( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & classReference, |
const CIMObjectPath & classReference, |
ResponseHandler<CIMReference> & handler) |
ObjectPathResponseHandler & handler) |
|
{ |
|
if(!classReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP)) |
{ | { |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
classReference.getNameSpace().getString()); |
|
} |
|
|
// ensure the class existing in the specified namespace | // ensure the class existing in the specified namespace |
String className = classReference.getClassName(); |
CIMName className = classReference.getClassName(); |
| |
if(!String::equalNoCase(className, _CLASS_PG_PROVIDER) && |
if(!className.equal (PEGASUS_CLASSNAME_PROVIDER) && |
!String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES) && |
!className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES) && |
!String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
!className.equal (PEGASUS_CLASSNAME_PROVIDERMODULE)) |
{ | { |
throw CIMException(CIM_ERR_INVALID_CLASS); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
className.getString()); |
} | } |
| |
// begin processing the request | // begin processing the request |
handler.processing(); | handler.processing(); |
| |
Array<CIMReference> enumInstanceNames; |
Array<CIMObjectPath> enumInstanceNames; |
| |
// get all instance names from repository | // get all instance names from repository |
try | try |
|
|
// SupportedProperties, and property of SupportedMethods | // SupportedProperties, and property of SupportedMethods |
void ProviderRegistrationProvider::modifyInstance( | void ProviderRegistrationProvider::modifyInstance( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & instanceReference, |
const CIMObjectPath & instanceReference, |
const CIMInstance & instanceObject, | const CIMInstance & instanceObject, |
const Uint32 flags, |
const Boolean includeQualifiers, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
ResponseHandler<CIMInstance> & handler) |
ResponseHandler & handler) |
|
{ |
|
// get userName and only privileged user can execute this operation |
|
String userName; |
|
try |
|
{ |
|
IdentityContainer container = context.get(IdentityContainer::NAME); |
|
userName = container.getUserName(); |
|
} |
|
catch (...) |
|
{ |
|
userName = String::EMPTY; |
|
} |
|
|
|
if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName)) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, |
|
"You must have superuser privilege to modify the registration."); |
|
} |
|
|
|
if(!instanceReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP)) |
{ | { |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
instanceReference.getNameSpace().getString()); |
|
} |
|
|
// | // |
// only support to modify the instance of PG_ProviderCapabilities | // only support to modify the instance of PG_ProviderCapabilities |
// | // |
if (!String::equalNoCase(instanceReference.getClassName(), |
if (!instanceReference.getClassName().equal |
_CLASS_PROVIDER_CAPABILITIES)) |
(PEGASUS_CLASSNAME_PROVIDERCAPABILITIES)) |
{ | { |
throw CIMException (CIM_ERR_NOT_SUPPORTED); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
instanceReference.getClassName().getString()); |
} | } |
| |
// | // |
|
|
// | // |
if (propertyList.isNull()) | if (propertyList.isNull()) |
{ | { |
throw CIMException (CIM_ERR_NOT_SUPPORTED); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
"Only can modify Namespaces, SupportedProperties, and SupportedMethods."); |
} | } |
| |
Array<String> propertyArray = propertyList.getPropertyNameArray(); |
Array<CIMName> propertyArray = propertyList.getPropertyNameArray(); |
for (Uint32 i=0; i<propertyArray.size(); i++) | for (Uint32 i=0; i<propertyArray.size(); i++) |
{ | { |
if (!String::equalNoCase(propertyArray[i], _PROPERTY_NAMESPACES) && |
if (!propertyArray[i].equal (_PROPERTY_NAMESPACES) && |
!String::equalNoCase(propertyArray[i], _PROPERTY_SUPPORTEDPROPERTIES) && |
!propertyArray[i].equal (_PROPERTY_SUPPORTEDPROPERTIES) && |
!String::equalNoCase(propertyArray[i], _PROPERTY_SUPPORTEDMETHODS)) |
!propertyArray[i].equal (_PROPERTY_SUPPORTEDMETHODS)) |
{ | { |
throw CIMException (CIM_ERR_NOT_SUPPORTED); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
propertyArray[i].getString()); |
} | } |
} | } |
| |
|
|
try | try |
{ | { |
_providerRegistrationManager->modifyInstance(instanceReference, | _providerRegistrationManager->modifyInstance(instanceReference, |
instanceObject, flags, propertyArray); |
instanceObject, includeQualifiers, propertyArray); |
} | } |
catch(CIMException& e) | catch(CIMException& e) |
{ | { |
|
|
// register a provider | // register a provider |
void ProviderRegistrationProvider::createInstance( | void ProviderRegistrationProvider::createInstance( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & instanceReference, |
const CIMObjectPath & instanceReference, |
const CIMInstance & instanceObject, | const CIMInstance & instanceObject, |
ResponseHandler<CIMReference> & handler) |
ObjectPathResponseHandler & handler) |
|
{ |
|
// get userName and only privileged user can execute this operation |
|
String userName; |
|
try |
{ | { |
String className = instanceReference.getClassName(); |
IdentityContainer container = context.get(IdentityContainer::NAME); |
String nameSpace = instanceReference.getNameSpace(); |
userName = container.getUserName(); |
|
} |
|
catch (...) |
|
{ |
|
userName = String::EMPTY; |
|
} |
|
|
|
if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName)) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, |
|
"You must have superuser privilege to register providers."); |
|
} |
| |
CIMReference returnReference; |
CIMName className = instanceReference.getClassName(); |
|
CIMNamespaceName nameSpace = instanceReference.getNameSpace(); |
|
|
|
CIMObjectPath returnReference; |
| |
CIMInstance instance = instanceObject; | CIMInstance instance = instanceObject; |
| |
|
if(!nameSpace.equal (PEGASUS_NAMESPACENAME_INTEROP)) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
nameSpace.getString()); |
|
} |
|
|
// ensure the class existing in the specified namespace | // ensure the class existing in the specified namespace |
if(!String::equalNoCase(className, _CLASS_PG_PROVIDER) && |
if(!className.equal (PEGASUS_CLASSNAME_PROVIDER) && |
!String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES) && |
!className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES) && |
!String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
!className.equal (PEGASUS_CLASSNAME_PROVIDERMODULE)) |
{ | { |
throw CIMException(CIM_ERR_INVALID_CLASS); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
className.getString()); |
} | } |
| |
// | // |
// Check all required properties are set | // Check all required properties are set |
// | // |
if(String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
if (className.equal (PEGASUS_CLASSNAME_PROVIDERMODULE)) |
{ | { |
// | // |
// Name, Version, InterfaceType, InterfaceVersion, and Location | // Name, Version, InterfaceType, InterfaceVersion, and Location |
// properties must be set | // properties must be set |
// OperationalStatus property needs to be set. If not, set to default | // OperationalStatus property needs to be set. If not, set to default |
// | // |
if (!instanceObject.existsProperty(_PROPERTY_PROVIDERMODULE_NAME)) |
if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULE_NAME) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing Name which is required property in PG_ProviderModule class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_VERSION)) |
if (instanceObject.findProperty(_PROPERTY_VENDOR) == PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing Vendor which is required property in PG_ProviderModule class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_INTERFACETYPE)) |
if (instanceObject.findProperty(_PROPERTY_VERSION) == PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing Version which is required property in PG_ProviderModule class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_INTERFACEVERSION)) |
if (instanceObject.findProperty(_PROPERTY_INTERFACETYPE) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing InterfaceType which is required property in PG_ProviderModule class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_LOCATION)) |
if (instanceObject.findProperty(_PROPERTY_INTERFACEVERSION) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing InterfaceVersion which is required property in PG_ProviderModule class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_OPERATIONALSTATUS)) |
if (instanceObject.findProperty(_PROPERTY_LOCATION) == PEG_NOT_FOUND) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing Location which is required property in PG_ProviderModule class."); |
|
} |
|
|
|
if (instanceObject.findProperty(_PROPERTY_OPERATIONALSTATUS) == |
|
PEG_NOT_FOUND) |
{ | { |
Array<Uint16> _operationalStatus; | Array<Uint16> _operationalStatus; |
_operationalStatus.append(_PROVIDER_OK); |
_operationalStatus.append(_MODULE_OK); |
instance.addProperty (CIMProperty | instance.addProperty (CIMProperty |
(_PROPERTY_OPERATIONALSTATUS, _operationalStatus)); | (_PROPERTY_OPERATIONALSTATUS, _operationalStatus)); |
} | } |
} | } |
else if(String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES)) |
else if (className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES)) |
{ | { |
// | // |
// ProviderModuleName, ProviderName, InstanceID, ClassName, | // ProviderModuleName, ProviderName, InstanceID, ClassName, |
// Namespaces, and ProviderType properties must be set | // Namespaces, and ProviderType properties must be set |
// | // |
| |
if (!instanceObject.existsProperty(_PROPERTY_PROVIDERMODULENAME)) |
if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing ProviderModuleName which is required property in PG_ProviderCapabilities class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_PROVIDERNAME)) |
if (instanceObject.findProperty(_PROPERTY_PROVIDERNAME) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing ProviderName which is required property in PG_ProviderCapabilities class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_CAPABILITYID)) |
if (instanceObject.findProperty(_PROPERTY_CAPABILITYID) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing CapabilityID which is required property in PG_ProviderCapabilities class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_CLASSNAME)) |
if (instanceObject.findProperty(_PROPERTY_CLASSNAME) == PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing ClassName which is required property in PG_ProviderCapabilities class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_NAMESPACES)) |
if (instanceObject.findProperty(_PROPERTY_NAMESPACES) == PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing Namespaces which is required property in PG_ProviderCapabilities class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_PROVIDERTYPE)) |
if (instanceObject.findProperty(_PROPERTY_PROVIDERTYPE) == PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing ProviderType which is required property in PG_ProviderCapabilities class."); |
} | } |
} | } |
else // _CLASS_PG_PROVIDER |
else // PEGASUS_CLASSNAME_PROVIDER |
{ | { |
// | // |
// Name and ProviderModuleName properties must be set | // Name and ProviderModuleName properties must be set |
// | // |
if (!instanceObject.existsProperty(_PROPERTY_PROVIDER_NAME)) |
if (instanceObject.findProperty(_PROPERTY_PROVIDER_NAME) == PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing Name which is required property in PG_Provider class."); |
} | } |
| |
if (!instanceObject.existsProperty(_PROPERTY_PROVIDERMODULENAME)) |
if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) == |
|
PEG_NOT_FOUND) |
{ | { |
throw CIMException (CIM_ERR_INVALID_PARAMETER); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
"Missing ProviderModuleName which is required property in PG_Provider class."); |
} | } |
} | } |
| |
|
|
// Unregister a provider | // Unregister a provider |
void ProviderRegistrationProvider::deleteInstance( | void ProviderRegistrationProvider::deleteInstance( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & instanceReference, |
const CIMObjectPath & instanceReference, |
ResponseHandler<CIMInstance> & handler) |
ResponseHandler & handler) |
|
{ |
|
// get userName and only privileged user can execute this operation |
|
String userName; |
|
try |
|
{ |
|
IdentityContainer container = context.get(IdentityContainer::NAME); |
|
userName = container.getUserName(); |
|
} |
|
catch (...) |
|
{ |
|
userName = String::EMPTY; |
|
} |
|
|
|
if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName)) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, |
|
"You must have superuser privilege to unregister providers."); |
|
} |
|
|
|
if(!instanceReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP)) |
{ | { |
String className = instanceReference.getClassName(); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
instanceReference.getNameSpace().getString()); |
|
} |
|
|
|
CIMName className = instanceReference.getClassName(); |
| |
// ensure the class existing in the specified namespace | // ensure the class existing in the specified namespace |
if(!String::equalNoCase(className, _CLASS_PG_PROVIDER) && |
if(!className.equal (PEGASUS_CLASSNAME_PROVIDER) && |
!String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES) && |
!className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES) && |
!String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
!className.equal (PEGASUS_CLASSNAME_PROVIDERMODULE)) |
{ | { |
throw CIMException(CIM_ERR_INVALID_CLASS); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
className.getString()); |
} | } |
| |
// begin processing the request | // begin processing the request |
|
|
// Block a provider, unblock a provider, and stop a provider | // Block a provider, unblock a provider, and stop a provider |
void ProviderRegistrationProvider::invokeMethod( | void ProviderRegistrationProvider::invokeMethod( |
const OperationContext & context, | const OperationContext & context, |
const CIMReference & objectReference, |
const CIMObjectPath & objectReference, |
const String & methodName, |
const CIMName & methodName, |
const Array<CIMParamValue> & inParameters, | const Array<CIMParamValue> & inParameters, |
Array<CIMParamValue> & outParameters, |
MethodResultResponseHandler & handler) |
ResponseHandler<CIMValue> & handler) |
|
{ | { |
// ATTN-YZ-20020411: Add code to send message to provider manager to |
// get userName and only privileged user can execute this operation |
// execute the stop and start methods |
String userName; |
|
try |
throw CIMException (CIM_ERR_NOT_SUPPORTED); |
{ |
|
IdentityContainer container = context.get(IdentityContainer::NAME); |
|
userName = container.getUserName(); |
|
} |
|
catch (...) |
|
{ |
|
userName = String::EMPTY; |
|
} |
| |
/* ATTN-YZ-P1-20020301: Modify this function because schema is changed |
if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName)) |
String className = objectReference.getClassName(); |
{ |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED, |
|
"You must have superuser privilege to disable or enable providers."); |
|
} |
| |
// ensure the class existing in the specified namespace |
if(!objectReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP)) |
if(!String::equalNoCase(className, _CLASS_PG_PROVIDER) && |
|
!String::equalNoCase(className, _CLASS_PROVIDER_CAPABILITIES) && |
|
!String::equalNoCase(className, _CLASS_PROVIDER_MODULE)) |
|
{ | { |
throw CIMException(CIM_ERR_INVALID_CLASS); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
|
objectReference.getNameSpace().getString()); |
} | } |
| |
handler.processing(); |
String moduleName; |
Uint32 retValue; |
Boolean moduleFound = false; |
String providerName; |
|
| |
// get provider name from reference |
// get module name from reference |
Array<KeyBinding> keys = objectReference.getKeyBindings(); |
Array<CIMKeyBinding> keys = objectReference.getKeyBindings(); |
| |
Uint32 i; |
for(Uint32 i=0; i<keys.size() ; i++) |
for(i=0; i<keys.size() ; i++) |
|
{ | { |
if(String::equal(keys[i].getName(), "Name")) |
if(keys[i].getName().equal (_PROPERTY_PROVIDERMODULE_NAME)) |
{ | { |
providerName = keys[i].getValue(); |
moduleName = keys[i].getValue(); |
|
moduleFound = true; |
} | } |
} | } |
| |
// if Name key not found |
// if _PROPERTY_PROVIDERMODULE_NAME key not found |
if(i > keys.size()) |
if( !moduleFound) |
{ | { |
// ATTN: may need diff exception |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, | throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
"key Name was not found"); | "key Name was not found"); |
} | } |
| |
CIMReference newInstancereference("", "", |
// |
objectReference.getClassName(), |
// get module status |
objectReference.getKeyBindings()); |
// |
|
Array<Uint16> _OperationalStatus = |
|
_providerRegistrationManager->getProviderModuleStatus( moduleName); |
|
|
|
// get module instance |
|
CIMInstance mInstance = _providerRegistrationManager->getInstance(objectReference); |
|
|
|
handler.processing(); |
|
|
|
Sint16 ret_value; |
| |
if(String::equalNoCase(methodName, _STOP_PROVIDER)) |
if(methodName.equal(_STOP_PROVIDER)) |
|
{ |
|
for (Uint32 i = 0; i<_OperationalStatus.size(); i++) |
{ | { |
|
// retValue equals 1 if module is already disabled |
|
if (_OperationalStatus[i] == _MODULE_STOPPED || |
|
_OperationalStatus[i] == _MODULE_STOPPING) |
|
{ |
|
ret_value = 1; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
return; |
|
} |
|
} |
| |
Boolean force = false; |
CIMInstance instance; |
Uint32 timeoutValue = 0; |
Array<CIMInstance> instances; |
String forceStr = String::EMPTY; |
String _moduleName; |
String timeoutStr = String::EMPTY; |
|
| |
// Get the input parameter values |
// get all provider instances which have same module name as moduleName |
// |
CIMObjectPath providerRef(objectReference.getHost(), |
// ATTN: Currently the server only returns String values even |
objectReference.getNameSpace(), |
// though the types of the parameters are not defined |
PEGASUS_CLASSNAME_PROVIDER, |
// as String type. |
objectReference.getKeyBindings()); |
// |
Array<CIMInstance> namedInstances; |
for (Uint32 i = 0; i < inParameters.size(); i++) |
namedInstances = _providerRegistrationManager->enumerateInstances(providerRef); |
|
for(Uint32 i = 0, n=namedInstances.size(); i < n; i++) |
{ | { |
String parmName = inParameters[i].getParameter().getName(); |
instance = namedInstances[i]; |
if (String::equalNoCase(parmName, "force")) |
instance.getProperty(instance.findProperty |
|
(_PROPERTY_PROVIDERMODULENAME)).getValue().get(_moduleName); |
|
if (String::equalNoCase(_moduleName, moduleName)) |
{ | { |
|
instances.append(instance); |
|
} |
|
|
|
} |
|
|
// | // |
// get the force parameter |
// get provider manager service |
// | // |
inParameters[i].getValue().get(forceStr); |
MessageQueueService * _service = _getProviderManagerService(); |
if (String::equalNoCase(forceStr, "TRUE")) |
|
|
if (_service != NULL) |
|
{ |
|
// create CIMDisableModuleRequestMessage |
|
CIMDisableModuleRequestMessage * disable_req = |
|
new CIMDisableModuleRequestMessage( |
|
XmlWriter::getNextMessageId (), |
|
mInstance, |
|
instances, |
|
QueueIdStack(_service->getQueueId())); |
|
|
|
Array<Uint16> _opStatus = |
|
_sendDisableMessageToProviderManager(disable_req); |
|
|
|
for (Uint32 i = 0; i<_opStatus.size(); i++) |
|
{ |
|
if (_opStatus[i] == _MODULE_STOPPED) |
{ | { |
force = true; |
// module was disabled successfully |
|
ret_value = 0; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
|
|
// send termination message to subscription service |
|
_sendTerminationMessageToSubscription(objectReference, moduleName); |
|
return; |
} | } |
} | } |
else |
} |
|
|
|
// disable failed |
|
ret_value = -1; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
return; |
|
} |
|
else if(methodName.equal(_START_PROVIDER)) |
{ | { |
if (String::equalNoCase(parmName, "timeout")) |
for (Uint32 i = 0; i<_OperationalStatus.size(); i++) |
{ | { |
// |
// retValue equals 1 if module is already enabled |
// get the timeout value |
if (_OperationalStatus[i] == _MODULE_OK) |
// |
{ |
inParameters[i].getValue().get(timeoutStr); |
ret_value = 1; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
return; |
|
} |
|
|
|
// retValue equals 2 if module is stopping |
|
// at this stage, module can not be started |
|
if (_OperationalStatus[i] == _MODULE_STOPPING) |
|
{ |
|
ret_value = 2; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
return; |
|
} |
|
} |
| |
// | // |
// convert the timeout string to integer |
// get provider manager service |
// | // |
if (timeoutStr != String::EMPTY) |
MessageQueueService * _service = _getProviderManagerService(); |
|
|
|
if (_service != NULL) |
{ | { |
char* tmp = timeoutStr.allocateCString(); |
// create CIMEnableModuleRequestMessage |
timeoutValue = strtol(tmp, (char **)0, 10); |
CIMEnableModuleRequestMessage * enable_req = |
delete [] tmp; |
new CIMEnableModuleRequestMessage( |
|
XmlWriter::getNextMessageId (), |
|
mInstance, |
|
QueueIdStack(_service->getQueueId())); |
|
|
|
Array<Uint16> _opStatus; |
|
_opStatus = _sendEnableMessageToProviderManager(enable_req); |
|
|
|
for (Uint32 i = 0; i<_opStatus.size(); i++) |
|
{ |
|
if (_opStatus[i] == _MODULE_OK) |
|
{ |
|
// module was enabled successfully |
|
ret_value = 0; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
return; |
|
} |
|
} |
} | } |
|
|
|
// enable failed |
|
ret_value = -1; |
|
CIMValue retValue(ret_value); |
|
handler.deliver(retValue); |
|
handler.complete(); |
|
return; |
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION( CIM_ERR_INVALID_PARAMETER, |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_METHOD_NOT_AVAILABLE, String::EMPTY); |
"Input parameters are not valid."); |
|
} | } |
} | } |
|
|
|
// get provider manager service |
|
MessageQueueService * ProviderRegistrationProvider::_getProviderManagerService() |
|
{ |
|
MessageQueue * queue = MessageQueue::lookup(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP); |
|
MessageQueueService * _service = dynamic_cast<MessageQueueService *>(queue); |
|
|
|
return(_service); |
} | } |
| |
// change provider status to be stopping |
ProviderRegistrationProvider & ProviderRegistrationProvider::operator=(const ProviderRegistrationProvider & handle) |
// do not accept any new requests |
{ |
// ATTN: Change this to send a message |
if(this == &handle) |
//retValue = _cimom.getProviderManager()->stoppingProvider(providerName); |
|
if ( retValue ) // return value is 1 -- provider not found |
|
{ | { |
// ATTN: throw exception |
return(*this); |
// throw(); |
|
} | } |
| |
// ATTN: need a way to find if there are any outstanding requests |
return(*this); |
// if there are outstanding requests, wait periodically until |
} |
// all requests are processed or timeout expires |
|
| |
// Uint32 requestCount = getOutstandingRequestCount(providerName); |
Array<Uint16> ProviderRegistrationProvider::_sendDisableMessageToProviderManager( |
|
CIMDisableModuleRequestMessage * disable_req) |
|
{ |
|
MessageQueueService * _service = _getProviderManagerService(); |
|
Uint32 _queueId = _service->getQueueId(); |
| |
Uint32 waitTime = 1000; // one second wait interval |
callback_data *cb_data = new callback_data(this); |
| |
// ATTN: for testing purpose, set requestCount = 3 |
// create request envelope |
Uint32 requestCount = 3; |
AsyncLegacyOperationStart * asyncRequest = |
|
new AsyncLegacyOperationStart ( |
|
_service->get_next_xid(), |
|
NULL, |
|
_queueId, |
|
disable_req, |
|
_queueId); |
| |
while (requestCount > 0 && timeoutValue > 0) |
AsyncReply * asyncReply = _controller->ClientSendWait(*_client_handle, |
|
_queueId, |
|
asyncRequest); |
|
CIMDisableModuleResponseMessage * response = |
|
reinterpret_cast<CIMDisableModuleResponseMessage *>( |
|
(static_cast<AsyncLegacyOperationResult *>(asyncReply))->get_result()); |
|
if (response->cimException.getCode() != CIM_ERR_SUCCESS) |
{ | { |
|
CIMException e = response->cimException; |
|
delete asyncRequest; |
|
delete asyncReply; |
|
delete response; |
|
throw (e); |
|
} |
|
|
|
Array<Uint16> operationalStatus = response->operationalStatus; |
| |
// any outstanding requests given a grace period to complete; |
delete asyncRequest; |
System::sleep(waitTime); |
delete asyncReply; |
|
delete response; |
|
|
|
return(operationalStatus); |
|
} |
|
|
|
Array<Uint16> ProviderRegistrationProvider::_sendEnableMessageToProviderManager( |
|
CIMEnableModuleRequestMessage * enable_req) |
|
{ |
|
MessageQueueService * _service = _getProviderManagerService(); |
|
Uint32 _queueId = _service->getQueueId(); |
|
|
|
callback_data *cb_data = new callback_data(this); |
|
|
|
// create request envelope |
|
AsyncLegacyOperationStart * asyncRequest = |
|
new AsyncLegacyOperationStart ( |
|
_service->get_next_xid(), |
|
NULL, |
|
_queueId, |
|
enable_req, |
|
_queueId); |
|
|
|
AsyncReply * asyncReply = _controller->ClientSendWait(*_client_handle, |
|
_queueId, |
|
asyncRequest); |
|
CIMEnableModuleResponseMessage * response = |
|
reinterpret_cast<CIMEnableModuleResponseMessage *>( |
|
(static_cast<AsyncLegacyOperationResult *>(asyncReply))->get_result()); |
|
if (response->cimException.getCode() != CIM_ERR_SUCCESS) |
|
{ |
|
CIMException e = response->cimException; |
|
delete asyncRequest; |
|
delete asyncReply; |
|
delete response; |
|
throw (e); |
|
} |
| |
// ATTN: |
Array<Uint16> operationalStatus = response->operationalStatus; |
// requestCount = getOutstandingRequestCount(providerName); |
|
| |
// ATTN: for testing purpose |
delete asyncRequest; |
requestCount--; |
delete asyncReply; |
|
delete response; |
| |
timeoutValue = timeoutValue - waitTime; |
return(operationalStatus); |
} | } |
| |
// If no more requests or force stop option is specified, proceed |
// send termination message to subscription service |
// to stop the provider |
void ProviderRegistrationProvider::_sendTerminationMessageToSubscription( |
if (requestCount == 0 || force) |
const CIMObjectPath & ref, const String & moduleName) |
{ | { |
// change provider status to be stopped |
CIMInstance instance; |
// ATTN: Change this to send a message |
String _moduleName; |
//retValue = _cimom.getProviderManager()->providerStopped(providerName); |
Array<CIMInstance> instances; |
| |
// stop the provider |
CIMObjectPath reference("", PEGASUS_NAMESPACENAME_INTEROP, |
// ATTN: Change this to send a message |
PEGASUS_CLASSNAME_PROVIDER, ref.getKeyBindings()); |
//retValue = _cimom.getProviderManager()->stopProvider(providerName); |
|
// ATTN: Update repository, but if a provider can not set property |
// get all registered providers |
// AutomaticallyStarted = FALSE, do not need update repository |
Array<CIMInstance> enumInstances = |
if(retValue == 0) |
_providerRegistrationManager->enumerateInstances(reference); |
{ |
|
// update repository |
// find all the instances which have same module name as moduleName |
//_cimom.getRepository()->setProperty(objectReference.getNameSpace(), |
for (Uint32 i = 0, n=enumInstances.size(); i < n; i++) |
// newInstancereference, "OperationalStatus", _PROVIDER_STOPPED); |
|
} |
|
} |
|
else |
|
{ | { |
// if there are still outstanding requests after the grace period |
instance = enumInstances[i]; |
// and force stop option is not specified, change provider status to be OK |
|
// ATTN: Change this to send a message |
|
//_cimom.getProviderManager()->startProvider(providerName); |
|
| |
//ATTN: inform the client that provider not stopped |
// |
//throw (); |
// get provider module name |
|
// |
|
instance.getProperty(instance.findProperty |
|
(_PROPERTY_PROVIDERMODULENAME)).getValue().get(_moduleName); |
| |
|
if (String::equalNoCase(moduleName, _moduleName)) |
|
{ |
|
instances.append(instance); |
} | } |
} | } |
else if(String::equalNoCase(methodName, _START_PROVIDER)) |
|
{ |
// |
// ATTN: Send a message to the ProviderManager |
// get indication server queueId |
//retValue = _cimom.getProviderManager()->startProvider(providerName); |
// |
if(retValue == 0) |
MessageQueueService * _service = _getIndicationService(); |
|
|
|
if (_service != NULL) |
{ | { |
// update repository |
Uint32 _queueId = _service->getQueueId(); |
// ATTN: Do we really need to do this? If we do, should we do it |
|
// through the ProviderRegistrationManager instead of directly |
CIMNotifyProviderTerminationRequestMessage * termination_req = |
// accessing the repository? |
new CIMNotifyProviderTerminationRequestMessage( |
//_cimom.getRepository()->setProperty(objectReference.getNameSpace(), |
XmlWriter::getNextMessageId (), |
// newInstancereference, "OperationalStatus", _PROVIDER_OK); |
instances, |
} |
QueueIdStack(_service->getQueueId())); |
else |
|
|
// create request envelope |
|
AsyncLegacyOperationStart * asyncRequest = |
|
new AsyncLegacyOperationStart ( |
|
_service->get_next_xid(), |
|
NULL, |
|
_queueId, |
|
termination_req, |
|
_queueId); |
|
|
|
if( false == _controller->ClientSendForget( |
|
*_client_handle, |
|
_queueId, |
|
asyncRequest)) |
{ | { |
// ATTN: need new exception |
delete asyncRequest; |
// throw(); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_FOUND, String::EMPTY); |
} | } |
} | } |
else |
|
{ |
|
throw CIMException(CIM_ERR_METHOD_NOT_AVAILABLE); |
|
} | } |
| |
CIMValue cimValue_output(retValue); |
// get indication service |
|
MessageQueueService * ProviderRegistrationProvider::_getIndicationService() |
handler.deliver(cimValue_output); |
{ |
|
MessageQueue * queue = MessageQueue::lookup( |
|
PEGASUS_QUEUENAME_INDICATIONSERVICE); |
| |
handler.complete(); |
MessageQueueService * _service = |
*/ |
dynamic_cast<MessageQueueService *>(queue); |
|
return(_service); |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |