1 karl 1.52 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.15 //
|
3 karl 1.44 // 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 karl 1.37 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.44 // 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.46 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.52 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.15 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
15 mike 1.17 // 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 mike 1.15 // 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 kumpf 1.26 //
|
21 mike 1.17 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
22 mike 1.15 // 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 mike 1.17 // 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 mike 1.15 // 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: Mike Brasher (mbrasher@bmc.com)
33 //
34 // Modified By:
35 // Mike Day (mdday@us.ibm.com)
|
36 mike 1.17 // Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
|
37 kumpf 1.18 // Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
|
38 a.arora 1.41 // Amit K Arora, IBM (amita@in.ibm.com) for PEP#101
|
39 kumpf 1.45 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
40 mike 1.15 //
41 //%/////////////////////////////////////////////////////////////////////////////
42
43 #ifndef Pegasus_Server_h
44 #define Pegasus_Server_h
45
46 #include <Pegasus/Common/Config.h>
|
47 kumpf 1.28 #include <Pegasus/Common/InternalException.h>
|
48 mike 1.17 #include <Pegasus/Server/CIMServerState.h>
|
49 mday 1.19 #include <Pegasus/Common/Cimom.h>
|
50 kumpf 1.27 #include <Pegasus/Server/Linkage.h>
|
51 kumpf 1.30 #include <Pegasus/Common/SSLContext.h>
|
52 dave.sudlik 1.51 #include <Pegasus/Repository/CIMRepository.h>
|
53 kumpf 1.30
54 #include "HTTPAuthenticatorDelegator.h"
|
55 konrad.r 1.49 #include "ProviderMessageFacade.h"
|
56 mike 1.15 PEGASUS_NAMESPACE_BEGIN
57
58 struct ServerRep;
|
59 mike 1.17
60 class Monitor;
61 class CIMOperationRequestDispatcher;
62 class CIMOperationResponseEncoder;
63 class CIMOperationRequestDecoder;
|
64 kumpf 1.18 class CIMOperationRequestAuthorizer;
|
65 mike 1.17 class CIMExportRequestDispatcher;
66 class CIMExportResponseEncoder;
67 class CIMExportRequestDecoder;
68 class HTTPAcceptor;
|
69 kumpf 1.25 class CIMRepository;
|
70 mike 1.15
|
71 kumpf 1.30 class ModuleController;
|
72 kumpf 1.22 class IndicationHandlerService;
73 class IndicationService;
|
74 chip 1.21 class ProviderManagerService;
|
75 kumpf 1.25 class ProviderRegistrationManager;
|
76 mday 1.32 class BinaryMessageHandler;
|
77 nag.boranna 1.48 class SSLContextManager;
|
78 mday 1.32
|
79 chip 1.21
|
80 mike 1.15 class PEGASUS_SERVER_LINKAGE CIMServer
81 {
82 public:
83
84 enum Protocol { PROPRIETARY, STANDARD };
|
85 kumpf 1.45
|
86 mike 1.15 /** Constructor - Creates a CIMServer object.
87 The CIM Server objects establishes a repository object,
88 a dispatcher object, and creates a channnel factory and
89 acceptor for the Server.
|
90 mike 1.17 @param monitor monitor object for the server.
|
91 mike 1.15 @exception - ATTN
92 */
|
93 kumpf 1.31 CIMServer(Monitor* monitor);
|
94 mike 1.15
95 ~CIMServer();
|
96 mike 1.17
|
97 kumpf 1.31 /** Adds a connection acceptor for the specified listen socket.
98 @param localConnection Boolean specifying whether the acceptor should
99 listen on a local-system-only connection.
100 @param portNumber Port number that should be used by the listener.
101 This parameter is ignored if localConnection=true.
102 @param useSSL Boolean specifying whether SSL should be used for
103 connections created by this acceptor.
|
104 kumpf 1.40 @param exportConnection Boolean indicating whether this acceptor is
105 only for export connections. If true, client SSL certificate
106 verification is enabled on the export connection created by
107 this acceptor. Ignored when useSSL is false.
|
108 kumpf 1.31 */
109 void addAcceptor(
110 Boolean localConnection,
111 Uint32 portNumber,
|
112 kumpf 1.40 Boolean useSSL,
113 Boolean exportConnection);
|
114 kumpf 1.31
115 /** Bind the acceptors to the specified listen sockets.
|
116 mike 1.15 @exception - This function may receive exceptions from
117 Channel specific subfunctions.
118 */
|
119 kumpf 1.31 void bind();
|
120 mike 1.15
|
121 a.arora 1.43 void tickle_monitor();
122
|
123 mike 1.15 /** runForever Main runloop for the server.
124 */
125 void runForever();
126
|
127 mike 1.17 /** Call to gracefully shutdown the server. The server connection socket
128 will be closed to disable new connections from clients.
129 */
|
130 chip 1.21 void stopClientConnection();
|
131 mike 1.17
132 /** Call to gracefully shutdown the server. It is called when the server
|
133 chip 1.21 has been stopped and is ready to be shutdown. Next time runForever()
|
134 mike 1.17 is called, the server shuts down.
|
135 mike 1.15 */
|
136 mike 1.17 void shutdown();
137
|
138 carolann.graves 1.50 /** Returns true if the server is in the process of shutting down,
139 false otherwise.
|
140 mike 1.17 */
141 Boolean terminated() { return _dieNow; };
142
|
143 chip 1.21 /** Call to resume the sever.
|
144 mike 1.17 */
145 void resume();
146
|
147 chip 1.21 /** Call to set the CIMServer state. Also inform the appropriate
|
148 mike 1.17 message queues about the current state of the CIMServer.
149 */
150 void setState(Uint32 state);
151
152 Uint32 getOutstandingRequestCount();
153
|
154 s.hills 1.36 /** Signal to shutdown
155 */
|
156 a.arora 1.43 static void shutdownSignal();
|
157 s.hills 1.36
|
158 tony 1.42 /** startSLPProvider is a temporary function to get this
159 provider started as part of system startup.
160 This MUST be replaced with something more permanent.
161 */
162 void startSLPProvider();
163
|
164 mike 1.15 private:
|
165 mike 1.17 Boolean _dieNow;
166
|
167 tony 1.42 #ifdef PEGASUS_ENABLE_SLP
168 Boolean _runSLP;
169 #endif
170
|
171 mike 1.17 Monitor* _monitor;
|
172 kumpf 1.25 CIMRepository* _repository;
|
173 mike 1.17 CIMOperationRequestDispatcher* _cimOperationRequestDispatcher;
174 CIMOperationResponseEncoder* _cimOperationResponseEncoder;
175 CIMOperationRequestDecoder* _cimOperationRequestDecoder;
|
176 kumpf 1.18 CIMOperationRequestAuthorizer* _cimOperationRequestAuthorizer;
|
177 mike 1.17
178 CIMExportRequestDispatcher* _cimExportRequestDispatcher;
179 CIMExportResponseEncoder* _cimExportResponseEncoder;
180 CIMExportRequestDecoder* _cimExportRequestDecoder;
|
181 kumpf 1.30 HTTPAuthenticatorDelegator* _httpAuthenticatorDelegator;
|
182 mike 1.17
|
183 kumpf 1.31 Array<HTTPAcceptor*> _acceptors;
|
184 konrad.r 1.49 Array<ProviderMessageFacade*> _controlProviders;
|
185 a.arora 1.41 AutoPtr<CIMServerState> _serverState; //PEP101
|
186 chip 1.21
|
187 kumpf 1.30 ModuleController* _controlService;
|
188 kumpf 1.25 IndicationHandlerService* _handlerService;
189 IndicationService* _indicationService;
190 ProviderManagerService* _providerManager;
191 ProviderRegistrationManager* _providerRegistrationManager;
|
192 mday 1.32 BinaryMessageHandler *_binaryMessageHandler;
|
193 nag.boranna 1.47 SSLContextManager* _sslContextMgr;
|
194 mday 1.33
195 void _init(void);
|
196 nag.boranna 1.48 SSLContext* _getSSLContext(Uint32 contextType);
|
197 mike 1.15 };
198
199 PEGASUS_NAMESPACE_END
200
201 #endif /* Pegasus_Server_h */
|