// Generated by genprov 2.1.0 #include "CMPL_LargeInstance_Provider.h" CIMPLE_NAMESPACE_BEGIN CMPL_LargeInstance_Provider::CMPL_LargeInstance_Provider() { // Set default for configuration parameters _instanceDeliveryType = DIRECT; _sizeOfInstance = 1000; _countToDeliver = 100; } CMPL_LargeInstance_Provider::~CMPL_LargeInstance_Provider() { } Load_Status CMPL_LargeInstance_Provider::load() { return LOAD_OK; } Unload_Status CMPL_LargeInstance_Provider::unload() { return UNLOAD_OK; } Get_Instance_Status CMPL_LargeInstance_Provider::get_instance( const CMPL_LargeInstance* model, CMPL_LargeInstance*& instance) { return GET_INSTANCE_UNSUPPORTED; } // build a string of size in input parameter String buildString(uint32 size) { String baseString("abcdefghighjklmnopqrstuvwxyz0123456789"); String rtnString; for (uint32 i = 0 ; i < (size - baseString.size()); i = (i + baseString.size())) { rtnString.append(baseString); } // add partial string return rtnString; } // build a single instance with key, size property and String properties // to match the size1 input parameter. Note that size is the size of the // largeProperty. CMPL_LargeInstance* buildInstance(uint32 key, uint32 instanceSize) { CMPL_LargeInstance* inst = CMPL_LargeInstance::create(true); inst->Key.set(key); inst->sizeOfInstance.set(instanceSize); inst->largeProperty.set(buildString(instanceSize)); return inst; } Enum_Instances_Status CMPL_LargeInstance_Provider::enum_instances( const CMPL_LargeInstance* model, Enum_Instances_Handler* handler) { switch(_instanceDeliveryType) { case ILLEGAL: { break; } case DIRECT: { for (uint32 i = 1 ; i <= _countToDeliver; i++) { CMPL_LargeInstance* inst = buildInstance(i, _sizeOfInstance); handler->handle(inst); } break; } case CLONE: { break; } case CACHE: { break; } } return ENUM_INSTANCES_OK; } Create_Instance_Status CMPL_LargeInstance_Provider::create_instance( CMPL_LargeInstance* instance) { return CREATE_INSTANCE_UNSUPPORTED; } Delete_Instance_Status CMPL_LargeInstance_Provider::delete_instance( const CMPL_LargeInstance* instance) { return DELETE_INSTANCE_UNSUPPORTED; } Modify_Instance_Status CMPL_LargeInstance_Provider::modify_instance( const CMPL_LargeInstance* model, const CMPL_LargeInstance* instance) { return MODIFY_INSTANCE_UNSUPPORTED; } Invoke_Method_Status CMPL_LargeInstance_Provider::getConfig( Property& type, Property& size, Property& count, Property& return_value) { printf("getconfig\n"); type.null = false; type.value = _instanceDeliveryType; size.null = false; size.value = _sizeOfInstance; count.null = false; count.value = _countToDeliver; return_value.set(0); return INVOKE_METHOD_OK; } Invoke_Method_Status CMPL_LargeInstance_Provider::setConfig( const Property& type, const Property& size, const Property& count, Property& return_value) { //_countToDeliver = count; //_sizeOfInstance = size; // check values before setting. // _instanceDeliveryType = type; return_value.set(0); return INVOKE_METHOD_OK; } // test method because of problem with cmpi. Invoke_Method_Status CMPL_LargeInstance_Provider::test( Property& return_value) { return_value.set(0); return INVOKE_METHOD_OK; } /*@END@*/ CIMPLE_NAMESPACE_END