version 1.30, 2004/05/21 22:01:53
|
version 1.47, 2005/02/05 23:00:30
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%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. |
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; | // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; |
// 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.; |
|
// 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 |
|
|
// Mike Day, IBM (mdday@us.ibm.com) | // Mike Day, IBM (mdday@us.ibm.com) |
// Karl Schopmeyer(k.schopmeyer@opengroup.org) - Fix associators. | // Karl Schopmeyer(k.schopmeyer@opengroup.org) - Fix associators. |
// Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) | // Yi Zhou, Hewlett-Packard Company (yi_zhou@hp.com) |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Seema Gupta (gseema@in.ibm.com) for PEP135 |
|
// Willis White (whiwill@us.ibm.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
#include <Pegasus/Common/StatisticalData.h> | #include <Pegasus/Common/StatisticalData.h> |
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
#include <Pegasus/Common/MessageLoader.h> //l10n | #include <Pegasus/Common/MessageLoader.h> //l10n |
|
#include <Pegasus/Common/Constants.h> |
| |
#include <Pegasus/Common/QueryExpression.h> |
#include <Pegasus/Query/QueryExpression/QueryExpression.h> |
#include <Pegasus/ProviderManager2/QueryExpressionFactory.h> | #include <Pegasus/ProviderManager2/QueryExpressionFactory.h> |
| |
#include <Pegasus/ProviderManager2/Default/Provider.h> | #include <Pegasus/ProviderManager2/Default/Provider.h> |
|
|
}; | }; |
| |
// | // |
// Provider module status |
// Default Provider Manager |
// | // |
static const Uint16 _MODULE_OK = 2; |
|
static const Uint16 _MODULE_STOPPING = 9; |
|
static const Uint16 _MODULE_STOPPED = 10; |
|
|
|
// provider manager |
|
static LocalProviderManager providerManager; |
|
|
|
DefaultProviderManager::DefaultProviderManager(void) | DefaultProviderManager::DefaultProviderManager(void) |
{ | { |
} | } |
|
|
response = handleDisableIndicationsRequest(request); | response = handleDisableIndicationsRequest(request); |
| |
break; | break; |
case CIM_CONSUME_INDICATION_REQUEST_MESSAGE: |
|
response = handleConsumeIndicationRequest(request); |
|
break; |
|
|
|
case CIM_EXPORT_INDICATION_REQUEST_MESSAGE: | case CIM_EXPORT_INDICATION_REQUEST_MESSAGE: |
response = handleExportIndicationRequest(request); | response = handleExportIndicationRequest(request); |
break; | break; |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMPropertyList propertyList(request->propertyList); | CIMPropertyList propertyList(request->propertyList); |
| |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMPropertyList propertyList(request->propertyList); | CIMPropertyList propertyList(request->propertyList); |
| |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMPropertyList propertyList(request->propertyList); | CIMPropertyList propertyList(request->propertyList); |
| |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// forward request | // forward request |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
QueryExpression qx(QueryExpressionFactory::routeBuildQueryExpressionRep |
QueryExpression qx(request->queryLanguage,request->query); |
(request->queryLanguage,request->query)); |
|
| |
// forward request | // forward request |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
// ATTN KS STAT_GETSTARTTIME; |
STAT_GETSTARTTIME; |
pm_service_op_lock op_lock(&ph.GetProvider()); | pm_service_op_lock op_lock(&ph.GetProvider()); |
| |
ph.GetProvider().associators( | ph.GetProvider().associators( |
|
|
request->resultRole, | request->resultRole, |
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin, | request->includeClassOrigin, |
request->propertyList.getPropertyNameArray(), |
request->propertyList, |
handler); | handler); |
| |
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
|
STAT_GETSTARTTIME; |
pm_service_op_lock op_lock(&ph.GetProvider()); | pm_service_op_lock op_lock(&ph.GetProvider()); |
| |
ph.GetProvider().associatorNames( | ph.GetProvider().associatorNames( |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
STAT_GETSTARTTIME; | STAT_GETSTARTTIME; |
| |
|
|
request->role, | request->role, |
request->includeQualifiers, | request->includeQualifiers, |
request->includeClassOrigin, | request->includeClassOrigin, |
request->propertyList.getPropertyNameArray(), |
request->propertyList, |
handler); | handler); |
| |
STAT_PMS_PROVIDEREND; | STAT_PMS_PROVIDEREND; |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
STAT_GETSTARTTIME; | STAT_GETSTARTTIME; |
| |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMName propertyName = request->propertyName; | CIMName propertyName = request->propertyName; |
| |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMName propertyName = request->propertyName; | CIMName propertyName = request->propertyName; |
CIMValue propertyValue = request->newValue; | CIMValue propertyValue = request->newValue; |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMObjectPath instanceReference(request->instanceName); | CIMObjectPath instanceReference(request->instanceName); |
| |
|
|
request->nameSpace.getString(), | request->nameSpace.getString(), |
temp); | temp); |
| |
String physicalName=_resolvePhysicalName( |
CIMInstance req_provider, req_providerModule; |
request->providerModule.getProperty( |
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
request->providerModule.findProperty("Location")).getValue().toString()); |
req_provider = pidc.getProvider(); |
|
req_providerModule = pidc.getModule(); |
| |
ProviderName name( |
String physicalName=_resolvePhysicalName( req_providerModule.getProperty( |
request->provider.getProperty(request->provider.findProperty |
req_providerModule.findProperty("Location")).getValue().toString()); |
("Name")).getValue ().toString (), |
|
|
ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (), |
physicalName, | physicalName, |
request->providerModule.getProperty(request->providerModule.findProperty |
req_providerModule.getProperty(req_providerModule.findProperty |
("InterfaceType")).getValue().toString(), | ("InterfaceType")).getValue().toString(), |
0); | 0); |
|
|
// get cached or load new provider module | // get cached or load new provider module |
OpProviderHolder ph = | OpProviderHolder ph = |
providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); | providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(SubscriptionInstanceContainer |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
(request->subscriptionInstance)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert(SubscriptionFilterConditionContainer |
context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME)); |
(request->condition, request->queryLanguage)); |
context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME)); |
context.insert(SubscriptionLanguageListContainer |
context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME)); |
(request->acceptLanguages)); |
context.insert(request->operationContext.get(SubscriptionFilterQueryContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
|
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
|
| |
CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); | CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); |
| |
|
|
request->nameSpace.getString(), | request->nameSpace.getString(), |
temp); | temp); |
| |
String physicalName=_resolvePhysicalName( |
CIMInstance req_provider, req_providerModule; |
request->providerModule.getProperty( |
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
request->providerModule.findProperty("Location")).getValue().toString()); |
req_provider = pidc.getProvider(); |
|
req_providerModule = pidc.getModule(); |
| |
ProviderName name( |
String physicalName=_resolvePhysicalName( req_providerModule.getProperty( |
request->provider.getProperty(request->provider.findProperty |
req_providerModule.findProperty("Location")).getValue().toString()); |
("Name")).getValue ().toString (), |
|
|
ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (), |
physicalName, | physicalName, |
request->providerModule.getProperty(request->providerModule.findProperty |
req_providerModule.getProperty(req_providerModule.findProperty |
("InterfaceType")).getValue().toString(), | ("InterfaceType")).getValue().toString(), |
0); | 0); |
| |
|
|
| |
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
|
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
context.insert(SubscriptionInstanceContainer |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
(request->subscriptionInstance)); |
context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME)); |
context.insert(SubscriptionFilterConditionContainer |
context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME)); |
(request->condition, request->queryLanguage)); |
context.insert(request->operationContext.get(SubscriptionFilterConditionContainer::NAME)); |
context.insert(SubscriptionLanguageListContainer |
context.insert(request->operationContext.get(SubscriptionFilterQueryContainer::NAME)); |
(request->acceptLanguages)); |
|
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
|
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
|
| |
CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); | CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); |
| |
|
|
request->nameSpace.getString(), | request->nameSpace.getString(), |
temp); | temp); |
| |
String physicalName=_resolvePhysicalName( |
CIMInstance req_provider, req_providerModule; |
request->providerModule.getProperty( |
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
request->providerModule.findProperty("Location")).getValue().toString()); |
|
| |
ProviderName name( |
req_provider = pidc.getProvider(); |
request->provider.getProperty(request->provider.findProperty |
req_providerModule = pidc.getModule(); |
("Name")).getValue ().toString (), |
|
|
String physicalName=_resolvePhysicalName( req_providerModule.getProperty( |
|
req_providerModule.findProperty("Location")).getValue().toString()); |
|
|
|
ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (), |
physicalName, | physicalName, |
request->providerModule.getProperty(request->providerModule.findProperty |
req_providerModule.getProperty(req_providerModule.findProperty |
("InterfaceType")).getValue().toString(), | ("InterfaceType")).getValue().toString(), |
0); | 0); |
| |
|
|
// convert arguments | // convert arguments |
OperationContext context; | OperationContext context; |
| |
context.insert(IdentityContainer(request->userName)); |
context.insert(request->operationContext.get(IdentityContainer::NAME)); |
context.insert(SubscriptionInstanceContainer |
context.insert(request->operationContext.get(AcceptLanguageListContainer::NAME)); |
(request->subscriptionInstance)); |
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
context.insert(SubscriptionLanguageListContainer |
context.insert(request->operationContext.get(SubscriptionInstanceContainer::NAME)); |
(request->acceptLanguages)); |
context.insert(request->operationContext.get(SubscriptionLanguageListContainer::NAME)); |
context.insert(AcceptLanguageListContainer(request->acceptLanguages)); |
|
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
|
| |
CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); | CIMObjectPath subscriptionName = request->subscriptionInstance.getPath(); |
| |
|
|
| |
response->dest = request->queueIds.top(); | response->dest = request->queueIds.top(); |
| |
|
CIMInstance req_provider, req_providerModule; |
|
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
|
|
|
req_provider = pidc.getProvider(); |
|
req_providerModule = pidc.getModule(); |
|
|
EnableIndicationsResponseHandler *handler = | EnableIndicationsResponseHandler *handler = |
new EnableIndicationsResponseHandler( | new EnableIndicationsResponseHandler( |
request, response, request->provider, _indicationCallback); |
request, response, req_provider, _indicationCallback); |
|
|
|
|
| |
try | try |
{ | { |
String physicalName=_resolvePhysicalName( |
String physicalName=_resolvePhysicalName( req_providerModule.getProperty( |
request->providerModule.getProperty( |
req_providerModule.findProperty("Location")).getValue().toString()); |
request->providerModule.findProperty("Location")).getValue().toString()); |
|
| |
ProviderName name( |
ProviderName name(req_provider.getProperty(req_provider.findProperty("Name")).getValue ().toString (), |
request->provider.getProperty(request->provider.findProperty |
|
("Name")).getValue ().toString (), |
|
physicalName, | physicalName, |
request->providerModule.getProperty(request->providerModule.findProperty |
req_providerModule.getProperty(req_providerModule.findProperty |
("InterfaceType")).getValue().toString(), | ("InterfaceType")).getValue().toString(), |
0); | 0); |
| |
|
|
| |
OperationResponseHandler handler(request, response); | OperationResponseHandler handler(request, response); |
| |
|
CIMInstance req_provider, req_providerModule; |
|
ProviderIdContainer pidc = (ProviderIdContainer)request->operationContext.get(ProviderIdContainer::NAME); |
|
|
|
req_provider = pidc.getProvider(); |
|
req_providerModule = pidc.getModule(); |
|
|
try | try |
{ | { |
String physicalName=_resolvePhysicalName( | String physicalName=_resolvePhysicalName( |
request->providerModule.getProperty( |
req_providerModule.getProperty( |
request->providerModule.findProperty("Location")).getValue().toString()); |
req_providerModule.findProperty("Location")).getValue().toString()); |
| |
ProviderName name( | ProviderName name( |
request->provider.getProperty(request->provider.findProperty |
req_provider.getProperty(req_provider.findProperty |
("Name")).getValue ().toString (), | ("Name")).getValue ().toString (), |
physicalName, | physicalName, |
request->providerModule.getProperty(request->providerModule.findProperty |
req_providerModule.getProperty(req_providerModule.findProperty |
("InterfaceType")).getValue().toString(), | ("InterfaceType")).getValue().toString(), |
0); | 0); |
|
|
// get cached or load new provider module | // get cached or load new provider module |
OpProviderHolder ph = | OpProviderHolder ph = |
providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); | providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); |
|
|
return(response); | return(response); |
} | } |
| |
Message * DefaultProviderManager::handleConsumeIndicationRequest(const Message *message) |
|
{ |
|
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handlConsumeIndicationRequest"); |
|
|
|
CIMConsumeIndicationRequestMessage *request = |
|
dynamic_cast<CIMConsumeIndicationRequestMessage *>(const_cast<Message *>(message)); |
|
|
|
PEGASUS_ASSERT(request != 0); |
|
|
|
CIMResponseMessage * response = |
|
new CIMResponseMessage( |
|
CIM_CONSUME_INDICATION_RESPONSE_MESSAGE, |
|
request->messageId, |
|
CIMException(), |
|
request->queueIds.copyAndPop()); |
|
|
|
PEGASUS_ASSERT(response != 0); |
|
|
|
response->setKey(request->getKey()); |
|
|
|
// Set HTTP method in response from request |
|
response->setHttpMethod (request->getHttpMethod ()); |
|
|
|
Uint32 type = 3; |
|
|
|
try |
|
{ |
|
// resolve provider name |
|
ProviderName name = _resolveProviderName( |
|
request->operationContext.get(ProviderIdContainer::NAME)); |
|
|
|
// get cached or load new provider module |
|
OpProviderHolder ph = |
|
providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); |
|
|
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Calling provider.: " + |
|
ph.GetProvider().getName()); |
|
|
|
OperationContext context; |
|
|
|
//l10n |
|
// ATTN-CEC 06/04/03 NOTE: I can't find where the consume msg is sent. This |
|
// does not appear to be hooked-up. When it is added, need to |
|
// make sure that Content-Language is set in the consume msg. |
|
// NOTE: A-L is not needed to be set in the consume msg. |
|
// add the langs to the context |
|
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
|
|
|
CIMInstance indication_copy = request->indicationInstance; |
|
|
|
SimpleIndicationResponseHandler handler; |
|
|
|
ph.GetProvider().consumeIndication(context, |
|
"", |
|
indication_copy); |
|
} |
|
catch(CIMException & e) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Exception: " + e.getMessage()); |
|
|
|
response->cimException = CIMException(e); |
|
} |
|
catch(Exception & e) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Exception: " + e.getMessage()); |
|
//l10n |
|
//response->cimException = CIMException(CIM_ERR_FAILED, "Internal Error"); |
|
response->cimException = CIMException(CIM_ERR_FAILED, MessageLoaderParms( |
|
"ProviderManager.DefaultProviderManager.INTERNAL_ERROR", |
|
"Internal Error")); |
|
} |
|
catch(...) |
|
{ |
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
|
"Exception: Unknown"); |
|
//l10n |
|
//response->cimException = CIMException(CIM_ERR_FAILED, "Unknown Error"); |
|
response->cimException = CIMException(CIM_ERR_FAILED, MessageLoaderParms( |
|
"ProviderManager.DefaultProviderManager.UNKNOWN_ERROR", |
|
"Unknown Error")); |
|
} |
|
|
|
PEG_METHOD_EXIT(); |
|
|
|
return(response); |
|
} |
|
|
|
|
|
Message *DefaultProviderManager::handleExportIndicationRequest(const Message *message) | Message *DefaultProviderManager::handleExportIndicationRequest(const Message *message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManagerService::handlExportIndicationRequest"); | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManagerService::handlExportIndicationRequest"); |
|
|
OpProviderHolder ph = | OpProviderHolder ph = |
providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); | providerManager.getProvider(name.getPhysicalName(), name.getLogicalName(), String::EMPTY); |
| |
|
STAT_GETSTARTTIME |
|
|
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Calling provider.: " + | "Calling provider.: " + |
ph.GetProvider().getName()); | ph.GetProvider().getName()); |
|
|
// make sure that Content-Language is set in the consume msg. | // make sure that Content-Language is set in the consume msg. |
// NOTE: A-L is not needed to be set in the consume msg. | // NOTE: A-L is not needed to be set in the consume msg. |
// add the langs to the context | // add the langs to the context |
context.insert(ContentLanguageListContainer(request->contentLanguages)); |
|
|
context.insert(request->operationContext.get(ContentLanguageListContainer::NAME)); |
| |
CIMInstance indication_copy = request->indicationInstance; | CIMInstance indication_copy = request->indicationInstance; |
pm_service_op_lock op_lock(&ph.GetProvider()); | pm_service_op_lock op_lock(&ph.GetProvider()); |
|
|
request->destinationPath, | request->destinationPath, |
indication_copy); | indication_copy); |
| |
|
STAT_PMS_PROVIDEREND |
|
|
} | } |
| |
catch(CIMException & e) | catch(CIMException & e) |
|
|
{ | { |
// disable failed since there are pending requests, | // disable failed since there are pending requests, |
// stop trying to disable other providers in this module. | // stop trying to disable other providers in this module. |
operationalStatus.append(_MODULE_OK); |
operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK); |
break; | break; |
} | } |
else if (ret_value == 1) // Success | else if (ret_value == 1) // Success |
|
|
// Status is set to OK if a provider was busy | // Status is set to OK if a provider was busy |
if (operationalStatus.size() == 0) | if (operationalStatus.size() == 0) |
{ | { |
operationalStatus.append(_MODULE_STOPPED); |
operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_STOPPED); |
} | } |
} | } |
else | else |
{ | { |
// If exception occurs, module is not stopped | // If exception occurs, module is not stopped |
operationalStatus.append(_MODULE_OK); |
operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK); |
} | } |
| |
CIMDisableModuleResponseMessage * response = | CIMDisableModuleResponseMessage * response = |
|
|
PEGASUS_ASSERT(request != 0); | PEGASUS_ASSERT(request != 0); |
| |
Array<Uint16> operationalStatus; | Array<Uint16> operationalStatus; |
operationalStatus.append(_MODULE_OK); |
operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK); |
| |
CIMEnableModuleResponseMessage * response = | CIMEnableModuleResponseMessage * response = |
new CIMEnableModuleResponseMessage( | new CIMEnableModuleResponseMessage( |
|
|
const Provider & provider, | const Provider & provider, |
const EnableIndicationsResponseHandler *handler) | const EnableIndicationsResponseHandler *handler) |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
PEG_METHOD_ENTER (TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_insertEntry"); | "DefaultProviderManager::_insertEntry"); |
| |
String tableKey = _generateKey | String tableKey = _generateKey |
|
|
EnableIndicationsResponseHandler * DefaultProviderManager::_removeEntry( | EnableIndicationsResponseHandler * DefaultProviderManager::_removeEntry( |
const String & key) | const String & key) |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
PEG_METHOD_ENTER (TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_removeEntry"); | "DefaultProviderManager::_removeEntry"); |
EnableIndicationsResponseHandler *ret = 0; | EnableIndicationsResponseHandler *ret = 0; |
| |
|
|
{ | { |
String tableKey; | String tableKey; |
| |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
PEG_METHOD_ENTER (TRC_PROVIDERMANAGER, |
"DefaultProviderManager::_generateKey"); | "DefaultProviderManager::_generateKey"); |
| |
// | // |
|
|
{ | { |
String tableKey; | String tableKey; |
| |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
PEG_METHOD_ENTER (TRC_PROVIDERMANAGER, |
"DefaultProviderManagerService::_generateKey"); | "DefaultProviderManagerService::_generateKey"); |
| |
// | // |
|
|
providerId.getModule().findProperty("InterfaceType")).getValue(); | providerId.getModule().findProperty("InterfaceType")).getValue(); |
genericValue.get(interfaceName); | genericValue.get(interfaceName); |
| |
// Check if the provider module is blocked |
return ProviderName(providerName, fileName, interfaceName, 0); |
Array<Uint16> operationalStatus; |
|
Uint32 pos = providerId.getModule().findProperty( |
|
CIMName("OperationalStatus")); |
|
PEGASUS_ASSERT(pos != PEG_NOT_FOUND); |
|
providerId.getModule().getProperty(pos).getValue().get(operationalStatus); |
|
|
|
for(Uint32 i = 0; i < operationalStatus.size(); i++) |
|
{ |
|
if(operationalStatus[i] == _MODULE_STOPPED || |
|
operationalStatus[i] == _MODULE_STOPPING) |
|
{ |
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, |
|
MessageLoaderParms( |
|
"ProviderManager.ProviderManagerService.PROVIDER_BLOCKED", |
|
"provider blocked.")); |
|
} |
|
} | } |
| |
return ProviderName(providerName, fileName, interfaceName, 0); |
Boolean DefaultProviderManager::hasActiveProviders() |
|
{ |
|
return providerManager.hasActiveProviders(); |
} | } |
| |
void DefaultProviderManager::unload_idle_providers() |
void DefaultProviderManager::unloadIdleProviders() |
{ | { |
providerManager.unload_idle_providers(); |
providerManager.unloadIdleProviders(); |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |