1 s.kodali 1.1 //%LICENSE////////////////////////////////////////////////////////////////
2 //
3 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 s.kodali 1.1 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //////////////////////////////////////////////////////////////////////////
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_OOPProviderManagerRouter_h
33 #define Pegasus_OOPProviderManagerRouter_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/String.h>
37 #include <Pegasus/Common/HashTable.h>
38 #include <Pegasus/Common/CIMMessage.h>
39
40 #include <Pegasus/ProviderManager2/ProviderManager.h>
41 #include <Pegasus/ProviderManagerRouter/ProviderManagerRouter.h>
42 #include <Pegasus/ProviderManagerRouter/Linkage.h>
43 s.kodali 1.1
44 PEGASUS_NAMESPACE_BEGIN
45
46 typedef void (*PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T)(const String &,
47 const String &, Uint16, Boolean);
48
49 typedef void (*PEGASUS_ASYNC_RESPONSE_CALLBACK_T)(
50 CIMRequestMessage* request, CIMResponseMessage* response);
51
52 class ProviderAgentContainer;
53
54 typedef HashTable<String, ProviderAgentContainer*, EqualFunc<String>,
55 HashFunc<String> > ProviderAgentTable;
56
57 class PEGASUS_PMR_LINKAGE OOPProviderManagerRouter
58 : public ProviderManagerRouter
59 {
60 public:
61 OOPProviderManagerRouter(
62 PEGASUS_INDICATION_CALLBACK_T indicationCallback,
63 PEGASUS_RESPONSE_CHUNK_CALLBACK_T responseChunkCallback,
64 s.kodali 1.1 PEGASUS_PROVIDERMODULEGROUPFAIL_CALLBACK_T
65 providerModuleGroupFailCallback,
66 PEGASUS_ASYNC_RESPONSE_CALLBACK_T asyncResponseCallback);
67
68 virtual ~OOPProviderManagerRouter();
69
70 virtual Message* processMessage(Message* message);
71
72 virtual void idleTimeCleanup();
73
74 private:
75 //
76 // Private methods
77 //
78
79 /** determine moduleName from providerModule, function sets moduleName */
80 void _getProviderModuleName(
81 const CIMInstance & providerModule,
82 String & moduleName);
83
84 /**
85 s.kodali 1.1 Determine groupName from the providerModule. Function sets
86 groupName. A type prefix(grp or mod) is added to distinguish
87 between group and module names.
88 If ModuleGroupName property value is not specified, moduleName is set
89 to groupName.
90 */
91 void _getGroupNameWithType(
92 const CIMInstance &providerModule,
93 String &groupNameWithType);
94
95 /** Unimplemented */
96 OOPProviderManagerRouter();
97 /** Unimplemented */
98 OOPProviderManagerRouter(const OOPProviderManagerRouter&);
99 /** Unimplemented */
100 OOPProviderManagerRouter& operator=(const OOPProviderManagerRouter&);
101
102 /**
103 Return a pointer to the ProviderAgentContainer for the specified
104 module instance and requesting user. If no appropriate
105 ProviderAgentContainer exists, one is created in an uninitialized state.
106 s.kodali 1.1 */
107 ProviderAgentContainer* _lookupProviderAgent(
108 const CIMInstance& providerModule,
109 CIMRequestMessage* request);
110
|