1 schuur 1.1 //%2003////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development
4 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 schuur 1.1 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Author: Adrian Schuur, schuur@de.ibm.com
27 //
28 // Modified By:
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_JMPIProviderManager_h
33 #define Pegasus_JMPIProviderManager_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/HashTable.h>
37 #include <Pegasus/ProviderManager2/ProviderRegistrarInitializer.h>
38 #include <Pegasus/ProviderManager2/ProviderName.h>
39 #include <Pegasus/ProviderManager2/ProviderManager.h>
40 #include <Pegasus/Server/Linkage.h>
41 #include <Pegasus/Config/ConfigManager.h>
42 #include <Pegasus/Repository/CIMRepository.h>
43 schuur 1.1 #include <Pegasus/ProviderManager2/OperationResponseHandler.h>
44
45 PEGASUS_NAMESPACE_BEGIN
46
47 class CMPI_SelectExp;
48
49 class PEGASUS_SERVER_LINKAGE JMPIProviderManager : public ProviderManager
50 {
51 public:
52 enum Mode {
53 CMPI_MODE,
54 CMPI_R_MODE,
55 CMPI_O_MODE
56 };
57
58 Mode getMode() { return mode; }
59 JMPIProviderManager(Mode=CMPI_MODE);
60 virtual ~JMPIProviderManager(void);
61
62 virtual Boolean insertProvider(const ProviderName & providerName,
63 const String &ns, const String &cn);
64 schuur 1.1
65 virtual Message * processMessage(Message * request) throw();
66
67 static String resolveFileName(String name);
68
69 virtual void unload_idle_providers(void) ;
70
71 struct indProvRecord {
72 indProvRecord() : enabled(false), count(1), handler(NULL) {}
73 Boolean enabled;
74 int count;
75 EnableIndicationsResponseHandler* handler;
76 };
77
78 struct indSelectRecord {
79 indSelectRecord() : eSelx(NULL) {}
80 CMPI_SelectExp *eSelx;
81 };
82
83 typedef HashTable<String,indProvRecord*, EqualFunc<String>,HashFunc<String> > IndProvTab;
84 typedef HashTable<String,indSelectRecord*,EqualFunc<String>,HashFunc<String> > IndSelectTab;
85 schuur 1.1 typedef HashTable<String,ProviderName,EqualFunc<String>,HashFunc<String> > ProvRegistrar;
86
87 static IndProvTab provTab;
88 static IndSelectTab selxTab;
89 static ProvRegistrar provReg;
90
91 protected:
92 Mode mode;
93 CIMRepository *_repository;
94 String getFilter(CIMInstance &subscription);
95
96 Message * handleUnsupportedRequest(const Message * message) throw();
97
98 Message * handleGetInstanceRequest(const Message * message) throw();
99 Message * handleEnumerateInstancesRequest(const Message * message) throw();
100 Message * handleEnumerateInstanceNamesRequest(const Message * message) throw();
101 Message * handleCreateInstanceRequest(const Message * message) throw();
102 Message * handleModifyInstanceRequest(const Message * message) throw();
103 Message * handleDeleteInstanceRequest(const Message * message) throw();
104
105 /* Message * handleExecuteQueryRequest(const Message * message) throw();
106 schuur 1.1
107 */ Message * handleAssociatorsRequest(const Message * message) throw();
108 Message * handleAssociatorNamesRequest(const Message * message) throw();
109 Message * handleReferencesRequest(const Message * message) throw();
110 Message * handleReferenceNamesRequest(const Message * message) throw();
111 /*
112 Message * handleGetPropertyRequest(const Message * message) throw();
113 Message * handleSetPropertyRequest(const Message * message) throw();
114 * /
115 Message * handleInvokeMethodRequest(const Message * message) throw();
116
117 Message * handleCreateSubscriptionRequest(const Message * message) throw();
118 // Message * handleModifySubscriptionRequest(const Message * message) throw();
119 Message * handleDeleteSubscriptionRequest(const Message * message) throw();
120 Message * handleEnableIndicationsRequest(const Message * message) throw();
121 Message * handleDisableIndicationsRequest(const Message * message) throw();
122 */
123 // Not supported by CMPI
124 // Message * handleConsumeIndicationRequest(const Message * message) throw();
125
126 Message * handleDisableModuleRequest(const Message * message) throw();
127 schuur 1.1 Message * handleEnableModuleRequest(const Message * message) throw();
128 Message * handleStopAllProvidersRequest(const Message * message) throw();
129
130 ProviderName _resolveProviderName(const ProviderName & providerName);
131 };
132
133 PEGASUS_NAMESPACE_END
134
135 #endif
|