⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cimoperationrequestdispatcher.h

📁 Pegasus is an open-source implementationof the DMTF CIM and WBEM standards. It is designed to be por
💻 H
📖 第 1 页 / 共 2 页
字号:
//%2006//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;// 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// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================////%/////////////////////////////////////////////////////////////////////////////#ifndef PegasusDispatcher_Dispatcher_h#define PegasusDispatcher_Dispatcher_h#include <Pegasus/Common/Config.h>#include <Pegasus/Common/Thread.h>#include <Pegasus/Common/MessageQueue.h>#include <Pegasus/Common/CIMMessage.h>#include <Pegasus/Common/CIMObject.h>#include <Pegasus/Common/OperationContextInternal.h>#include <Pegasus/Common/QueryExpressionRep.h>#include <Pegasus/Common/AutoPtr.h>#include <Pegasus/Repository/CIMRepository.h>#include <Pegasus/Server/CIMServer.h>#include \    <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>#include <Pegasus/Server/Linkage.h>#include <Pegasus/Common/QueryExpressionRep.h>PEGASUS_NAMESPACE_BEGIN// Class to aggregate and manage the information about classes and providers// this simply masks some of the confusion of control providers, etc. today.class PEGASUS_SERVER_LINKAGE ProviderInfo{public:    ProviderInfo(const CIMName& className)        : className(className),          hasProvider(false),          hasProviderNormalization(false),          hasNoQuery(true)    {    }    ProviderInfo(        const CIMName& className,        const String& serviceName,        const String& controlProviderName)        : className(className),          serviceName(serviceName),          controlProviderName(controlProviderName),          hasProvider(false),          hasProviderNormalization(false),          hasNoQuery(true)    {    }    ProviderInfo(const ProviderInfo& providerInfo)        : className(providerInfo.className),          serviceName(providerInfo.serviceName),          controlProviderName(providerInfo.controlProviderName),          hasProvider(providerInfo.hasProvider),          hasProviderNormalization(false),          hasNoQuery(providerInfo.hasNoQuery)    {        if (providerInfo.providerIdContainer.get() != 0)        {            providerIdContainer.reset(                new ProviderIdContainer(*providerInfo.providerIdContainer));        }    }    ProviderInfo& operator=(const ProviderInfo& providerInfo)    {        if (&providerInfo != this)        {            className = providerInfo.className;            serviceName = providerInfo.serviceName;            controlProviderName = providerInfo.controlProviderName;            hasProvider = providerInfo.hasProvider;            hasProviderNormalization = providerInfo.hasProviderNormalization;            hasNoQuery = providerInfo.hasNoQuery;            providerIdContainer.reset();            if (providerInfo.providerIdContainer.get() != 0)            {                providerIdContainer.reset(new ProviderIdContainer(                    *providerInfo.providerIdContainer.get()));            }        }        return *this;    }    CIMName className;    String serviceName;    String controlProviderName;    Boolean hasProvider;    Boolean hasProviderNormalization;    Boolean hasNoQuery;    AutoPtr<ProviderIdContainer> providerIdContainer;private:    ProviderInfo()    {    }};/* Class to manage the aggregation of data required by post processors. This    class is private to the dispatcher. An instance is created by the operation    dispatcher to aggregate request and response information and used by the    post processor to aggregate responses together.*/class PEGASUS_SERVER_LINKAGE OperationAggregate{    friend class CIMOperationRequestDispatcher;public:    /** Operation Aggregate constructor.  Builds an aggregate        object.        @param request        @param msgRequestType        @param messageId        @param dest        @param className    */    OperationAggregate(CIMRequestMessage* request,        Uint32 msgRequestType,        String messageId,        Uint32 dest,        CIMName className,        CIMNamespaceName nameSpace = CIMNamespaceName(),        QueryExpressionRep* query = 0,        String queryLanguage = String::EMPTY);    virtual ~OperationAggregate();    // Tests validity by checking the magic number we put into the    // packet.    Boolean valid() const;    // Sets the total issued to the input parameter    void setTotalIssued(Uint32 i);    // Append a new entry to the response list.  Return value indicates    // whether this response is the last one expected    Boolean appendResponse(CIMResponseMessage* response);    Uint32 numberResponses() const;    CIMRequestMessage* getRequest();    CIMResponseMessage* getResponse(const Uint32& pos);    // allow dispatcher to remove the response so it doesn't become    // destroyed when the poA is destroyed.    CIMResponseMessage* removeResponse(const Uint32& pos);    void deleteResponse(const Uint32&pos);    Uint32 getRequestType() const;    void resequenceResponse(CIMResponseMessage& response);    String _messageId;    Uint32 _msgRequestType;    Uint32 _dest;    CIMNamespaceName _nameSpace;    CIMName _className;    Array<String> propertyList;    Uint64 _aggregationSN;    QueryExpressionRep* _query;    String _queryLanguage;private:    /** Hidden (unimplemented) copy constructor */    OperationAggregate(const OperationAggregate& x);    Array<CIMResponseMessage*> _responseList;    Mutex _appendResponseMutex;    Mutex _enqueueResponseMutex;    CIMRequestMessage* _request;    Uint32 _totalIssued;    Uint32 _magicNumber;    Uint32 _totalReceived;    Uint32 _totalReceivedComplete;    Uint32 _totalReceivedExpected;    Uint32 _totalReceivedErrors;    Uint32 _totalReceivedNotSupported;};class PEGASUS_SERVER_LINKAGE CIMOperationRequestDispatcher :    public MessageQueueService{    friend class QuerySupportRouter;public:    typedef MessageQueueService Base;    CIMOperationRequestDispatcher(        CIMRepository* repository,        ProviderRegistrationManager* providerRegistrationManager);    virtual ~CIMOperationRequestDispatcher();    virtual void handleEnqueue(Message*);    virtual void handleEnqueue();    void handleGetClassRequest(        CIMGetClassRequestMessage* request);    void handleGetInstanceRequest(        CIMGetInstanceRequestMessage* request);    void handleDeleteClassRequest(        CIMDeleteClassRequestMessage* request);    void handleDeleteInstanceRequest(        CIMDeleteInstanceRequestMessage* request);    void handleCreateClassRequest(        CIMCreateClassRequestMessage* request);    void handleCreateInstanceRequest(

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -