CIMInstance UNIX_IPRouteProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const UNIX_IPRoute &_p) { CIMProperty p; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String(""), // hostname nameSpace, CLASS_IMPLEMENTATION_CIM_NAME, _constructKeyBindings(_p))); addManagedSystemElementProperties(inst, _p); if (_p.getAddressType(p)) inst.addProperty(p); if (_p.getServiceCreationClassName(p)) inst.addProperty(p); if (_p.getServiceName(p)) inst.addProperty(p); if (_p.getDestinationAddress(p)) inst.addProperty(p); if (_p.getDestinationMask(p)) inst.addProperty(p); if (_p.getIPDestinationAddress(p)) inst.addProperty(p); if (_p.getIPDestinationMask(p)) inst.addProperty(p); if (_p.getIsStatic(p)) inst.addProperty(p); return inst; }
/* ================================================================================ NAME : _constructInstance DESCRIPTION : Constructs instance by adding its properties. The : IP Interface argument has already been filled in : with data from an existing IP Interface ASSUMPTIONS : None PRE-CONDITIONS : POST-CONDITIONS : NOTES : PARAMETERS : className, Process ================================================================================ */ CIMInstance BIPTLEpProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const IPInterface &_ipif) { #ifdef DEBUG cout << "BIPTLEpProvider::_constructInstance()" << endl; #endif String s; Uint16 i16; CIMDateTime d; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String::EMPTY, // hostname nameSpace, CLASS_PG_BINDS_IP_TO_LAN_ENDPOINT, _constructKeyBindings(nameSpace, _ipif))); // ====================================================== // The following properties are in CIM_ServiceAccessPoint // ====================================================== // The keys for this class are: // CIM_LANEndpoint REF Antecedent // CIM_IPProtocolEndpoint REF Dependent // Rather than rebuilding the key properties, we will reuse // the values that were inserted for us in the ObjectPath, // trusting that this was done correctly // Get the keys Array<CIMKeyBinding> key = inst.getPath().getKeyBindings(); // loop through keys, inserting them as properties // luckily, all keys for this class are strings, so no // need to check key type for (Uint32 i=0; i<key.size(); i++) { // add a property created from the name and value inst.addProperty(CIMProperty(key[i].getName(),key[i].getValue())); } // CIM_BindsToLANEndpoint // uint16 FrameType if (_ipif.getFrameType(i16)) inst.addProperty(CIMProperty(PROPERTY_FRAME_TYPE,i16)); #ifdef DEBUG cout << "BIPTLEpProvider::_constructInstance() -- done" << endl; #endif return inst; }
CIMInstance UNIX_AccountProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const UNIX_Account &_p) { CIMProperty p; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String(""), // hostname nameSpace, CLASS_IMPLEMENTATION_CIM_NAME, _constructKeyBindings(_p))); addManagedSystemElementProperties(inst, _p); //EnabledLogicalElement if (_p.getEnabledState(p)) inst.addProperty(p); if (_p.getOtherEnabledState(p)) inst.addProperty(p); if (_p.getRequestedState(p)) inst.addProperty(p); if (_p.getEnabledDefault(p)) inst.addProperty(p); if (_p.getTimeOfLastStateChange(p)) inst.addProperty(p); if (_p.getAvailableRequestedStates(p)) inst.addProperty(p); if (_p.getTransitioningToState(p)) inst.addProperty(p); //CIM_Account if (_p.getUserID(p)) inst.addProperty(p); if (_p.getObjectClass(p)) inst.addProperty(p); if (_p.getDescriptions(p)) inst.addProperty(p); if (_p.getHost(p)) inst.addProperty(p); if (_p.getLocalityName(p)) inst.addProperty(p); if (_p.getOrganizationName(p)) inst.addProperty(p); if (_p.getOU(p)) inst.addProperty(p); if (_p.getSeeAlso(p)) inst.addProperty(p); if (_p.getUserCertificate(p)) inst.addProperty(p); if (_p.getUserPassword(p)) inst.addProperty(p); if (_p.getUserPasswordEncryptionAlgorithm(p)) inst.addProperty(p); if (_p.getOtherUserPasswordEncryptionAlgorithm(p)) inst.addProperty(p); if (_p.getComplexPasswordRulesEnforced(p)) inst.addProperty(p); if (_p.getInactivityTimeout(p)) inst.addProperty(p); if (_p.getLastLogin(p)) inst.addProperty(p); if (_p.getMaximumSuccessiveLoginFailures(p)) inst.addProperty(p); if (_p.getPasswordExpiration(p)) inst.addProperty(p); if (_p.getPasswordHistoryDepth(p)) inst.addProperty(p); if (_p.getUserPasswordEncoding(p)) inst.addProperty(p); return inst; }
/* ================================================================================ NAME : enumerateInstanceNames DESCRIPTION : Enumerates all of the IPProtocolEndpoint instance names. : An array of instance references is returned. ASSUMPTIONS : None PRE-CONDITIONS : POST-CONDITIONS : NOTES : Localization is not supported by this provider. PARAMETERS : ================================================================================ */ void BIPTLEpProvider::enumerateInstanceNames(const OperationContext &ctx, const CIMObjectPath &ref, ObjectPathResponseHandler &handler) { #ifdef DEBUG cout << "BIPTLEpProvider::enumerateInstanceNames()" << endl; #endif CIMName className = ref.getClassName(); CIMNamespaceName nameSpace = ref.getNameSpace(); // Validate the classname _checkClass(className); // Notify processing is starting handler.processing(); int i; InterfaceList _ifList; #ifdef DEBUG cout << "BIPTLEpProvider::enumerateInstanceNames() _ifList Initialized" << endl; #endif for (i = 0; i < _ifList.size(); i++) { IPInterface _ipif = _ifList.getInterface(i); if (_ipif.bindsToLANInterface()) { // Deliver the names handler.deliver( CIMObjectPath(String::EMPTY, // hostname nameSpace, CLASS_PG_BINDS_IP_TO_LAN_ENDPOINT, _constructKeyBindings(nameSpace, _ipif) ) ); } } // Notify processing is complete handler.complete(); return; } // enumerateInstanceNames
void UNIX_PROVIDER::enumerateInstanceNames(const OperationContext &ctx, const CIMObjectPath &ref, ObjectPathResponseHandler &handler) { int pIndex; CLASS_IMPLEMENTATION _p; CIMName className = ref.getClassName(); CIMNamespaceName nameSpace = ref.getNameSpace(); // Validate the classname _checkClass(className); // Notify processing is starting handler.processing(); // We are only going to respond to enumeration requests on // CLASS_UNIX_PROCESS if (className.equal (_getBaseClassCimName()) || className.equal(_getClassCimName())) { // Get the process information and deliver an ObjectPath for // each process // Note that loadProcessInfo modifies pIndex to point to the // next process structure before the loop increments it! _p.initialize(); for (pIndex = 0; _p.load(pIndex); pIndex++) { // Deliver the names handler.deliver(CIMObjectPath(String(""), // hostname nameSpace, _getClassCimName(), _constructKeyBindings(_p))); } _p.finalize(); } // Notify processing is complete handler.complete(); return; } // enumerateInstanceNames
CIMInstance UNIX_NTPServiceProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const UNIX_NTPService &_p) { CIMProperty p; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String(""), // hostname nameSpace, CLASS_IMPLEMENTATION_CIM_NAME, _constructKeyBindings(_p))); addManagedSystemElementProperties(inst, _p); if (_p.getServerAddress(p)) inst.addProperty(p); return inst; }
CIMInstance UNIX_IPProtocolEndPointProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const UNIX_IPEndPoint &_p) { CIMProperty p; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String(""), // hostname nameSpace, className, _constructKeyBindings(_p))); addManagedSystemElementProperties(inst, _p); if (_p.getAddress(p)) inst.addProperty(p); if (_p.getSubnetMask(p)) inst.addProperty(p); if (_p.getProtocolType(p)) inst.addProperty(p); if (_p.getIPVersionSupport(p)) inst.addProperty(p); if (_p.getOtherTypeDescription(p)) inst.addProperty(p); if (_p.getAddressType(p)) inst.addProperty(p); return inst; }
/* ================================================================================ NAME : _constructInstance DESCRIPTION : Constructs instance by adding its properties. The : IP Interface argument has already been filled in : with data from an existing IP Interface ASSUMPTIONS : None PRE-CONDITIONS : POST-CONDITIONS : NOTES : PARAMETERS : className, nameSpace, IP Interface ================================================================================ */ CIMInstance IPPEpProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const IPInterface &_ipif) { #ifdef DEBUG cout << "IPPEpProvider::_constructInstance()" << endl; #endif String s; Uint16 i16; CIMDateTime d; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String::EMPTY, // hostname nameSpace, CLASS_CIM_IP_PROTOCOL_ENDPOINT, _constructKeyBindings(_ipif))); // CIM_ManagedElement // string Caption if (_ipif.getCaption(s)) inst.addProperty(CIMProperty(PROPERTY_CAPTION,s)); // string Description if (_ipif.getDescription(s)) inst.addProperty(CIMProperty(PROPERTY_DESCRIPTION,s)); // CIM_ManagedSystemElement // datetime InstallDate if (_ipif.getInstallDate(d)) inst.addProperty(CIMProperty(PROPERTY_INSTALL_DATE,d)); // string Name // Overridden in CIM_ServiceAccessPoint // string Status if (_ipif.getStatus(s)) inst.addProperty(CIMProperty(PROPERTY_STATUS,s)); // CIM_LogicalElement // ** No local properties added in this class ** // ====================================================== // The following properties are in CIM_ServiceAccessPoint // ====================================================== // The keys for this class are: // [ key ] string SystemCreationClassName // [ key ] string SystemName // [ key ] string CreationClassName // [ key ] string Name // Rather than rebuilding the key properties, we will reuse // the values that were inserted for us in the ObjectPath, // trusting that this was done correctly // Get the keys Array<CIMKeyBinding> key = inst.getPath().getKeyBindings(); // loop through keys, inserting them as properties // luckily, all keys for this class are strings, so no // need to check key type for (Uint32 i=0; i<key.size(); i++) { // add a property created from the name and value inst.addProperty(CIMProperty(key[i].getName(),key[i].getValue())); } // CIM_ProtocolEndpoint // string NameFormat if (_ipif.getNameFormat(s)) inst.addProperty(CIMProperty(PROPERTY_NAME_FORMAT,s)); // uint16 ProtocolType if (_ipif.getProtocolType(i16)) inst.addProperty(CIMProperty(PROPERTY_PROTOCOL_TYPE,i16)); // string OtherTypeDescription if (_ipif.getOtherTypeDescription(s)) { // if an empty string was returned, the value must be set to NULL // with type string, not an array if (String::equal(s,String::EMPTY)) { inst.addProperty(CIMProperty(PROPERTY_OTHER_TYPE_DESCRIPTION, CIMValue(CIMTYPE_STRING, false))); } else { inst.addProperty(CIMProperty(PROPERTY_OTHER_TYPE_DESCRIPTION,s)); } } // CIM_IPProtocolEndpoint // string Address if (_ipif.getAddress(s)) inst.addProperty(CIMProperty(PROPERTY_ADDRESS,s)); // string SubnetMask if (_ipif.getSubnetMask(s)) inst.addProperty(CIMProperty(PROPERTY_SUBNET_MASK,s)); // uint16 AddressType if (_ipif.getAddressType(i16)) inst.addProperty(CIMProperty(PROPERTY_ADDRESS_TYPE,i16)); // uint16 IPVersionSupport if (_ipif.getIPVersionSupport(i16)) inst.addProperty(CIMProperty(PROPERTY_IP_VERSION_SUPPORT,i16)); #ifdef DEBUG cout << "IPPEpProvider::_constructInstance() -- done" << endl; #endif return inst; }
// ============================================================================= // NAME : _constructInstance // DESCRIPTION : Constructs instance by adding its properties. The // : Process instance argument has already been filled in // : with data from an existing process // ASSUMPTIONS : None // PRE-CONDITIONS : // POST-CONDITIONS : // NOTES : // PARAMETERS : className, Process // ============================================================================= CIMInstance UNIX_LogicalDiskProvider::_constructInstance( const CIMName &className, const CIMNamespaceName &nameSpace, const UNIX_LogicalDisk &_p) { CIMProperty p; CIMInstance inst(className); // Set path inst.setPath(CIMObjectPath(String::EMPTY, // hostname nameSpace, CLASS_IMPLEMENTATION_CIM_NAME, _constructKeyBindings(_p))); addManagedSystemElementProperties(inst, _p); //EnabledLogicalElement if (_p.getEnabledState(p)) inst.addProperty(p); if (_p.getOtherEnabledState(p)) inst.addProperty(p); if (_p.getRequestedState(p)) inst.addProperty(p); if (_p.getEnabledDefault(p)) inst.addProperty(p); if (_p.getTimeOfLastStateChange(p)) inst.addProperty(p); if (_p.getAvailableRequestedStates(p)) inst.addProperty(p); if (_p.getTransitioningToState(p)) inst.addProperty(p); //LogicalDevice if (_p.getDeviceID(p)) inst.addProperty(p); if (_p.getPowerManagementSupported(p)) inst.addProperty(p); if (_p.getPowerManagementCapabilities(p)) inst.addProperty(p); if (_p.getAvailability(p)) inst.addProperty(p); if (_p.getStatusInfo(p)) inst.addProperty(p); if (_p.getLastErrorCode(p)) inst.addProperty(p); if (_p.getErrorDescription(p)) inst.addProperty(p); if (_p.getErrorCleared(p)) inst.addProperty(p); if (_p.getOtherIdentifyingInfo(p)) inst.addProperty(p); if (_p.getPowerOnHours(p)) inst.addProperty(p); if (_p.getTotalPowerOnHours(p)) inst.addProperty(p); if (_p.getIdentifyingDescriptions(p)) inst.addProperty(p); if (_p.getAdditionalAvailability(p)) inst.addProperty(p); if (_p.getMaxQuiesceTime(p)) inst.addProperty(p); if (_p.getDataOrganization(p)) inst.addProperty(p); if (_p.getPurpose(p)) inst.addProperty(p); if (_p.getAccess(p)) inst.addProperty(p); if (_p.getErrorMethodology(p)) inst.addProperty(p); if (_p.getBlockSize(p)) inst.addProperty(p); if (_p.getNumberOfBlocks(p)) inst.addProperty(p); if (_p.getConsumableBlocks(p)) inst.addProperty(p); if (_p.getIsBasedOnUnderlyingRedundancy(p)) inst.addProperty(p); if (_p.getSequentialAccess(p)) inst.addProperty(p); if (_p.getExtentStatus(p)) inst.addProperty(p); if (_p.getNoSinglePointOfFailure(p)) inst.addProperty(p); if (_p.getDataRedundancy(p)) inst.addProperty(p); if (_p.getPackageRedundancy(p)) inst.addProperty(p); if (_p.getDeltaReservation(p)) inst.addProperty(p); if (_p.getPrimordial(p)) inst.addProperty(p); if (_p.getNameFormat(p)) inst.addProperty(p); if (_p.getNameNamespace(p)) inst.addProperty(p); if (_p.getOtherNameNamespace(p)) inst.addProperty(p); if (_p.getOtherNameFormat(p)) inst.addProperty(p); if (_p.getCompressed(p)) inst.addProperty(p); if (_p.getIsolated(p)) inst.addProperty(p); if (_p.getChecksum(p)) inst.addProperty(p); if (_p.getExecutable(p)) inst.addProperty(p); if (_p.getDeduplicationEnabled(p)) inst.addProperty(p); return inst; }