1 karl 1.7 //%2006////////////////////////////////////////////////////////////////////////
|
2 a.arora 1.2 //
|
3 karl 1.4 // 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 a.arora 1.2 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.4 // 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.5 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.7 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 a.arora 1.2 //
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 karl 1.4 //
|
21 a.arora 1.2 // 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: Marek Szermutzky (MSzermutzky@de.ibm.com) PEP#139 Stage2
33 //
|
34 r.kieninger 1.3 // Modified by: Robert Kieninger, IBM (kieningr@de.ibm.com) Bug#667
|
35 joyce.j 1.6 // Josephine Eskaline Joyce,IBM (jojustin@in.ibm.com) PEP#101
|
36 r.kieninger 1.3 //
|
37 a.arora 1.2 //%/////////////////////////////////////////////////////////////////////////////
38
39 #include "CIMClientConnection.h"
40
41 PEGASUS_NAMESPACE_BEGIN
42
43 // class constructor
44 CIMClientConnection::CIMClientConnection()
45 {
46 _hostname = String::EMPTY;
47 _port = String::EMPTY;
48 _userid = String::EMPTY;
49 _passwd = String::EMPTY;
|
50 joyce.j 1.6 _connectionHandle.reset(new CIMClientRep());
|
51 a.arora 1.2 _resolvedIP = 0xFFFFFFFF;
52 }
53
54 CIMClientConnection::CIMClientConnection(const String& host, const String& port, const String& userid, const String& passwd)
55 {
56 _hostname = String(host);
57 _port = String(port);
58 _userid = String(userid);
59 _passwd = String(passwd);
60
|
61 joyce.j 1.6 _connectionHandle.reset(new CIMClientRep());
|
62 r.kieninger 1.3 _resolvedIP = System::_acquireIP((const char*)host.getCString());
|
63 a.arora 1.2 if (_resolvedIP == 0x7F000001)
64 {
65 // localhost or ip address of 127.0.0.1
66 // still for compare we need the real ip address
|
67 r.kieninger 1.3 _resolvedIP = System::_acquireIP((const char *) System::getHostName().getCString());
|
68 a.arora 1.2 }
69 }
70
71 CIMClientConnection::CIMClientConnection(const String& host, const String& port, const String& userid, const String& passwd, const SSLContext& sslcontext)
72 {
73 _hostname = String(host);
74 _port = String(port);
75 _userid = String(userid);
76 _passwd = String(passwd);
77
|
78 joyce.j 1.6 _sslcontext.reset(new SSLContext(sslcontext));
|
79 a.arora 1.2
|
80 joyce.j 1.6 _connectionHandle.reset(new CIMClientRep());
|
81 r.kieninger 1.3 _resolvedIP = System::_acquireIP((const char*)host.getCString());
|
82 a.arora 1.2 if (_resolvedIP == 0x7F000001)
83 {
84 // localhost or ip address of 127.0.0.1
85 // still for compare we need the real ip address
|
86 r.kieninger 1.3 _resolvedIP = System::_acquireIP((const char *) System::getHostName().getCString());
|
87 a.arora 1.2 }
88 }
89
90 Boolean CIMClientConnection::equals(Uint32 ipAddress, const String& port)
91 {
92 // only if port and resolved ip address are equal we have the same connection/CIMOM
93 if ((ipAddress == _resolvedIP) && (String::equalNoCase(_port,port)))
94 {
95 return true;
96 }
97 return false;
98 }
99
100 CIMClientRep* CIMClientConnection::getConnectionHandle()
101 {
|
102 joyce.j 1.6 return _connectionHandle.get();
|
103 a.arora 1.2 }
104
105 String CIMClientConnection::getUser()
106 {
107 return _userid;
108 }
109
110 String CIMClientConnection::getPass()
111 {
112 return _passwd;
113 }
114
115 SSLContext* CIMClientConnection::getSSLContext()
116 {
|
117 joyce.j 1.6 return _sslcontext.get();
|
118 a.arora 1.2 }
119
120
121 PEGASUS_NAMESPACE_END
|