1 karl 1.17 //%2006////////////////////////////////////////////////////////////////////////
|
2 schuur 1.1 //
|
3 karl 1.9 // 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 schuur 1.1 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.9 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.10 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.17 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 schuur 1.1 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 mark.hamzy 1.17.2.1 //
|
21 schuur 1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 // Author: Adrian Schuur, schuur@de.ibm.com
33 //
34 // Modified By:
35 //
36 //%/////////////////////////////////////////////////////////////////////////////
37
38 #ifndef Pegasus_JMPIProviderManager_h
39 #define Pegasus_JMPIProviderManager_h
40
41 #include <Pegasus/Common/Config.h>
42 schuur 1.1 #include <Pegasus/Common/HashTable.h>
43 #include <Pegasus/ProviderManager2/ProviderName.h>
44 #include <Pegasus/ProviderManager2/ProviderManager.h>
45 #include <Pegasus/Server/Linkage.h>
46 #include <Pegasus/Config/ConfigManager.h>
47 #include <Pegasus/ProviderManager2/OperationResponseHandler.h>
|
48 kumpf 1.2 #include <Pegasus/Common/OperationContextInternal.h>
|
49 kumpf 1.5 #include <Pegasus/ProviderManager2/JMPI/JMPILocalProviderManager.h>
|
50 konrad.r 1.12 #include <Pegasus/Provider/CIMOMHandleQueryContext.h>
|
51 mark.hamzy 1.17.2.3 #include <Pegasus/WQL/WQLSelectStatement.h>
52 #include <Pegasus/WQL/WQLParser.h>
|
53 schuur 1.1
54 PEGASUS_NAMESPACE_BEGIN
55
|
56 konrad.r 1.13 struct CMPI_SelectExp;
|
57 schuur 1.1
58 class PEGASUS_SERVER_LINKAGE JMPIProviderManager : public ProviderManager
59 {
60 public:
|
61 mark.hamzy 1.14 enum Mode {
|
62 schuur 1.1 CMPI_MODE,
63 CMPI_R_MODE,
64 CMPI_O_MODE
65 };
66
67 Mode getMode() { return mode; }
68 JMPIProviderManager(Mode=CMPI_MODE);
69 virtual ~JMPIProviderManager(void);
|
70 mark.hamzy 1.14
71 virtual Boolean insertProvider(const ProviderName & providerName,
|
72 schuur 1.1 const String &ns, const String &cn);
|
73 mark.hamzy 1.14
|
74 schuur 1.1 virtual Message * processMessage(Message * request) throw();
75
76 static String resolveFileName(String name);
77
|
78 kumpf 1.5 virtual Boolean hasActiveProviders();
79 virtual void unloadIdleProviders();
|
80 mark.hamzy 1.14
|
81 mark.hamzy 1.17.2.2 class indProvRecord
82 {
83 public:
84 indProvRecord ()
85 {
86 enabled = false;
87 count = 0;
88 ctx = NULL;
89 handler = NULL;
90 }
91
92 mutable Mutex mutex;
93 Boolean enabled;
94 int count;
95 OperationContext *ctx;
96 EnableIndicationsResponseHandler *handler;
97 };
98
99 class indSelectRecord
100 {
101 public:
102 mark.hamzy 1.17.2.2 indSelectRecord ()
103 {
104 qContext = NULL;
105 }
106
107 CIMOMHandleQueryContext *qContext;
108 String query;
109 String queryLanguage;
110 CIMPropertyList propertyList;
111 };
112
113 typedef HashTable<String, indProvRecord*, EqualFunc<String>, HashFunc<String> > IndProvTab;
114 typedef HashTable<String, indSelectRecord*, EqualFunc<String>, HashFunc<String> > IndSelectTab;
115 typedef HashTable<String, ProviderName, EqualFunc<String>, HashFunc<String> > ProvRegistrar;
116
117 static Mutex mutexProvTab;
118 static IndProvTab provTab;
119 static Mutex mutexSelxTab;
120 static IndSelectTab selxTab;
121 static Mutex mutexProvReg;
122 static ProvRegistrar provReg;
|
123 mark.hamzy 1.14
|
124 schuur 1.1 protected:
|
125 kumpf 1.5 JMPILocalProviderManager providerManager;
|
126 schuur 1.1 Mode mode;
127
128 Message * handleUnsupportedRequest(const Message * message) throw();
129
130 Message * handleGetInstanceRequest(const Message * message) throw();
131 Message * handleEnumerateInstancesRequest(const Message * message) throw();
132 Message * handleEnumerateInstanceNamesRequest(const Message * message) throw();
133 Message * handleCreateInstanceRequest(const Message * message) throw();
134 Message * handleModifyInstanceRequest(const Message * message) throw();
135 Message * handleDeleteInstanceRequest(const Message * message) throw();
136
|
137 mark.hamzy 1.15 Message * handleExecQueryRequest(const Message * message) throw();
|
138 schuur 1.1
|
139 mark.hamzy 1.15 Message * handleAssociatorsRequest(const Message * message) throw();
|
140 schuur 1.1 Message * handleAssociatorNamesRequest(const Message * message) throw();
141 Message * handleReferencesRequest(const Message * message) throw();
142 Message * handleReferenceNamesRequest(const Message * message) throw();
|
143 mark.hamzy 1.15
|
144 mark.hamzy 1.16 Message * handleGetPropertyRequest(const Message * message) throw();
145 Message * handleSetPropertyRequest(const Message * message) throw();
|
146 mark.hamzy 1.15
|
147 schuur 1.1 Message * handleInvokeMethodRequest(const Message * message) throw();
|
148 schuur 1.8
|
149 schuur 1.1 Message * handleCreateSubscriptionRequest(const Message * message) throw();
|
150 mark.hamzy 1.15 ////Message * handleModifySubscriptionRequest(const Message * message) throw();
|
151 schuur 1.1 Message * handleDeleteSubscriptionRequest(const Message * message) throw();
|
152 schuur 1.8
|
153 mark.hamzy 1.15 ////Not supported by JMPI
154 ////Message * handleExportIndicationRequest(const Message * message) throw();
|
155 schuur 1.1
156 Message * handleDisableModuleRequest(const Message * message) throw();
157 Message * handleEnableModuleRequest(const Message * message) throw();
158 Message * handleStopAllProvidersRequest(const Message * message) throw();
|
159 kumpf 1.3 Message * handleInitializeProviderRequest(const Message * message);
|
160 carolann.graves 1.11 Message * handleSubscriptionInitCompleteRequest (const Message * message);
|
161 schuur 1.1
|
162 kumpf 1.2 ProviderName _resolveProviderName(const ProviderIdContainer & providerId);
|
163 mark.hamzy 1.14
164 private:
165 void debugPrintMethodPointers (JNIEnv *env, jclass jc);
|
166 mark.hamzy 1.17.2.1 bool getInterfaceType (ProviderIdContainer pidc,
167 String& interfaceType,
168 String& interfaceVersion);
169 bool interfaceIsUsed (JNIEnv *env,
170 jobject jObject,
171 String searchInterfaceName);
|
172 mark.hamzy 1.14
173 static int trace;
|
174 schuur 1.1 };
175
176 PEGASUS_NAMESPACE_END
177
178 #endif
|