1 karl 1.21 //%2005////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 karl 1.19 // 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.17 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.19 // 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.21 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 mike 1.2 //
12 // Permission is hereby granted, free of charge, to any person obtaining a copy
|
13 kumpf 1.11 // of this software and associated documentation files (the "Software"), to
14 // deal in the Software without restriction, including without limitation the
15 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
16 mike 1.2 // sell copies of the Software, and to permit persons to whom the Software is
17 // furnished to do so, subject to the following conditions:
18 //
|
19 kumpf 1.11 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
|
20 mike 1.2 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
21 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
22 kumpf 1.11 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
23 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
24 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
25 mike 1.2 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 //==============================================================================
29 //
30 // Author: Mike Brasher (mbrasher@bmc.com)
31 //
|
32 kumpf 1.16 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
33 // (carolann_graves@hp.com)
|
34 dj.gorey 1.18 // Dan Gorey, IBM (djgorey@us.ibm.com)
|
35 kumpf 1.20 // Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
|
36 mike 1.2 //
37 //%/////////////////////////////////////////////////////////////////////////////
38
39 #ifndef Pegasus_HTTPConnector_h
40 #define Pegasus_HTTPConnector_h
41
42 #include <Pegasus/Common/Config.h>
|
43 mday 1.3 #include <Pegasus/Common/MessageQueueService.h>
|
44 mike 1.2 #include <Pegasus/Common/Monitor.h>
45 #include <Pegasus/Common/String.h>
46 #include <Pegasus/Common/TLS.h>
|
47 kumpf 1.13 #include <Pegasus/Common/Linkage.h>
|
48 mike 1.2
49 PEGASUS_NAMESPACE_BEGIN
50
51 struct HTTPConnectorRep;
|
52 dj.gorey 1.18
|
53 mike 1.2 class HTTPConnection;
54
55 /** This class is used by clients to establish a connection with a
56 server. For each established connection, a HTTPConnection object
57 is created.
58 */
|
59 mday 1.10 class PEGASUS_COMMON_LINKAGE HTTPConnector : public MessageQueueService
|
60 mike 1.2 {
|
61 mday 1.4 public:
|
62 mday 1.3
|
63 mday 1.10 typedef MessageQueueService Base;
|
64 mday 1.3
|
65 mday 1.4 /** Constructor.
66 @param monitor pointer to monitor object which this class uses to
67 solicit SocketMessages on the server port (socket).
68 @param outputMessageQueue ouptut message queue for connections
69 created by this connector.
70 */
71 HTTPConnector(Monitor* monitor);
72
73 HTTPConnector(Monitor* monitor, SSLContext * sslcontext);
|
74 dj.gorey 1.18
|
75 mday 1.4 /** Destructor. */
76 ~HTTPConnector();
77
78 /** This method is called whenever a SocketMessage is enqueued
79 on the input queue of the HTTPConnector object.
80 */
81
82 virtual void handleEnqueue(Message *);
83 virtual void handleEnqueue();
84
85 /** Establishes a new connection and creates an HTTPConnection object
86 to represent it.
87
|
88 kumpf 1.16 @param host indicates host to connect to
89 @param portNumber indicates port number to use
|
90 mday 1.4 @param outputMessageQueue output message queue for the HTTPConnection
91 that will be created.
|
92 kumpf 1.14 @exception InvalidLocatorException
93 @exception CannotCreateSocketException
94 @exception CannotConnectException
|
95 mday 1.4 */
|
96 kumpf 1.7 inline HTTPConnection* connect(
|
97 kumpf 1.16 const String& host,
98 const Uint32 portNumber,
|
99 kumpf 1.7 MessageQueue* outputMessageQueue)
100 {
|
101 kumpf 1.16 return connect(host, portNumber, NULL, outputMessageQueue);
|
102 kumpf 1.7 }
103
104 /** Establishes a new connection and creates an HTTPConnection object
105 to represent it.
106
|
107 kumpf 1.16 @param host indicates host to connect to
108 @param portNumber indicates port number to use
|
109 kumpf 1.7 @param sslContext Specifies the SSL context to use for this connection
110 @param outputMessageQueue output message queue for the HTTPConnection
111 that will be created.
|
112 kumpf 1.14 @exception InvalidLocatorException
113 @exception CannotCreateSocketException
114 @exception CannotConnectException
|
115 kumpf 1.7 */
|
116 mday 1.4 HTTPConnection* connect(
|
117 kumpf 1.16 const String& host,
118 const Uint32 portNumber,
|
119 kumpf 1.7 SSLContext * sslContext,
|
120 mday 1.4 MessageQueue* outputMessageQueue);
|
121 mike 1.2
|
122 mday 1.4 /** Destroys all the connections created by this connector. */
123 void destroyConnections();
|
124 mike 1.2
|
125 kumpf 1.5 /** Close the specified connection. */
126 void disconnect(HTTPConnection* connection);
127
|
128 mday 1.4 private:
|
129 mike 1.2
|
130 kumpf 1.6 /** Delete the specified connection. */
131 void _deleteConnection(HTTPConnection* httpConnection);
132
|
133 mday 1.4 Monitor* _monitor;
134 HTTPConnectorRep* _rep;
|
135 dj.gorey 1.18
136 SSLContext * _sslcontext;
137 int _entry_index;
138
139 };
140
|
141 mike 1.2 PEGASUS_NAMESPACE_END
142
143 #endif /* Pegasus_HTTPConnector_h */
|