version 1.4, 2004/01/27 13:48:11
|
version 1.31, 2007/08/21 20:10:22
|
|
|
//%2003//////////////////////////////////////////////////////////////////////// |
//%2006//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development |
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development |
// Company, L. P., IBM Corp., The Open Group, Tivoli Systems. |
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. |
// 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. |
|
// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.; |
|
// EMC Corporation; Symantec Corporation; The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Chip Vincent (cvincent@us.ibm.com) |
|
// |
|
// Modified By: |
|
// Nag Boranna, Hewlett-Packard Company(nagaraja_boranna@hp.com) |
|
// Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com) |
|
// Jenny Yu, Hewlett-Packard Company (jenny_yu@hp.com) |
|
// Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com) |
|
// Carol Ann Krug Graves, Hewlett-Packard Company |
|
// (carolann_graves@hp.com) |
|
// Mike Day, IBM (mdday@us.ibm.com) |
|
// Adrian Schuur (schuur@de.ibm.com) |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_DefaultProviderManager_h | #ifndef Pegasus_DefaultProviderManager_h |
|
|
#include <Pegasus/Common/Constants.h> | #include <Pegasus/Common/Constants.h> |
#include <Pegasus/Common/CIMObjectPath.h> | #include <Pegasus/Common/CIMObjectPath.h> |
#include <Pegasus/Common/Pair.h> | #include <Pegasus/Common/Pair.h> |
#include <Pegasus/Common/Triad.h> |
|
#include <Pegasus/Common/Thread.h> | #include <Pegasus/Common/Thread.h> |
#include <Pegasus/Common/HashTable.h> | #include <Pegasus/Common/HashTable.h> |
|
#include <Pegasus/Common/OperationContextInternal.h> |
| |
#include <Pegasus/ProviderManager2/ProviderManager.h> | #include <Pegasus/ProviderManager2/ProviderManager.h> |
|
#include <Pegasus/ProviderManager2/ProviderName.h> |
| |
#include <Pegasus/ProviderManager2/Default/LocalProviderManager.h> |
#include <Pegasus/ProviderManager2/Default/ProviderMessageHandler.h> |
#include <Pegasus/ProviderManager2/Default/OperationResponseHandler.h> |
#include <Pegasus/ProviderManager2/Default/Linkage.h> |
#include <Pegasus/ProviderManager2/Default/Provider.h> |
|
|
|
#include <Pegasus/Server/Linkage.h> |
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
typedef HashTable<String, |
class PEGASUS_DEFPM_LINKAGE DefaultProviderManager : public ProviderManager |
EnableIndicationsResponseHandler *, |
|
EqualFunc<String>, |
|
HashFunc<String> > IndicationResponseTable; |
|
|
|
class PEGASUS_SERVER_LINKAGE DefaultProviderManager : public ProviderManager |
|
{ | { |
public: | public: |
DefaultProviderManager(void); |
DefaultProviderManager(); |
virtual ~DefaultProviderManager(void); |
virtual ~DefaultProviderManager(); |
| |
virtual Message * processMessage(Message * request) throw(); |
virtual Message* processMessage(Message* message); |
| |
protected: |
virtual Boolean hasActiveProviders(); |
Message * handleUnsupportedRequest(const Message * message) throw(); |
virtual void unloadIdleProviders(); |
| |
Message * handleGetInstanceRequest(const Message * message) throw(); |
// This function creates an instance of DefaultProviderManager. It is |
Message * handleEnumerateInstancesRequest(const Message * message) throw(); |
// typically passed to either the ProviderManagerService constructor |
Message * handleEnumerateInstanceNamesRequest(const Message * message) throw(); |
// or the BasicProviderManagerRouter constructor as a way of decoupling |
Message * handleCreateInstanceRequest(const Message * message) throw(); |
// the pegprovidermanager and DefaultProviderManager libraries (otherwise |
Message * handleModifyInstanceRequest(const Message * message) throw(); |
// each library would contain a reference to the other). |
Message * handleDeleteInstanceRequest(const Message * message) throw(); |
static ProviderManager* createDefaultProviderManagerCallback(); |
| |
Message * handleExecQueryRequest(const Message * message) throw(); |
private: |
|
CIMResponseMessage* _handleDisableModuleRequest( |
|
CIMRequestMessage* message); |
|
CIMResponseMessage* _handleEnableModuleRequest( |
|
CIMRequestMessage* message); |
|
CIMResponseMessage* _handleSubscriptionInitCompleteRequest( |
|
CIMRequestMessage* message); |
| |
Message * handleAssociatorsRequest(const Message * message) throw(); |
ProviderName _resolveProviderName(const ProviderIdContainer& providerId); |
Message * handleAssociatorNamesRequest(const Message * message) throw(); |
|
Message * handleReferencesRequest(const Message * message) throw(); |
|
Message * handleReferenceNamesRequest(const Message * message) throw(); |
|
| |
Message * handleGetPropertyRequest(const Message * message) throw(); |
ProviderOperationCounter _getProvider( |
Message * handleSetPropertyRequest(const Message * message) throw(); |
const String& moduleFileName, |
|
const String& moduleName, |
|
const String& providerName); |
| |
Message * handleInvokeMethodRequest(const Message * message) throw(); |
ProviderMessageHandler* _lookupProvider( |
|
const String& moduleName, |
|
const String& providerName); |
| |
Message * handleCreateSubscriptionRequest(const Message * message) throw(); |
ProviderMessageHandler* _initProvider( |
Message * handleModifySubscriptionRequest(const Message * message) throw(); |
ProviderMessageHandler* provider, |
Message * handleDeleteSubscriptionRequest(const Message * message) throw(); |
const String& moduleFileName); |
Message * handleEnableIndicationsRequest(const Message * message) throw(); |
|
Message * handleDisableIndicationsRequest(const Message * message) throw(); |
|
| |
Message * handleConsumeIndicationRequest(const Message * message) throw(); |
ProviderModule* _lookupModule(const String& moduleFileName); |
| |
Message * handleDisableModuleRequest(const Message * message) throw(); |
void _shutdownAllProviders(); |
Message * handleEnableModuleRequest(const Message * message) throw(); |
|
Message * handleStopAllProvidersRequest(const Message * message) throw(); |
|
| |
/** |
Sint16 _disableProvider( |
Inserts an entry into the enabled indication providers table. |
const String& moduleFileName, |
|
const String& providerName); |
| |
@param provider the provider instance |
void _unloadProvider(ProviderMessageHandler* provider); |
@param handler pointer to the indication response handler |
|
*/ |
|
void _insertEntry(const Provider & provider, const EnableIndicationsResponseHandler *handler); |
|
| |
/** | /** |
Generates a String key from by combining the provider and provider |
The _providerTableMutex must be locked whenever accessing the |
module names. |
_providers table or the _modules table. It is okay to lock a |
|
ProviderStatus::_statusMutex while holding the _providerTableMutex, |
@param provider the provider instance |
but one should never lock the _providerTableMutex while holding |
|
a ProviderStatus::_statusMutex. |
@return the generated key |
|
*/ | */ |
EnableIndicationsResponseHandler * _removeEntry(const String & key); |
Mutex _providerTableMutex; |
|
|
String _generateKey(const Provider & provider); |
|
| |
ProviderName _resolveProviderName(const ProviderName & providerName); |
typedef HashTable<String, ProviderMessageHandler*, |
|
EqualFunc<String>, HashFunc<String> > ProviderTable; |
| |
protected: |
typedef HashTable<String, ProviderModule*, |
/** |
EqualFunc<String>, HashFunc<String> > ModuleTable; |
Table holding indication response handlers, one for each provider |
|
that has indications enabled. |
|
*/ |
|
IndicationResponseTable _responseTable; |
|
| |
|
ProviderTable _providers; |
|
ModuleTable _modules; |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |