Array<CIMKeyBinding> UNIX_CompositeExtentProvider::constructKeyBindings(const UNIX_CompositeExtent& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_SYSTEM_CREATION_CLASS_NAME, _p.getSystemCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_SYSTEM_NAME, _p.getSystemName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, _p.getCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_DEVICE_ID, _p.getDeviceID(), CIMKeyBinding::STRING)); return keys; }
CIMObjectPath OperatingSystemProvider::_fill_reference(const CIMNamespaceName &nameSpace, const CIMName &className) { Array<CIMKeyBinding> keys; OperatingSystem os; String csName; String name; if (!os.getCSName(csName)) { throw CIMOperationFailedException("OperatingSystemProvider " "can't determine name of computer system"); } if (!os.getName(name)) { throw CIMOperationFailedException("OperatingSystemProvider " "can't determine name of Operating System"); } keys.append(CIMKeyBinding("CSCreationClassName", CSCREATIONCLASSNAME.getString(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding("CSName", csName, CIMKeyBinding::STRING)); keys.append(CIMKeyBinding("CreationClassName", STANDARDOPERATINGSYSTEMCLASS.getString(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding("Name", name, CIMKeyBinding::STRING)); return CIMObjectPath(csName, nameSpace, className, keys); }
Array<CIMKeyBinding> UNIX_AccessControlInformationProvider::constructKeyBindings(const UNIX_AccessControlInformation& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_SYSTEM_CREATION_CLASS_NAME, _p.getSystemCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_SYSTEM_NAME, _p.getSystemName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, _p.getCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_NAME, _p.getName(), CIMKeyBinding::STRING)); return keys; }
Array<CIMKeyBinding> UNIX_BGPProtocolEndpointProvider::constructKeyBindings(const UNIX_BGPProtocolEndpoint& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_SYSTEM_CREATION_CLASS_NAME, _p.getSystemCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_SYSTEM_NAME, _p.getSystemName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, _p.getCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_NAME, _p.getName(), CIMKeyBinding::STRING)); return keys; }
/* ================================================================================ NAME : _constructReference DESCRIPTION : Constructs a reference pointing to the appropriate class ASSUMPTIONS : None PRE-CONDITIONS : POST-CONDITIONS : NOTES : PARAMETERS : className, Process ================================================================================ */ Array<CIMKeyBinding> BIPTLEpProvider::_constructReference( const CIMName& className, const String& sysName, const String& instName) { #ifdef DEBUG cout << "BIPTLEpProvider::_constructReference()" << endl; #endif Array<CIMKeyBinding> kba; // Construct the key bindings kba.append(CIMKeyBinding(PROPERTY_SYSTEM_CREATION_CLASS_NAME, CLASS_CIM_UNITARY_COMPUTER_SYSTEM.getString(), CIMKeyBinding::STRING)); kba.append(CIMKeyBinding(PROPERTY_SYSTEM_NAME, sysName, CIMKeyBinding::STRING)); kba.append(CIMKeyBinding(PROPERTY_CREATION_CLASS_NAME, className.getString(), CIMKeyBinding::STRING)); kba.append(CIMKeyBinding(PROPERTY_NAME, instName, CIMKeyBinding::STRING)); #ifdef DEBUG cout << "BIPTLEpProvider::_constructReference() -- done" << endl; #endif return kba; }
void ComputerSystemProvider::enumerateInstanceNames( const OperationContext& context, const CIMObjectPath &ref, ObjectPathResponseHandler& handler) { CIMName className = ref.getClassName(); _checkClass(className); handler.processing(); // Deliver instance only if request was for leaf class if (className.equal(CLASS_EXTENDED_COMPUTER_SYSTEM)) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, CLASS_EXTENDED_COMPUTER_SYSTEM, CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_NAME, _cs.getHostName(), CIMKeyBinding::STRING)); handler.deliver(CIMObjectPath( _cs.getHostName(), ref.getNameSpace(), CLASS_EXTENDED_COMPUTER_SYSTEM, keys)); } handler.complete(); return; }
void ParserTestProvider::enumerateInstanceNames( const OperationContext & context, const CIMObjectPath & classReference, ObjectPathResponseHandler & handler) { //DEBUG("enumerateInstanceNames()"); // begin processing the request CIMName className = classReference.getClassName(); CIMNamespaceName nameSpace = classReference.getNameSpace(); //DEBUG("[className: "<<className<<"], [in namespace: "<<nameSpace<<"]"); handler.processing(); Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding("CName", String(CLASS_NAME), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding("BadStr", String(BADSTR_1), CIMKeyBinding::STRING)); CIMObjectPath obj_path = CIMObjectPath(String(), nameSpace, className, keys); handler.deliver(obj_path); // complete processing the request handler.complete(); }
Array<CIMKeyBinding> UNIX_AuthorizationServiceProvider::constructKeyBindings(const UNIX_AuthorizationService& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_SYSTEM_CREATION_CLASS_NAME, _p.getSystemCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_SYSTEM_NAME, _p.getSystemName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, _p.getCreationClassName(), CIMKeyBinding::STRING)); keys.append(CIMKeyBinding( PROPERTY_NAME, _p.getName(), CIMKeyBinding::STRING)); return keys; }
Array<CIMKeyBinding> UNIX_LogicalDiskProvider::_constructKeyBindings(const UNIX_LogicalDisk& _p) { Array<CIMKeyBinding> keyBindings; // Construct the key bindings keyBindings.append(CIMKeyBinding( PROPERTY_SYSTEM_CREATION_CLASS_NAME, BASE_CLASS_NAME, CIMKeyBinding::STRING)); keyBindings.append(CIMKeyBinding( PROPERTY_SYSTEM_NAME, _hostName, CIMKeyBinding::STRING)); keyBindings.append(CIMKeyBinding( PROPERTY_CREATION_CLASS_NAME, CLASS_IMPLEMENTATION_NAME, CIMKeyBinding::STRING)); keyBindings.append(CIMKeyBinding( PROPERTY_DEVICE_ID, _p.getHandle(), CIMKeyBinding::STRING)); return keyBindings; }
ObjectNormalizer::ObjectNormalizer( const CIMClass& cimClass, Boolean includeQualifiers, Boolean includeClassOrigin, const CIMNamespaceName& nameSpace, SharedPtr<NormalizerContext>& context) : _cimClass(cimClass), _includeQualifiers(includeQualifiers), _includeClassOrigin(includeClassOrigin), _context(context), _nameSpace(nameSpace) { if (!_cimClass.isUninitialized()) { // ATTN: the following code is intended to expedite normalizing // instances and instance object paths by establishing the keys // once now rather than multiple times later. it is biased // toward providers that return many instances with many properties. // build a reference object path within the class Array<CIMKeyBinding> keys; for (Uint32 i = 0, n = _cimClass.getPropertyCount(); i < n; i++) { CIMConstProperty referenceProperty = _cimClass.getProperty(i); Uint32 pos = referenceProperty.findQualifier("key"); if ((pos != PEG_NOT_FOUND) && (referenceProperty.getQualifier(pos).getValue().equal( CIMValue(true)))) { if (referenceProperty.getType() == CIMTYPE_REFERENCE) { // ATTN: a fake reference is inserted in the key so that // the _BubbleSort() method in CIMObjectPath does not // throw and exception. It implicitly validates keys of // type REFERENCE so just place a dummy value for now. // The value will be replaced by the normalized object // later. keys.append(CIMKeyBinding(referenceProperty.getName(), "class.key=\"value\"", CIMKeyBinding::REFERENCE)); } else { keys.append(CIMKeyBinding(referenceProperty.getName(), referenceProperty.getValue())); } } } // update class object path CIMObjectPath cimObjectPath(_cimClass.getPath()); cimObjectPath.setKeyBindings(keys); _cimClass.setPath(cimObjectPath); } }
/* ================================================================================ NAME : _constructKeyBindings DESCRIPTION : Constructs an array of keybindings for an IP Interface ASSUMPTIONS : None PRE-CONDITIONS : POST-CONDITIONS : NOTES : PARAMETERS : className, Process ================================================================================ */ Array<CIMKeyBinding> BIPTLEpProvider::_constructKeyBindings( const CIMNamespaceName &nameSpace, const IPInterface &_ipif) { #ifdef DEBUG cout << "BIPTLEpProvider::_constructKeyBindings()" << endl; #endif Array<CIMKeyBinding> keyBindings; String s, sn; CIMObjectPath op; if (_ipif.getSystemName(sn) == false) { throw CIMNotSupportedException( String("Host-specific module doesn't support Key `") + PROPERTY_SYSTEM_NAME.getString() + String("'")); } // Construct the key bindings op = CIMObjectPath(sn, //hostname nameSpace, CLASS_CIM_LAN_ENDPOINT, _constructReference( CLASS_CIM_LAN_ENDPOINT, sn,_ipif.get_LANInterfaceName()) ); keyBindings.append(CIMKeyBinding(PROPERTY_ANTECEDENT, op.toString(), CIMKeyBinding::REFERENCE)); if (_ipif.getName(s)) { op = CIMObjectPath(sn, //hostname nameSpace, CLASS_CIM_IP_PROTOCOL_ENDPOINT, _constructReference( CLASS_CIM_IP_PROTOCOL_ENDPOINT, sn,s) ); keyBindings.append(CIMKeyBinding(PROPERTY_DEPENDENT, op.toString(), CIMKeyBinding::REFERENCE)); } else { throw CIMNotSupportedException( String("Host-specific module doesn't support Key `") + PROPERTY_NAME.getString() + String("'")); } #ifdef DEBUG cout << "BIPTLEpProvider::_constructKeyBindings() -- done" << endl; #endif return keyBindings; }
CIMObjectPath _getFilterObjectPath(const String & name) { Array<CIMKeyBinding> keyBindings; keyBindings.append (CIMKeyBinding ("SystemCreationClassName", System::getSystemCreationClassName (), CIMKeyBinding::STRING)); keyBindings.append (CIMKeyBinding ("SystemName", System::getFullyQualifiedHostName (), CIMKeyBinding::STRING)); keyBindings.append (CIMKeyBinding ("CreationClassName", PEGASUS_CLASSNAME_INDFILTER.getString(), CIMKeyBinding::STRING)); keyBindings.append (CIMKeyBinding ("Name", name, CIMKeyBinding::STRING)); return(CIMObjectPath("", CIMNamespaceName (), PEGASUS_CLASSNAME_INDFILTER, keyBindings)); }
CIMObjectPath _getSubscriptionObjectPath( const String & filterName, const String & handlerName) { CIMObjectPath filterObjectPath = _getFilterObjectPath(filterName); CIMObjectPath handlerObjectPath = _getHandlerObjectPath(handlerName); Array<CIMKeyBinding> subscriptionKeyBindings; subscriptionKeyBindings.append (CIMKeyBinding ("Filter", CIMValue(filterObjectPath))); subscriptionKeyBindings.append (CIMKeyBinding ("Handler", CIMValue(handlerObjectPath))); return(CIMObjectPath("", CIMNamespaceName (), PEGASUS_CLASSNAME_INDSUBSCRIPTION, subscriptionKeyBindings)); }
void benchmarkProvider::enumerateInstanceNames( const OperationContext & context, const CIMObjectPath & classReference, ObjectPathResponseHandler & handler) { CIMObjectPath _instanceName; Uint32 numberOfProperties; Uint32 sizeOfPropertyValue; Uint32 numberOfInstances; CIMName className = classReference.getClassName(); test.getConfiguration(className, numberOfProperties, sizeOfPropertyValue, numberOfInstances); // begin processing the request handler.processing(); for (Uint32 i = 1; i <= numberOfInstances; i++) { _instanceName = _buildObjectPath(className, CIMKeyBinding(CIMName("Identifier"), CIMValue(i))); handler.deliver(_instanceName); } // complete processing the request handler.complete(); }
CIMObjectPath _buildSubscriptionPath (const CIMObjectPath & filterPath, const CIMObjectPath & handlerPath) { CIMObjectPath path; Array <CIMKeyBinding> keyBindings; keyBindings.append (CIMKeyBinding ("Filter", filterPath.toString (), CIMKeyBinding::REFERENCE)); keyBindings.append (CIMKeyBinding ("Handler", handlerPath.toString (), CIMKeyBinding::REFERENCE)); path.setClassName (SUBSCRIPTION_CLASSNAME); path.setKeyBindings (keyBindings); return path; }
void _deleteFilterInstance( CIMClient& client, const String& name) { Array<CIMKeyBinding> keyBindings; keyBindings.append(CIMKeyBinding("SystemCreationClassName", System::getSystemCreationClassName(), CIMKeyBinding::STRING)); keyBindings.append(CIMKeyBinding("SystemName", System::getFullyQualifiedHostName(), CIMKeyBinding::STRING)); keyBindings.append(CIMKeyBinding("CreationClassName", PEGASUS_CLASSNAME_INDFILTER.getString(), CIMKeyBinding::STRING)); keyBindings.append(CIMKeyBinding("Name", name, CIMKeyBinding::STRING)); CIMObjectPath path("", CIMNamespaceName(), PEGASUS_CLASSNAME_INDFILTER, keyBindings); client.deleteInstance(PEGASUS_NAMESPACENAME_INTEROP, path); }
CIMObjectPath LinuxNetworkAdapterProvider::fill_reference(const CIMNamespaceName& nameSpace, const CIMName& className, NetworkAdapterData const* ptr) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding("CreationClassName", className.getString(), CIMKeyBinding::STRING)); // LogicalDevice keys keys.append(CIMKeyBinding("Name", ptr->GetName(), CIMKeyBinding::STRING)); return CIMObjectPath(System::getHostName(), nameSpace, className, keys); }
Array<CIMKeyBinding> UNIX_ComputerSystemMappedIOProvider::constructKeyBindings(const UNIX_ComputerSystemMappedIO& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_GROUP_COMPONENT, CIMValue(_p.getGroupComponent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_PART_COMPONENT, CIMValue(_p.getPartComponent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_AssociatedDatabaseSystemProvider::constructKeyBindings(const UNIX_AssociatedDatabaseSystem& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_ANTECEDENT, CIMValue(_p.getAntecedent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_DEPENDENT, CIMValue(_p.getDependent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_AssociatedJobMethodResultProvider::constructKeyBindings(const UNIX_AssociatedJobMethodResult& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_JOB, CIMValue(_p.getJob()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_JOB_PARAMETERS, CIMValue(_p.getJobParameters()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_CalculationBasedOnQueueProvider::constructKeyBindings(const UNIX_CalculationBasedOnQueue& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_ANTECEDENT, CIMValue(_p.getAntecedent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_DEPENDENT, CIMValue(_p.getDependent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_CollectedSoftwareFeaturesProvider::constructKeyBindings(const UNIX_CollectedSoftwareFeatures& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_COLLECTION, CIMValue(_p.getCollection()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_MEMBER, CIMValue(_p.getMember()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_BGPPeerUsesRouteMapProvider::constructKeyBindings(const UNIX_BGPPeerUsesRouteMap& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_COLLECTION, CIMValue(_p.getCollection()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_MEMBER, CIMValue(_p.getMember()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_AreaOfConfigurationProvider::constructKeyBindings(const UNIX_AreaOfConfiguration& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_ANTECEDENT, CIMValue(_p.getAntecedent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_DEPENDENT, CIMValue(_p.getDependent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_AggregateRedundancyComponentProvider::constructKeyBindings(const UNIX_AggregateRedundancyComponent& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_GROUP_COMPONENT, CIMValue(_p.getGroupComponent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_PART_COMPONENT, CIMValue(_p.getPartComponent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_ClassifierElementInClassifierServiceProvider::constructKeyBindings(const UNIX_ClassifierElementInClassifierService& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_GROUP_COMPONENT, CIMValue(_p.getGroupComponent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_PART_COMPONENT, CIMValue(_p.getPartComponent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_BootServiceAccessBySAPProvider::constructKeyBindings(const UNIX_BootServiceAccessBySAP& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_ANTECEDENT, CIMValue(_p.getAntecedent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_DEPENDENT, CIMValue(_p.getDependent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
Array<CIMKeyBinding> UNIX_CAHasPublicCertificateProvider::constructKeyBindings(const UNIX_CAHasPublicCertificate& _p) { Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding( PROPERTY_ANTECEDENT, CIMValue(_p.getAntecedent()).toString(), CIMKeyBinding::REFERENCE)); keys.append(CIMKeyBinding( PROPERTY_DEPENDENT, CIMValue(_p.getDependent()).toString(), CIMKeyBinding::REFERENCE)); return keys; }
void InstanceProvider::createInstance( const OperationContext & context, const CIMObjectPath & instanceReference, const CIMInstance & instanceObject, ObjectPathResponseHandler & handler) { // Validate the class name if (!instanceObject.getClassName().equal("Sample_InstanceProviderClass")) { throw CIMNotSupportedException( instanceObject.getClassName().getString()); } // Find the key property Uint32 idIndex = instanceObject.findProperty("Identifier"); if (idIndex == PEG_NOT_FOUND) { throw CIMInvalidParameterException("Missing key value"); } CIMInstance cimInstance = instanceObject.clone(); // Create the new instance name CIMValue idValue = instanceObject.getProperty(idIndex).getValue(); Array<CIMKeyBinding> keys; keys.append(CIMKeyBinding("Identifier", idValue)); CIMObjectPath instanceName = CIMObjectPath( String(), CIMNamespaceName(), instanceObject.getClassName(), keys); cimInstance.setPath(instanceName); // Determine whether this instance already exists for(Uint32 i = 0, n = _instances.size(); i < n; i++) { if(instanceName == _instances[i].getPath()) { throw CIMObjectAlreadyExistsException(instanceName.toString()); } } // begin processing the request handler.processing(); // add the new instance to the array _instances.append(cimInstance); // deliver the new instance name handler.deliver(instanceName); // complete processing the request handler.complete(); }
void _deleteHandlerInstance (CIMClient & client, const String & name, const CIMNamespaceName & handlerNS) { Array<CIMKeyBinding> keyBindings; keyBindings.append (CIMKeyBinding ("SystemCreationClassName", System::getSystemCreationClassName (), CIMKeyBinding::STRING)); keyBindings.append (CIMKeyBinding ("SystemName", System::getFullyQualifiedHostName (), CIMKeyBinding::STRING)); keyBindings.append (CIMKeyBinding ("CreationClassName", PEGASUS_CLASSNAME_INDHANDLER_CIMXML.getString(), CIMKeyBinding::STRING)); keyBindings.append (CIMKeyBinding ("Name", name, CIMKeyBinding::STRING)); CIMObjectPath path ("", CIMNamespaceName (), PEGASUS_CLASSNAME_INDHANDLER_CIMXML, keyBindings); client.deleteInstance (handlerNS, path); }