(file) Return to HTTPConnector.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

  1 karl  1.22 //%2006////////////////////////////////////////////////////////////////////////
  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 karl  1.22 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.2  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 kumpf 1.11 // 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.2  // 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            // 
 21 kumpf 1.11 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike  1.2  // 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 kumpf 1.11 // 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.2  // 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 kumpf 1.16 // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company
 35            //                (carolann_graves@hp.com)
 36 dj.gorey 1.18 //              Dan Gorey, IBM (djgorey@us.ibm.com)
 37 kumpf    1.20 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)
 38 mike     1.2  //
 39               //%/////////////////////////////////////////////////////////////////////////////
 40               
 41               #ifndef Pegasus_HTTPConnector_h
 42               #define Pegasus_HTTPConnector_h
 43               
 44               #include <Pegasus/Common/Config.h>
 45 kumpf    1.23 #include <Pegasus/Common/MessageQueue.h>
 46 mike     1.2  #include <Pegasus/Common/Monitor.h>
 47               #include <Pegasus/Common/String.h>
 48               #include <Pegasus/Common/TLS.h>
 49 kumpf    1.13 #include <Pegasus/Common/Linkage.h>
 50 mike     1.2  
 51               PEGASUS_NAMESPACE_BEGIN
 52               
 53               struct HTTPConnectorRep;
 54 dj.gorey 1.18 
 55 mike     1.2  class HTTPConnection;
 56               
 57               /** This class is used by clients to establish a connection with a
 58                   server. For each established connection, a HTTPConnection object
 59                   is created.
 60               */
 61 kumpf    1.23 class PEGASUS_COMMON_LINKAGE HTTPConnector : public MessageQueue
 62 mike     1.2  {
 63 mday     1.4     public:
 64 mday     1.3     
 65 kumpf    1.23       typedef MessageQueue Base;
 66 mday     1.3    
 67 mday     1.4        /** Constructor.
 68               	  @param monitor pointer to monitor object which this class uses to
 69               	  solicit SocketMessages on the server port (socket).
 70               	  @param outputMessageQueue ouptut message queue for connections
 71               	  created by this connector.
 72                     */
 73                     HTTPConnector(Monitor* monitor);
 74               
 75                     HTTPConnector(Monitor* monitor, SSLContext * sslcontext);
 76 dj.gorey 1.18    
 77 mday     1.4        /** Destructor. */
 78                     ~HTTPConnector();
 79               
 80                     /** This method is called whenever a SocketMessage is enqueued
 81               	  on the input queue of the HTTPConnector object.
 82                     */ 
 83               
 84                     virtual void handleEnqueue(Message *);
 85                     virtual void handleEnqueue();
 86               
 87                     /** Establishes a new connection and creates an HTTPConnection object
 88               	  to represent it.
 89               
 90 kumpf    1.16 	  @param host indicates host to connect to
 91               	  @param portNumber indicates port number to use
 92 mday     1.4  	  @param outputMessageQueue output message queue for the HTTPConnection
 93               	  that will be created.
 94 kumpf    1.14 	  @exception InvalidLocatorException
 95               	  @exception CannotCreateSocketException
 96               	  @exception CannotConnectException
 97 mday     1.4        */
 98 kumpf    1.7        inline HTTPConnection* connect(
 99 kumpf    1.16          const String& host, 
100                        const Uint32 portNumber,
101 kumpf    1.7  	 MessageQueue* outputMessageQueue)
102                     {
103 kumpf    1.16           return connect(host, portNumber, NULL, outputMessageQueue);
104 kumpf    1.7        }
105               
106                     /** Establishes a new connection and creates an HTTPConnection object
107               	  to represent it.
108               
109 kumpf    1.16 	  @param host indicates host to connect to
110               	  @param portNumber indicates port number to use
111 kumpf    1.7  	  @param sslContext Specifies the SSL context to use for this connection
112               	  @param outputMessageQueue output message queue for the HTTPConnection
113               	  that will be created.
114 kumpf    1.14 	  @exception InvalidLocatorException
115               	  @exception CannotCreateSocketException
116               	  @exception CannotConnectException
117 kumpf    1.7        */
118 mday     1.4        HTTPConnection* connect(
119 kumpf    1.16          const String& host, 
120                        const Uint32 portNumber,
121 kumpf    1.7  	 SSLContext * sslContext,
122 mday     1.4  	 MessageQueue* outputMessageQueue);
123 mike     1.2  
124 mday     1.4        /** Destroys all the connections created by this connector. */
125                     void destroyConnections();
126 mike     1.2  
127 kumpf    1.5        /** Close the specified connection. */
128                     void disconnect(HTTPConnection* connection);
129               
130 mday     1.4     private:
131 mike     1.2  
132 kumpf    1.6        /** Delete the specified connection. */
133                     void _deleteConnection(HTTPConnection* httpConnection);
134               
135 kamal.locahana 1.23.14.1 // Added for NamedPipe implementation for windows
136                          #if defined PEGASUS_OS_TYPE_WINDOWS && !defined(PEGASUS_DISABLE_LOCAL_DOMAIN_SOCKET)
137                                /** Used for local connections on windows */
138                                HTTPConnection* _connectNamedPipe(MessageQueue* outputMessageQueue);
139                          #endif
140 mday           1.4             Monitor* _monitor;
141                                HTTPConnectorRep* _rep;
142 dj.gorey       1.18          
143                                SSLContext * _sslcontext;
144                                int _entry_index;
145                                
146                          };
147                          
148 mike           1.2       PEGASUS_NAMESPACE_END
149                          
150                          #endif /* Pegasus_HTTPConnector_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2