1 karl 1.11 //%2006////////////////////////////////////////////////////////////////////////
|
2 kumpf 1.1 //
|
3 karl 1.7 // 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.3 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.7 // 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.8 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.11 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 kumpf 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 kumpf 1.2 //
|
21 kumpf 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: Mike Brasher (mbrasher@bmc.com)
33 //
34 // Modified By:
|
35 kumpf 1.5 // Mike Day (mdday@us.ibm.com)
|
36 kumpf 1.1 // Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)
37 // Nag Boranna, Hewlett-Packard Company (nagaraja_boranna@hp.com)
|
38 dj.gorey 1.4 // Dan Gorey (djgorey@us.ibm.com)
|
39 kumpf 1.5 // Terry Martin, Hewlett-Packard Company (terry.martin@hp.com)
|
40 a.arora 1.6 // Amit K Arora, IBM (amita@in.ibm.com) for PEP#101
|
41 mateus.baur 1.9 // Mateus Baur, Hewlett-Packard Company (mateus.baur@hp.com)
|
42 dj.gorey 1.4 //
|
43 kumpf 1.1 //%/////////////////////////////////////////////////////////////////////////////
44
45 #ifndef Pegasus_Server_h
46 #define Pegasus_Server_h
47
48 #include <Pegasus/Common/Config.h>
49 #include <Pegasus/Common/InternalException.h>
50 #include <Pegasus/Server/CIMServerState.h>
51 #include <Pegasus/Common/Cimom.h>
52 #include <Pegasus/Server/Linkage.h>
|
53 kumpf 1.2 #include <Pegasus/Common/SSLContext.h>
|
54 a.arora 1.6 #include <Pegasus/Common/AutoPtr.h>
|
55 kumpf 1.2
56 #include "HTTPAuthenticatorDelegator.h"
|
57 kumpf 1.1
58 PEGASUS_NAMESPACE_BEGIN
59
60 struct ServerRep;
61
62 class Monitor;
63 class CIMOperationRequestDispatcher;
64 class CIMOperationResponseEncoder;
65 class CIMOperationRequestDecoder;
66 class CIMOperationRequestAuthorizer;
67 class CIMExportRequestDispatcher;
68 class CIMExportResponseEncoder;
69 class CIMExportRequestDecoder;
70 class HTTPAcceptor;
71 class CIMRepository;
72
|
73 mateus.baur 1.10 /*class ModuleController;
|
74 kumpf 1.2 class IndicationHandlerService;
75 class IndicationService;
|
76 kumpf 1.1 class ProviderManagerService;
77 class ProviderRegistrationManager;
|
78 mateus.baur 1.10 class BinaryMessageHandler;*/
|
79 mateus.baur 1.9 class SSLContextManager;
80
|
81 kumpf 1.1
82 class PEGASUS_SERVER_LINKAGE CIMServer
83 {
84 public:
85
86 enum Protocol { PROPRIETARY, STANDARD };
|
87 mateus.baur 1.9
|
88 kumpf 1.1 /** Constructor - Creates a CIMServer object.
89 The CIM Server objects establishes a repository object,
90 a dispatcher object, and creates a channnel factory and
91 acceptor for the Server.
92 @param monitor monitor object for the server.
93 @exception - ATTN
94 */
|
95 kumpf 1.2 CIMServer(Monitor* monitor);
|
96 mateus.baur 1.9
|
97 kumpf 1.1 ~CIMServer();
98
|
99 kumpf 1.2 /** Adds a connection acceptor for the specified listen socket.
100 @param localConnection Boolean specifying whether the acceptor should
101 listen on a local-system-only connection.
102 @param portNumber Port number that should be used by the listener.
103 This parameter is ignored if localConnection=true.
104 @param useSSL Boolean specifying whether SSL should be used for
105 connections created by this acceptor.
|
106 kumpf 1.5 @param exportConnection Boolean indicating whether this acceptor is
107 only for export connections. If true, client SSL certificate
108 verification is enabled on the export connection created by
109 this acceptor. Ignored when useSSL is false.
|
110 kumpf 1.2 */
111 void addAcceptor(
112 Boolean localConnection,
113 Uint32 portNumber,
|
114 kumpf 1.5 Boolean useSSL,
115 Boolean exportConnection);
|
116 kumpf 1.2
117 /** Bind the acceptors to the specified listen sockets.
|
118 kumpf 1.1 @exception - This function may receive exceptions from
119 Channel specific subfunctions.
120 */
|
121 kumpf 1.2 void bind();
|
122 kumpf 1.1
|
123 mateus.baur 1.9 void tickle_monitor();
|
124 kumpf 1.5
|
125 kumpf 1.1 /** runForever Main runloop for the server.
126 */
127 void runForever();
128
129 /** Call to gracefully shutdown the server. The server connection socket
130 will be closed to disable new connections from clients.
131 */
132 void stopClientConnection();
133
134 /** Call to gracefully shutdown the server. It is called when the server
135 has been stopped and is ready to be shutdown. Next time runForever()
136 is called, the server shuts down.
137 */
138 void shutdown();
139
140 /** Return true if the server has shutdown, false otherwise.
141 */
142 Boolean terminated() { return _dieNow; };
143
144 /** Call to resume the sever.
145 */
146 kumpf 1.1 void resume();
147
148 /** Call to set the CIMServer state. Also inform the appropriate
149 message queues about the current state of the CIMServer.
150 */
151 void setState(Uint32 state);
152
153 Uint32 getOutstandingRequestCount();
154
|
155 kumpf 1.5 /** Signal to shutdown
156 */
|
157 mateus.baur 1.9 static void shutdownSignal();
|
158 kumpf 1.5
|
159 kumpf 1.2 private:
|
160 kumpf 1.1
161 Boolean _dieNow;
162
163 Monitor* _monitor;
164 CIMRepository* _repository;
|
165 mateus.baur 1.10 CIMOperationRequestDispatcher* _cimOperationRequestDispatcher;
|
166 kumpf 1.1 CIMOperationResponseEncoder* _cimOperationResponseEncoder;
167 CIMOperationRequestDecoder* _cimOperationRequestDecoder;
168 CIMOperationRequestAuthorizer* _cimOperationRequestAuthorizer;
169
170 CIMExportRequestDispatcher* _cimExportRequestDispatcher;
171 CIMExportResponseEncoder* _cimExportResponseEncoder;
172 CIMExportRequestDecoder* _cimExportRequestDecoder;
|
173 kumpf 1.2 HTTPAuthenticatorDelegator* _httpAuthenticatorDelegator;
|
174 kumpf 1.1
|
175 kumpf 1.2 Array<HTTPAcceptor*> _acceptors;
|
176 a.arora 1.6 AutoPtr<CIMServerState> _serverState; //PEP101
|
177 kumpf 1.1
|
178 mateus.baur 1.10 /*ModuleController* _controlService;
|
179 kumpf 1.2 IndicationHandlerService* _handlerService;
180 IndicationService* _indicationService;
181 ProviderManagerService* _providerManager;
182 ProviderRegistrationManager* _providerRegistrationManager;
|
183 mateus.baur 1.10 BinaryMessageHandler *_binaryMessageHandler;*/
|
184 mateus.baur 1.9 SSLContextManager* _sslContextMgr;
|
185 kumpf 1.5
|
186 mateus.baur 1.9 void _init(void);
187 SSLContext* _getSSLContext(Uint32 contextType);
|
188 kumpf 1.1 };
189
190 PEGASUS_NAMESPACE_END
191
192 #endif /* Pegasus_Server_h */
|