Return to WbemExecClient.h CVS log | Up to [Pegasus] / pegasus / src / Clients / wbemexec |
File: [Pegasus] / pegasus / src / Clients / wbemexec / WbemExecClient.h
(download)
Revision: 1.22, Sun Oct 17 19:39:13 2004 UTC (19 years, 8 months ago) by karl Branch: MAIN CVS Tags: RELEASE_2_4_1-BETA3, RELEASE_2_4_1-BETA2, RELEASE_2_4_1-BETA1, RELEASE_2_4_1, RELEASE_2_4_0-RC3, RELEASE_2_4_0-RC2, RELEASE_2_4_0, RELEASE_2_4-root, PEP213_SIZE_OPTIMIZATIONS, IBM_241_April1405, CHUNKTESTDONE_PEP140 Branch point for: RELEASE_2_4-branch Changes since 1.21: +6 -4 lines BUG#: 2196 TITLE: Copyright update DESCRIPTION: Update all .cpp and .h files for new license and update the doc/license.txt file. Note that there were also a couple of files that had to be fixed because they had violated the comments rules (ex. blank line at head of file or in the case of xmlwriter.cpp a comment line //========= which drove the strip function nuts. These were fixed. This has been compiled and tested on windows. |
//%2004//////////////////////////////////////////////////////////////////////// // // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems. // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.; // IBM Corp.; EMC Corporation, The Open Group. // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.; // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to // deal in the Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or // sell copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // //============================================================================== // // Author: Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) // // Modified By: Warren Otsuka, Hewlett-Packard Company (warren_otsuka@hp.com) // Carol Ann Krug Graves, Hewlett-Packard Company // (carolann_graves@hp.com) // Dan Gorey, IBM (djgorey@us.ibm.com) // Amit K Arora (amita@in.ibm.com) for PEP-101 // //%///////////////////////////////////////////////////////////////////////////// #ifndef Pegasus_WbemExecClient_h #define Pegasus_WbemExecClient_h #include <fstream> #include <Pegasus/Common/Config.h> #include <Pegasus/Common/String.h> #include <Pegasus/Common/Monitor.h> #include <Pegasus/Common/HTTPConnector.h> #include <Pegasus/Common/SSLContext.h> #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/CIMMessage.h> #include <Pegasus/Common/Exception.h> #include <Pegasus/Common/AutoPtr.h> #include <Pegasus/Client/ClientAuthenticator.h> PEGASUS_NAMESPACE_BEGIN /** This class provides the interface that a client uses to communicate with a CIMOM. */ class WbemExecClient : public MessageQueue { public: enum { DEFAULT_TIMEOUT_MILLISECONDS = 20000 }; /** Constructor for a CIM Client object. @param timeoutMilliseconds Defines the number of milliseconds the WbemExecClient will wait for a response to an outstanding request. If a request times out, the connection gets reset (disconnected and reconnected). Default is 20 seconds (20000 milliseconds). */ WbemExecClient(Uint32 timeoutMilliseconds = DEFAULT_TIMEOUT_MILLISECONDS); /// virtual ~WbemExecClient(); /** TBD */ // ATTN-RK-P3-20020416: This should be hidden from client apps virtual void handleEnqueue(); /** TBD */ Uint32 getTimeout() const { return _timeoutMilliseconds; } /** Sets the timeout in milliseconds for the WbemExecClient. */ void setTimeout(Uint32 timeoutMilliseconds) { _timeoutMilliseconds = timeoutMilliseconds; } /** connect - Creates an HTTP connection with the server defined by the URL in address. @param host - String defining the server to which the client should connect @param portNumber - Uint32 defining the port number for the server to which the client should connect @param userName - String containing the name of the user the client is connecting as. @param password - String containing the password of the user the client is connecting as. @return - No return defined. Failure to connect throws an exception @exception AlreadyConnectedException If a connection has already been established. @exception InvalidLocatorException If the specified address is improperly formed. @exception CannotCreateSocketException If a socket cannot be created. @exception CannotConnectException If the socket connection fails. <PRE> TBD </PRE> */ inline void connect( const String& host, const Uint32 portNumber, const String& userName, const String& password ) throw(AlreadyConnectedException, InvalidLocatorException, CannotCreateSocketException, CannotConnectException) { AutoPtr<SSLContext> sslContext; connect(host, portNumber, sslContext, userName, password); } /** connect - Creates an HTTP connection with the server defined by the URL in address. @param host - String defining the server to which the client should connect @param portNumber - Uint32 defining the port number for the server to which the client should connect @param sslContext - The SSL context to use for this connection @param userName - String containing the name of the user the client is connecting as. @param password - String containing the password of the user the client is connecting as. @return - No return defined. Failure to connect throws an exception @exception AlreadyConnectedException If a connection has already been established. @exception InvalidLocatorException If the specified address is improperly formed. @exception CannotCreateSocketException If a socket cannot be created. @exception CannotConnectException If the socket connection fails. <PRE> TBD </PRE> */ void connect( const String& host, const Uint32 portNumber, AutoPtr<SSLContext>& sslContext, const String& userName, const String& password ) throw(AlreadyConnectedException, InvalidLocatorException, CannotCreateSocketException, CannotConnectException); /** connectLocal - Creates connection to the server for Local clients. The connectLocal connects to the CIM server running on the local system in the default location. The connection is automatically authenticated for the current user. @return - No return defined. Failure to connect throws an exception. @SeeAlso connect - The exceptions are defined in connect. */ void connectLocal() throw(AlreadyConnectedException, InvalidLocatorException, CannotCreateSocketException, CannotConnectException); /** disconnect - Closes the connection with the server if the connection was open, simply returns if the connection was not open. Clients are expected to use this method to close the open connection before opening a new connection. @return - No return defined. */ void disconnect(); /** ATTN TBD */ Array<Sint8> issueRequest( const Array<Sint8>& request ) throw(NotConnectedException, ConnectionTimeoutException, UnauthorizedAccess); private: void _connect( const String& host, const Uint32 portNumber, AutoPtr<SSLContext>& sslContext) throw(CannotCreateSocketException, CannotConnectException, InvalidLocatorException); Message* _doRequest(HTTPMessage * request) throw(ConnectionTimeoutException); void _addAuthHeader(HTTPMessage*& httpMessage); Boolean _checkNeedToResend(HTTPMessage* httpMessage); String _getLocalHostName(); String _promptForPassword(); #ifdef PEGASUS_USE_23HTTPMONITOR_CLIENT AutoPtr<Monitor> _monitor;//PEP101 AutoPtr<HTTPConnector> _httpConnector;//PEP101 AutoPtr<HTTPConnection> _httpConnection;//PEP101 #else AutoPtr<monitor_2> _monitor;//PEP101 AutoPtr<HTTPConnector2> _httpConnector;//PEP101 AutoPtr<HTTPConnection2> _httpConnection;//PEP101 #endif Uint32 _timeoutMilliseconds; Boolean _connected; ClientAuthenticator _authenticator; Boolean _isRemote; /** The password to be used for authorization of the operation. */ String _password; }; PEGASUS_NAMESPACE_END #endif /* Pegasus_WbemExecClient_h */
No CVS admin address has been configured |
Powered by ViewCVS 0.9.2 |