(file) Return to ProviderName.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / ProviderManager2

  1 karl  1.3 //%2003////////////////////////////////////////////////////////////////////////
  2 chip  1.1 //
  3 karl  1.3 // 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           // IBM Corp.; EMC Corporation, The Open Group.
  7 chip  1.1 //
  8           // Permission is hereby granted, free of charge, to any person obtaining a copy
  9           // of this software and associated documentation files (the "Software"), to
 10           // deal in the Software without restriction, including without limitation the
 11           // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 12           // sell copies of the Software, and to permit persons to whom the Software is
 13           // furnished to do so, subject to the following conditions:
 14 karl  1.3 // 
 15 chip  1.1 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 16           // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 17           // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 18           // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 19           // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 20           // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 21           // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 22           // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 23           //
 24           //==============================================================================
 25           //
 26           // Author: Chip Vincent (cvincent@us.ibm.com)
 27           //
 28           // Modified By:
 29           //
 30           //%/////////////////////////////////////////////////////////////////////////////
 31           
 32           #include "ProviderName.h"
 33           
 34           #include <Pegasus/Common/CIMValue.h>
 35           
 36 chip  1.1 PEGASUS_NAMESPACE_BEGIN
 37           
 38           ProviderName::ProviderName(void) : _capabilities(0)
 39           {
 40           }
 41           
 42           /*
 43           ProviderName::ProviderName(const String & providerName)
 44               : _capabilities(0)
 45           {
 46               // NOTE: format ::= <physical_name>::<logical_name>::<object_name>::<capabilities>
 47           
 48               String s = providerName;
 49           
 50               Uint32 beg = 0;
 51               Uint32 end = 0;
 52           
 53               // get physical name
 54               beg = 0;
 55               end = s.find("::");
 56           
 57 chip  1.1     String temp = s.subString(beg, end - beg);
 58               _physicalName = temp;
 59           
 60               s.remove(beg, end + 2); // skip past the "::"
 61               beg = end;
 62           
 63               // get logical name
 64               beg = 0;
 65               end = s.find("::");
 66           
 67               temp = s.subString(beg, end - beg);
 68               _logicalName = temp;
 69           
 70               s.remove(beg, end + 2); // skip past the "::"
 71               beg = end;
 72           
 73               // get object name
 74               beg = 0;
 75               end = s.find("::");
 76           
 77               temp = s.subString(beg, end - beg);
 78 chip  1.1     _objectName = temp;
 79           
 80               //s.remove(beg, end + 2); // skip past the "::"
 81               //beg = end;
 82           
 83               _objectName = temp;
 84           
 85               // get capabilities mask
 86               beg = 0;
 87               end = s.find("::");
 88           
 89               _physicalName = String(s.subString(beg, end - beg));
 90           }
 91           */
 92           
 93           ProviderName::ProviderName(
 94               const String & objectName,
 95               const String & logicalName,
 96               const String & physicalName,
 97               const String & interfaceName,
 98 schuur 1.6     const Uint32 capabilities,
 99                const CIMName & method)
100 schuur 1.5     : _capabilities(capabilities)
101 chip   1.1 {
102                // ATTN: validate arguments ???
103                _objectName = objectName;
104            
105                _logicalName = logicalName;
106            
107                _physicalName = physicalName;
108            
109                _interfaceName = interfaceName;
110 schuur 1.6     
111                _method = method;
112 chip   1.1 }
113            
114            ProviderName::~ProviderName(void)
115            {
116            }
117            
118 schuur 1.4 
119 chip   1.1 String ProviderName::toString(void) const
120            {
121                String s;
122            
123                s.append(_physicalName);
124                s.append("::");
125                s.append(_logicalName);
126                s.append("::");
127                s.append(_objectName);
128                //s.append("::");
129                //s.append(CIMValue(_capabilities).toString());
130            
131 schuur 1.5     return(s); 
132 chip   1.1 }
133 schuur 1.4 
134 chip   1.1 
135            String ProviderName::getPhysicalName(void) const
136            {
137                return(_physicalName);
138            }
139            
140            void ProviderName::setPhysicalName(const String & physicalName)
141            {
142                _physicalName = physicalName;
143            }
144            
145            String ProviderName::getLogicalName(void) const
146            {
147                return(_logicalName);
148            }
149            
150            void ProviderName::setLogicalName(const String & logicalName)
151            {
152                _logicalName = logicalName;
153            }
154            
155 chip   1.1 String ProviderName::getObjectName(void) const
156            {
157                return(_objectName);
158            }
159            
160            void ProviderName::setObjectName(const String & logicalName)
161            {
162                _logicalName = logicalName;
163            }
164            
165 chip   1.2 String ProviderName::getInterfaceName(void) const
166            {
167                return(_interfaceName);
168            }
169            
170            void ProviderName::setInterfaceName(const String & interfaceName)
171            {
172                _interfaceName = interfaceName;
173            }
174            
175 chip   1.1 Uint32 ProviderName::getCapabilitiesMask(void) const
176            {
177                return(_capabilities);
178            }
179            
180            void ProviderName::setCapabilitiesMask(const Uint32 capabilities)
181            {
182                _capabilities = capabilities;
183 schuur 1.6 }
184            
185            
186            CIMName ProviderName::getMethodName(void) const
187            {
188                return(_method);
189            }
190            
191            void ProviderName::setMethodName(const CIMName & method)
192            {
193                _method = method;
194 chip   1.1 }
195            
196            PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2