diff --git a/ACT/LibMCData.xml b/ACT/LibMCData.xml index 2e4dbd0b..2e1ae470 100644 --- a/ACT/LibMCData.xml +++ b/ACT/LibMCData.xml @@ -438,7 +438,13 @@ - + + + + + + + @@ -1761,151 +1767,210 @@ - + - - + + - - - + + + - - + + + + - - - + + + + + + + + + - - + + - - + + - - - - - - + + + + + + - - - - - - + + + + + + + + - - - - + + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - - - + + + + + + + + + + + - - - - + + + + + + - - + + - - + + - - - + + + - - - + + + + + + + + + - - - + + - - - - + + + - - - - + + + + - - - + + + + - - - - + - - - - + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2003,6 +2068,10 @@ + + + + diff --git a/ACT/LibMCEnv.xml b/ACT/LibMCEnv.xml index fca39b4a..3587216c 100644 --- a/ACT/LibMCEnv.xml +++ b/ACT/LibMCEnv.xml @@ -289,7 +289,7 @@ - + @@ -4755,105 +4755,235 @@ - + - - + + - - + + - - + + - - - - - - - - - - - + + + - - - + + + - - + - + - - + + - - + + + + + + - - + + - - - - - - - - - + + + + + - - - - - + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - + + - - - + + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5744,6 +5874,9 @@ + + + diff --git a/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.h b/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.h index 71bd24c1..283c058e 100644 --- a/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.h +++ b/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.h @@ -2546,7 +2546,7 @@ typedef LibMCDataResult (*PLibMCDataPersistencyHandler_RetrievePersistentBoolPar **************************************************************************************************************************/ /** -* Returns the UUID. +* Returns the UUID of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nVersionUUIDBufferSize - size of the buffer (including trailing 0) @@ -2557,7 +2557,7 @@ typedef LibMCDataResult (*PLibMCDataPersistencyHandler_RetrievePersistentBoolPar typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetVersionUUIDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nVersionUUIDBufferSize, LibMCData_uint32* pVersionUUIDNeededChars, char * pVersionUUIDBuffer); /** -* Returns the UUID. +* Returns the UUID of the XSD used by this configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) @@ -2568,113 +2568,100 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetVersionUUIDPt typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetXSDUUIDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXSDUUIDBufferSize, LibMCData_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); /** -* Returns the UUID of the corresponding Configuration type. +* Returns the numeric version of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeUUIDBuffer - buffer of UUID of the configuration type., may be NULL +* @param[out] pConfigurationNumericVersion - Returns the configuration numeric version. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetTypeUUIDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetNumericVersionPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_uint32 * pConfigurationNumericVersion); /** -* Returns the UUID of the parent Configuration Version. +* Returns the UUID of the parent version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nParentUUIDBufferSize - size of the buffer (including trailing 0) * @param[out] pParentUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pParentUUIDBuffer - buffer of UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000, if Version is the default configuration., may be NULL +* @param[out] pParentUUIDBuffer - buffer of UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version., may be NULL * @return error code or 0 (success) */ typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetParentUUIDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nParentUUIDBufferSize, LibMCData_uint32* pParentUUIDNeededChars, char * pParentUUIDBuffer); /** -* Returns the Schema type of the configuration. +* Returns the configuration XML content as string. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema type of the configuration type., may be NULL +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of XML String., may be NULL * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetSchemaTypePtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXMLStringBufferSize, LibMCData_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); /** -* Returns the version number of the XSD in use.. +* Returns the User UUID. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[out] pXSDVersion - Returns the XSD version. +* @param[in] nUserUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUserUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUserUUIDBuffer - buffer of UUID of the User., may be NULL * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetXSDVersionPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_uint32 * pXSDVersion); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetUserUUIDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nUserUUIDBufferSize, LibMCData_uint32* pUserUUIDNeededChars, char * pUserUUIDBuffer); /** -* Returns the XSD in use as string.. +* Returns the creation timestamp of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) -* @param[out] pXSDStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXSDStringBuffer - buffer of XSD String., may be NULL +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of creation., may be NULL * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetXSDStringPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetTimestampPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); /** -* Returns the configuration XML as String. -* -* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) -* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXMLStringBuffer - buffer of XML String., may be NULL -* @return error code or 0 (success) -*/ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXMLStringBufferSize, LibMCData_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); - -/** -* Creates a new configuration version from this version with the same XSD. +* Creates a new configuration version from this one with the same XSD. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] pXMLString - New XML Configuration String. MUST conform to current XSD. * @param[in] pUserUUID - User UUID for logging the user who initiated the change. -* @param[in] pTimeStampUTC - Current time in UTC. -* @param[out] pCurrentInstance - returns the MachineConfigurationVersion instance. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_CreateNewVersionPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pCurrentInstance); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_CreateNewVersionPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, LibMCData_MachineConfigurationVersion * pCurrentInstance); /** -* Creates a new configuration version from this version with another XSD. +* Creates a new configuration version from this one but with a different XSD. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. * @param[in] pXMLString - New XML Configuration String. MUST conform to new XSD. * @param[in] pUserUUID - User UUID for logging the user who initiated the change. -* @param[in] pTimeStampUTC - Current time in UTC. -* @param[out] pCurrentInstance - returns the MachineConfigurationVersion instance. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_MigrateToNewXSDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pCurrentInstance); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersion_MigrateToNewXSDPtr) (LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, LibMCData_MachineConfigurationVersion * pCurrentInstance); /************************************************************************************************************************* Class definition for MachineConfigurationVersionIterator **************************************************************************************************************************/ /** -* Returns the version the iterator points at. +* Returns the current MachineConfigurationVersion instance. * * @param[in] pMachineConfigurationVersionIterator - MachineConfigurationVersionIterator instance. -* @param[out] pCurrentInstance - returns the MachineConfigurationVersion instance. +* @param[out] pInstance - Currently selected configuration version instance. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersionIterator_GetCurrentVersionPtr) (LibMCData_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCData_MachineConfigurationVersion * pCurrentInstance); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersionIterator_GetCurrentPtr) (LibMCData_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCData_MachineConfigurationVersion * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationXSD **************************************************************************************************************************/ /** -* Returns the UUID. +* Returns the UUID of the XSD. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) @@ -2685,7 +2672,7 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationVersionIterator_GetCurre typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetUUIDPtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nXSDUUIDBufferSize, LibMCData_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); /** -* Returns the UUID of the corresponding Configuration type. +* Returns the UUID of the associated configuration type. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) @@ -2696,18 +2683,7 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetUUIDPtr) (LibMCDa typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetTypeUUIDPtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); /** -* Returns the Schema type of the configuration. -* -* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. -* @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema type of the configuration type., may be NULL -* @return error code or 0 (success) -*/ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetSchemaTypePtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); - -/** -* Returns the version number of the XSD.. +* Returns the version number of the XSD. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[out] pXSDVersion - Returns the XSD version. @@ -2716,7 +2692,7 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetSchemaTypePtr) (L typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetXSDVersionPtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_uint32 * pXSDVersion); /** -* Returns the XSD as string.. +* Returns the XSD content as string. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) @@ -2727,20 +2703,35 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetXSDVersionPtr) (L typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetXSDStringPtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); /** -* Lists all known Configuration version of the current XSD. +* Returns the creation timestamp of the XSD version. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. -* @param[out] pVersionIterator - Returns a list of versions. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of XSD creation., may be NULL * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_ListVersionsPtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_GetTimestampPtr) (LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/************************************************************************************************************************* + Class definition for MachineConfigurationXSDIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationXSD instance. +* +* @param[in] pMachineConfigurationXSDIterator - MachineConfigurationXSDIterator instance. +* @param[out] pInstance - Currently selected configuration XSD instance. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSDIterator_GetCurrentPtr) (LibMCData_MachineConfigurationXSDIterator pMachineConfigurationXSDIterator, LibMCData_MachineConfigurationXSD * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationType **************************************************************************************************************************/ /** -* Returns the UUID. +* Returns the UUID of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) @@ -2751,7 +2742,7 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationXSD_ListVersionsPtr) (Li typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetUUIDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); /** -* Returns the Name. +* Returns the name of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nNameBufferSize - size of the buffer (including trailing 0) @@ -2762,7 +2753,7 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetUUIDPtr) (LibMCD typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetNamePtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nNameBufferSize, LibMCData_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Schema type of the configuration. +* Returns the schema type string of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) @@ -2773,92 +2764,154 @@ typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetNamePtr) (LibMCD typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetSchemaTypePtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); /** -* Returns the latest Machine Configuration XSD. +* Returns the creation timestamp of the type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of Type creation., may be NULL +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetTimestampPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/** +* Returns the latest XSD registered for this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pXSDInstance - Returns the latest XSD of the configuration type. +* @param[out] pXSDInstance - Latest XSD of the configuration type. * @return error code or 0 (success) */ typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetLatestXSDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Returns the latest Machine Configuration XSD Version. +* Returns all XSDs associated with this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pXSDVersion - Returns the latest XSD version, or 0 if no XSD exists. +* @param[out] pXSDIterator - List of XSDs. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetLatestXSDVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 * pXSDVersion); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_ListXSDVersionsPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationXSDIterator * pXSDIterator); /** -* Finds Machine Configuration XSD by UUID. +* Returns the version number of the latest XSD for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDUUID - UUID of the configuration XSD. -* @param[out] pXSDInstance - Returns the latest XSD of the configuration type. +* @param[out] pXSDNumericVersion - Latest XSD version number, or 0 if none exist. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_FindXSDByUUIDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationXSD * pXSDInstance); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetLatestXSDNumericVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 * pXSDNumericVersion); /** -* Creates a new XSD Version. Fails if version already exists or is not incrementing. +* Registers a new XSD Version. Fails if version already exists or is not incrementing. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDString - XSD String of the version. MUST be incremental. +* @param[in] pXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. -* @param[in] pDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. * @param[out] pXSDInstance - Returns the new XSD of the configuration type. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_CreateNewXSDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCData_uint32 nXSDVersion, const char * pDefaultConfigurationXML, LibMCData_MachineConfigurationXSD * pXSDInstance); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_RegisterNewXSDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCData_uint32 nXSDVersion, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Returns an Configuration XSD Version. +* Finds a specific XSD of this type by its Numeric Version Number. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] nXSDVersion - Version to retrieve. -* @param[out] pXSDInstance - Returns the XSD of the configuration type with the appropriate version number or null if it does not exist. +* @param[in] nXSDNumericVersion - Requested version number. +* @param[out] pXSDInstance - XSD instance if exists. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetXSDVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 nXSDVersion, LibMCData_MachineConfigurationXSD * pXSDInstance); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_FindXSDByNumericVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 nXSDNumericVersion, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Lists all known Configuration version of the current type. +* Finds a specific XSD of this type by its UUID. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pVersionIterator - Returns a list of versions. +* @param[in] pXSDUUID - UUID of the XSD. +* @param[out] pXSDInstance - Matching XSD instance. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_ListVersionsPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_FindXSDByUUIDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Finds a Configuration version by UUID. +* Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pVersionUUID - UUID of the configuration version. -* @param[out] pVersion - Returns the specific version or null if version does not exist or is of a different type. +* @param[in] pXSDUUID - UUID of the XSD to base the default configuration on. +* @param[in] pDefaultXML - Configuration XML string conforming to the given XSD. +* @param[in] pTimeStampUTC - Creation timestamp in UTC. +* @param[out] pVersionInstance - Returns the created default configuration version. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_FindVersionByUUIDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_CreateDefaultConfigurationPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, const char * pDefaultXML, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pVersionInstance); /** -* Returns the active Configuration version. +* Lists all configuration versions registered under this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_ListAllConfigurationVersionsPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Lists all configuration versions for specific XSD. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD . +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_ListConfigurationVersionsForXSDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Finds a specific configuration version by UUID. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] pVersionUUID - UUID of the configuration version. -* @param[out] pVersion - Returns the specific version or null if no active version exists for this type. +* @param[out] pVersion - Matching configuration version if found. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetActiveVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_FindConfigurationVersionByUUIDPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion); /** -* Returns the latest Configuration version by Timestamp. +* Returns the currently active configuration version for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pVersion - Returns the specific version or null if no version exists for this type. +* @param[out] pVersion - Active version instance or null. * @return error code or 0 (success) */ -typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetLatestVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion); +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetActiveConfigurationVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion); + +/** +* Returns the most recently created version for this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[out] pVersion - Latest configuration version or null. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_GetLatestConfigurationVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion); + +/** +* Sets the active configuration version for this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pVersionUUID - UUID of the version to set as active. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationType_SetActiveConfigurationVersionPtr) (LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID); + +/************************************************************************************************************************* + Class definition for MachineConfigurationTypeIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationType instance. +* +* @param[in] pMachineConfigurationTypeIterator - MachineConfigurationTypeIterator instance. +* @param[out] pInstance - Currently selected configuration type instance. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataMachineConfigurationTypeIterator_GetCurrentPtr) (LibMCData_MachineConfigurationTypeIterator pMachineConfigurationTypeIterator, LibMCData_MachineConfigurationType * pInstance); /************************************************************************************************************************* Class definition for InstallationInformation @@ -3064,6 +3117,15 @@ typedef LibMCDataResult (*PLibMCDataDataModel_ClearLogCallbackPtr) (LibMCData_Da */ typedef LibMCDataResult (*PLibMCDataDataModel_HasLogCallbackPtr) (LibMCData_DataModel pDataModel, bool * pHasCallback); +/** +* Lists all registered configuration types. +* +* @param[in] pDataModel - DataModel instance. +* @param[out] pConfigurationTypeIterator - List of configuration types. +* @return error code or 0 (success) +*/ +typedef LibMCDataResult (*PLibMCDataDataModel_ListRegisteredConfigurationTypesPtr) (LibMCData_DataModel pDataModel, LibMCData_MachineConfigurationTypeIterator * pConfigurationTypeIterator); + /** * Retrieves a configuration type by schema. * @@ -3393,33 +3455,38 @@ typedef struct { PLibMCDataPersistencyHandler_RetrievePersistentBoolParameterPtr m_PersistencyHandler_RetrievePersistentBoolParameter; PLibMCDataMachineConfigurationVersion_GetVersionUUIDPtr m_MachineConfigurationVersion_GetVersionUUID; PLibMCDataMachineConfigurationVersion_GetXSDUUIDPtr m_MachineConfigurationVersion_GetXSDUUID; - PLibMCDataMachineConfigurationVersion_GetTypeUUIDPtr m_MachineConfigurationVersion_GetTypeUUID; + PLibMCDataMachineConfigurationVersion_GetNumericVersionPtr m_MachineConfigurationVersion_GetNumericVersion; PLibMCDataMachineConfigurationVersion_GetParentUUIDPtr m_MachineConfigurationVersion_GetParentUUID; - PLibMCDataMachineConfigurationVersion_GetSchemaTypePtr m_MachineConfigurationVersion_GetSchemaType; - PLibMCDataMachineConfigurationVersion_GetXSDVersionPtr m_MachineConfigurationVersion_GetXSDVersion; - PLibMCDataMachineConfigurationVersion_GetXSDStringPtr m_MachineConfigurationVersion_GetXSDString; PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr m_MachineConfigurationVersion_GetConfigurationXMLString; + PLibMCDataMachineConfigurationVersion_GetUserUUIDPtr m_MachineConfigurationVersion_GetUserUUID; + PLibMCDataMachineConfigurationVersion_GetTimestampPtr m_MachineConfigurationVersion_GetTimestamp; PLibMCDataMachineConfigurationVersion_CreateNewVersionPtr m_MachineConfigurationVersion_CreateNewVersion; PLibMCDataMachineConfigurationVersion_MigrateToNewXSDPtr m_MachineConfigurationVersion_MigrateToNewXSD; - PLibMCDataMachineConfigurationVersionIterator_GetCurrentVersionPtr m_MachineConfigurationVersionIterator_GetCurrentVersion; + PLibMCDataMachineConfigurationVersionIterator_GetCurrentPtr m_MachineConfigurationVersionIterator_GetCurrent; PLibMCDataMachineConfigurationXSD_GetUUIDPtr m_MachineConfigurationXSD_GetUUID; PLibMCDataMachineConfigurationXSD_GetTypeUUIDPtr m_MachineConfigurationXSD_GetTypeUUID; - PLibMCDataMachineConfigurationXSD_GetSchemaTypePtr m_MachineConfigurationXSD_GetSchemaType; PLibMCDataMachineConfigurationXSD_GetXSDVersionPtr m_MachineConfigurationXSD_GetXSDVersion; PLibMCDataMachineConfigurationXSD_GetXSDStringPtr m_MachineConfigurationXSD_GetXSDString; - PLibMCDataMachineConfigurationXSD_ListVersionsPtr m_MachineConfigurationXSD_ListVersions; + PLibMCDataMachineConfigurationXSD_GetTimestampPtr m_MachineConfigurationXSD_GetTimestamp; + PLibMCDataMachineConfigurationXSDIterator_GetCurrentPtr m_MachineConfigurationXSDIterator_GetCurrent; PLibMCDataMachineConfigurationType_GetUUIDPtr m_MachineConfigurationType_GetUUID; PLibMCDataMachineConfigurationType_GetNamePtr m_MachineConfigurationType_GetName; PLibMCDataMachineConfigurationType_GetSchemaTypePtr m_MachineConfigurationType_GetSchemaType; + PLibMCDataMachineConfigurationType_GetTimestampPtr m_MachineConfigurationType_GetTimestamp; PLibMCDataMachineConfigurationType_GetLatestXSDPtr m_MachineConfigurationType_GetLatestXSD; - PLibMCDataMachineConfigurationType_GetLatestXSDVersionPtr m_MachineConfigurationType_GetLatestXSDVersion; + PLibMCDataMachineConfigurationType_ListXSDVersionsPtr m_MachineConfigurationType_ListXSDVersions; + PLibMCDataMachineConfigurationType_GetLatestXSDNumericVersionPtr m_MachineConfigurationType_GetLatestXSDNumericVersion; + PLibMCDataMachineConfigurationType_RegisterNewXSDPtr m_MachineConfigurationType_RegisterNewXSD; + PLibMCDataMachineConfigurationType_FindXSDByNumericVersionPtr m_MachineConfigurationType_FindXSDByNumericVersion; PLibMCDataMachineConfigurationType_FindXSDByUUIDPtr m_MachineConfigurationType_FindXSDByUUID; - PLibMCDataMachineConfigurationType_CreateNewXSDPtr m_MachineConfigurationType_CreateNewXSD; - PLibMCDataMachineConfigurationType_GetXSDVersionPtr m_MachineConfigurationType_GetXSDVersion; - PLibMCDataMachineConfigurationType_ListVersionsPtr m_MachineConfigurationType_ListVersions; - PLibMCDataMachineConfigurationType_FindVersionByUUIDPtr m_MachineConfigurationType_FindVersionByUUID; - PLibMCDataMachineConfigurationType_GetActiveVersionPtr m_MachineConfigurationType_GetActiveVersion; - PLibMCDataMachineConfigurationType_GetLatestVersionPtr m_MachineConfigurationType_GetLatestVersion; + PLibMCDataMachineConfigurationType_CreateDefaultConfigurationPtr m_MachineConfigurationType_CreateDefaultConfiguration; + PLibMCDataMachineConfigurationType_ListAllConfigurationVersionsPtr m_MachineConfigurationType_ListAllConfigurationVersions; + PLibMCDataMachineConfigurationType_ListConfigurationVersionsForXSDPtr m_MachineConfigurationType_ListConfigurationVersionsForXSD; + PLibMCDataMachineConfigurationType_FindConfigurationVersionByUUIDPtr m_MachineConfigurationType_FindConfigurationVersionByUUID; + PLibMCDataMachineConfigurationType_GetActiveConfigurationVersionPtr m_MachineConfigurationType_GetActiveConfigurationVersion; + PLibMCDataMachineConfigurationType_GetLatestConfigurationVersionPtr m_MachineConfigurationType_GetLatestConfigurationVersion; + PLibMCDataMachineConfigurationType_SetActiveConfigurationVersionPtr m_MachineConfigurationType_SetActiveConfigurationVersion; + PLibMCDataMachineConfigurationTypeIterator_GetCurrentPtr m_MachineConfigurationTypeIterator_GetCurrent; PLibMCDataInstallationInformation_GetInstallationUUIDPtr m_InstallationInformation_GetInstallationUUID; PLibMCDataInstallationInformation_GetInstallationSecretPtr m_InstallationInformation_GetInstallationSecret; PLibMCDataInstallationInformation_GetBaseTempDirectoryPtr m_InstallationInformation_GetBaseTempDirectory; @@ -3440,6 +3507,7 @@ typedef struct { PLibMCDataDataModel_SetLogCallbackPtr m_DataModel_SetLogCallback; PLibMCDataDataModel_ClearLogCallbackPtr m_DataModel_ClearLogCallback; PLibMCDataDataModel_HasLogCallbackPtr m_DataModel_HasLogCallback; + PLibMCDataDataModel_ListRegisteredConfigurationTypesPtr m_DataModel_ListRegisteredConfigurationTypes; PLibMCDataDataModel_FindConfigurationTypeBySchemaPtr m_DataModel_FindConfigurationTypeBySchema; PLibMCDataDataModel_FindConfigurationTypeByUUIDPtr m_DataModel_FindConfigurationTypeByUUID; PLibMCDataDataModel_CreateConfigurationTypePtr m_DataModel_CreateConfigurationType; diff --git a/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.hpp b/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.hpp index 6673f107..3f13691d 100644 --- a/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.hpp +++ b/Framework/HeadersCore/CppDynamic/libmcdata_dynamic.hpp @@ -88,7 +88,9 @@ class CPersistencyHandler; class CMachineConfigurationVersion; class CMachineConfigurationVersionIterator; class CMachineConfigurationXSD; +class CMachineConfigurationXSDIterator; class CMachineConfigurationType; +class CMachineConfigurationTypeIterator; class CInstallationInformation; class CDataModel; @@ -125,7 +127,9 @@ typedef CPersistencyHandler CLibMCDataPersistencyHandler; typedef CMachineConfigurationVersion CLibMCDataMachineConfigurationVersion; typedef CMachineConfigurationVersionIterator CLibMCDataMachineConfigurationVersionIterator; typedef CMachineConfigurationXSD CLibMCDataMachineConfigurationXSD; +typedef CMachineConfigurationXSDIterator CLibMCDataMachineConfigurationXSDIterator; typedef CMachineConfigurationType CLibMCDataMachineConfigurationType; +typedef CMachineConfigurationTypeIterator CLibMCDataMachineConfigurationTypeIterator; typedef CInstallationInformation CLibMCDataInstallationInformation; typedef CDataModel CLibMCDataDataModel; @@ -162,7 +166,9 @@ typedef std::shared_ptr PPersistencyHandler; typedef std::shared_ptr PMachineConfigurationVersion; typedef std::shared_ptr PMachineConfigurationVersionIterator; typedef std::shared_ptr PMachineConfigurationXSD; +typedef std::shared_ptr PMachineConfigurationXSDIterator; typedef std::shared_ptr PMachineConfigurationType; +typedef std::shared_ptr PMachineConfigurationTypeIterator; typedef std::shared_ptr PInstallationInformation; typedef std::shared_ptr PDataModel; @@ -199,7 +205,9 @@ typedef PPersistencyHandler PLibMCDataPersistencyHandler; typedef PMachineConfigurationVersion PLibMCDataMachineConfigurationVersion; typedef PMachineConfigurationVersionIterator PLibMCDataMachineConfigurationVersionIterator; typedef PMachineConfigurationXSD PLibMCDataMachineConfigurationXSD; +typedef PMachineConfigurationXSDIterator PLibMCDataMachineConfigurationXSDIterator; typedef PMachineConfigurationType PLibMCDataMachineConfigurationType; +typedef PMachineConfigurationTypeIterator PLibMCDataMachineConfigurationTypeIterator; typedef PInstallationInformation PLibMCDataInstallationInformation; typedef PDataModel PLibMCDataDataModel; @@ -650,6 +658,12 @@ class ELibMCDataException : public std::exception { case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE: return "COULDNOTFINDMACHINECONFIGURATIONTYPE"; case LIBMCDATA_ERROR_INVALIDSTORAGESTREAMSIZE: return "INVALIDSTORAGESTREAMSIZE"; case LIBMCDATA_ERROR_COULDNOTUPDATEBUILDNAME: return "COULDNOTUPDATEBUILDNAME"; + case LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID: return "INVALIDMACHINECONFIGURATIONTYPEUUID"; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING: return "MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING"; + case LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION: return "COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION"; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID: return "COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID"; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID: return "COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID"; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH: return "MACHINECONFIGURATIONTYPEMISMATCH"; } return "UNKNOWN"; } @@ -1027,6 +1041,12 @@ class ELibMCDataException : public std::exception { case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE: return "Could not find machine configuration type."; case LIBMCDATA_ERROR_INVALIDSTORAGESTREAMSIZE: return "Storage stream size for build is zero."; case LIBMCDATA_ERROR_COULDNOTUPDATEBUILDNAME: return "Could not update build name"; + case LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID: return "Invalid machine configuration type UUID."; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING: return "Machine configuration version is not incrementing."; + case LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION: return "Could not get latest machine configuration XSD version."; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID: return "Could not find latest machine configuration XSD by UUID."; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID: return "Could not find latest machine configuration version by UUID."; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH: return "Machine configuration mismatch."; } return "unknown error"; } @@ -1173,7 +1193,9 @@ class CWrapper { friend class CMachineConfigurationVersion; friend class CMachineConfigurationVersionIterator; friend class CMachineConfigurationXSD; + friend class CMachineConfigurationXSDIterator; friend class CMachineConfigurationType; + friend class CMachineConfigurationTypeIterator; friend class CInstallationInformation; friend class CDataModel; @@ -1872,14 +1894,13 @@ class CMachineConfigurationVersion : public CBase { inline std::string GetVersionUUID(); inline std::string GetXSDUUID(); - inline std::string GetTypeUUID(); + inline LibMCData_uint32 GetNumericVersion(); inline std::string GetParentUUID(); - inline std::string GetSchemaType(); - inline LibMCData_uint32 GetXSDVersion(); - inline std::string GetXSDString(); inline std::string GetConfigurationXMLString(); - inline PMachineConfigurationVersion CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC); - inline PMachineConfigurationVersion MigrateToNewXSD(classParam pNewXSD, const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC); + inline std::string GetUserUUID(); + inline std::string GetTimestamp(); + inline PMachineConfigurationVersion CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID); + inline PMachineConfigurationVersion MigrateToNewXSD(classParam pNewXSD, const std::string & sXMLString, const std::string & sUserUUID); }; /************************************************************************************************************************* @@ -1896,7 +1917,7 @@ class CMachineConfigurationVersionIterator : public CIterator { { } - inline PMachineConfigurationVersion GetCurrentVersion(); + inline PMachineConfigurationVersion GetCurrent(); }; /************************************************************************************************************************* @@ -1915,10 +1936,26 @@ class CMachineConfigurationXSD : public CBase { inline std::string GetUUID(); inline std::string GetTypeUUID(); - inline std::string GetSchemaType(); inline LibMCData_uint32 GetXSDVersion(); inline std::string GetXSDString(); - inline PMachineConfigurationVersionIterator ListVersions(); + inline std::string GetTimestamp(); +}; + +/************************************************************************************************************************* + Class CMachineConfigurationXSDIterator +**************************************************************************************************************************/ +class CMachineConfigurationXSDIterator : public CIterator { +public: + + /** + * CMachineConfigurationXSDIterator::CMachineConfigurationXSDIterator - Constructor for MachineConfigurationXSDIterator class. + */ + CMachineConfigurationXSDIterator(CWrapper* pWrapper, LibMCDataHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PMachineConfigurationXSD GetCurrent(); }; /************************************************************************************************************************* @@ -1938,15 +1975,37 @@ class CMachineConfigurationType : public CBase { inline std::string GetUUID(); inline std::string GetName(); inline std::string GetSchemaType(); + inline std::string GetTimestamp(); inline PMachineConfigurationXSD GetLatestXSD(); - inline LibMCData_uint32 GetLatestXSDVersion(); + inline PMachineConfigurationXSDIterator ListXSDVersions(); + inline LibMCData_uint32 GetLatestXSDNumericVersion(); + inline PMachineConfigurationXSD RegisterNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion); + inline PMachineConfigurationXSD FindXSDByNumericVersion(const LibMCData_uint32 nXSDNumericVersion); inline PMachineConfigurationXSD FindXSDByUUID(const std::string & sXSDUUID); - inline PMachineConfigurationXSD CreateNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML); - inline PMachineConfigurationXSD GetXSDVersion(const LibMCData_uint32 nXSDVersion); - inline PMachineConfigurationVersionIterator ListVersions(); - inline PMachineConfigurationVersion FindVersionByUUID(const std::string & sVersionUUID); - inline PMachineConfigurationVersion GetActiveVersion(const std::string & sVersionUUID); - inline PMachineConfigurationVersion GetLatestVersion(); + inline PMachineConfigurationVersion CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC); + inline PMachineConfigurationVersionIterator ListAllConfigurationVersions(); + inline PMachineConfigurationVersionIterator ListConfigurationVersionsForXSD(const std::string & sXSDUUID); + inline PMachineConfigurationVersion FindConfigurationVersionByUUID(const std::string & sVersionUUID); + inline PMachineConfigurationVersion GetActiveConfigurationVersion(); + inline PMachineConfigurationVersion GetLatestConfigurationVersion(); + inline void SetActiveConfigurationVersion(const std::string & sVersionUUID); +}; + +/************************************************************************************************************************* + Class CMachineConfigurationTypeIterator +**************************************************************************************************************************/ +class CMachineConfigurationTypeIterator : public CIterator { +public: + + /** + * CMachineConfigurationTypeIterator::CMachineConfigurationTypeIterator - Constructor for MachineConfigurationTypeIterator class. + */ + CMachineConfigurationTypeIterator(CWrapper* pWrapper, LibMCDataHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PMachineConfigurationType GetCurrent(); }; /************************************************************************************************************************* @@ -1999,6 +2058,7 @@ class CDataModel : public CBase { inline void SetLogCallback(const LogCallback pLogCallback, const LibMCData_pvoid pUserData); inline void ClearLogCallback(); inline bool HasLogCallback(); + inline PMachineConfigurationTypeIterator ListRegisteredConfigurationTypes(); inline PMachineConfigurationType FindConfigurationTypeBySchema(const std::string & sSchemaType); inline PMachineConfigurationType FindConfigurationTypeByUUID(const std::string & sUUID); inline PMachineConfigurationType CreateConfigurationType(const std::string & sSchemaType, const std::string & sName); @@ -2323,33 +2383,38 @@ class CDataModel : public CBase { pWrapperTable->m_PersistencyHandler_RetrievePersistentBoolParameter = nullptr; pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID = nullptr; pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion = nullptr; pWrapperTable->m_MachineConfigurationVersion_GetParentUUID = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetSchemaType = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetXSDString = nullptr; pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetUserUUID = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetTimestamp = nullptr; pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion = nullptr; pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD = nullptr; - pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrentVersion = nullptr; + pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent = nullptr; pWrapperTable->m_MachineConfigurationXSD_GetUUID = nullptr; pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID = nullptr; - pWrapperTable->m_MachineConfigurationXSD_GetSchemaType = nullptr; pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion = nullptr; pWrapperTable->m_MachineConfigurationXSD_GetXSDString = nullptr; - pWrapperTable->m_MachineConfigurationXSD_ListVersions = nullptr; + pWrapperTable->m_MachineConfigurationXSD_GetTimestamp = nullptr; + pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent = nullptr; pWrapperTable->m_MachineConfigurationType_GetUUID = nullptr; pWrapperTable->m_MachineConfigurationType_GetName = nullptr; pWrapperTable->m_MachineConfigurationType_GetSchemaType = nullptr; + pWrapperTable->m_MachineConfigurationType_GetTimestamp = nullptr; pWrapperTable->m_MachineConfigurationType_GetLatestXSD = nullptr; - pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_ListXSDVersions = nullptr; + pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_RegisterNewXSD = nullptr; + pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion = nullptr; pWrapperTable->m_MachineConfigurationType_FindXSDByUUID = nullptr; - pWrapperTable->m_MachineConfigurationType_CreateNewXSD = nullptr; - pWrapperTable->m_MachineConfigurationType_GetXSDVersion = nullptr; - pWrapperTable->m_MachineConfigurationType_ListVersions = nullptr; - pWrapperTable->m_MachineConfigurationType_FindVersionByUUID = nullptr; - pWrapperTable->m_MachineConfigurationType_GetActiveVersion = nullptr; - pWrapperTable->m_MachineConfigurationType_GetLatestVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration = nullptr; + pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions = nullptr; + pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD = nullptr; + pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID = nullptr; + pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion = nullptr; + pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent = nullptr; pWrapperTable->m_InstallationInformation_GetInstallationUUID = nullptr; pWrapperTable->m_InstallationInformation_GetInstallationSecret = nullptr; pWrapperTable->m_InstallationInformation_GetBaseTempDirectory = nullptr; @@ -2370,6 +2435,7 @@ class CDataModel : public CBase { pWrapperTable->m_DataModel_SetLogCallback = nullptr; pWrapperTable->m_DataModel_ClearLogCallback = nullptr; pWrapperTable->m_DataModel_HasLogCallback = nullptr; + pWrapperTable->m_DataModel_ListRegisteredConfigurationTypes = nullptr; pWrapperTable->m_DataModel_FindConfigurationTypeBySchema = nullptr; pWrapperTable->m_DataModel_FindConfigurationTypeByUUID = nullptr; pWrapperTable->m_DataModel_CreateConfigurationType = nullptr; @@ -4429,12 +4495,12 @@ class CDataModel : public CBase { return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID = (PLibMCDataMachineConfigurationVersion_GetTypeUUIDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_gettypeuuid"); + pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion = (PLibMCDataMachineConfigurationVersion_GetNumericVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getnumericversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID = (PLibMCDataMachineConfigurationVersion_GetTypeUUIDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_gettypeuuid"); + pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion = (PLibMCDataMachineConfigurationVersion_GetNumericVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getnumericversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -4447,39 +4513,30 @@ class CDataModel : public CBase { return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetSchemaType = (PLibMCDataMachineConfigurationVersion_GetSchemaTypePtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getschematype"); - #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetSchemaType = (PLibMCDataMachineConfigurationVersion_GetSchemaTypePtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getschematype"); - dlerror(); - #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetSchemaType == nullptr) - return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - - #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion = (PLibMCDataMachineConfigurationVersion_GetXSDVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getxsdversion"); + pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString = (PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getconfigurationxmlstring"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion = (PLibMCDataMachineConfigurationVersion_GetXSDVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getxsdversion"); + pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString = (PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getconfigurationxmlstring"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDString = (PLibMCDataMachineConfigurationVersion_GetXSDStringPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getxsdstring"); + pWrapperTable->m_MachineConfigurationVersion_GetUserUUID = (PLibMCDataMachineConfigurationVersion_GetUserUUIDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getuseruuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDString = (PLibMCDataMachineConfigurationVersion_GetXSDStringPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getxsdstring"); + pWrapperTable->m_MachineConfigurationVersion_GetUserUUID = (PLibMCDataMachineConfigurationVersion_GetUserUUIDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getuseruuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetXSDString == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetUserUUID == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString = (PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_getconfigurationxmlstring"); + pWrapperTable->m_MachineConfigurationVersion_GetTimestamp = (PLibMCDataMachineConfigurationVersion_GetTimestampPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversion_gettimestamp"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString = (PLibMCDataMachineConfigurationVersion_GetConfigurationXMLStringPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_getconfigurationxmlstring"); + pWrapperTable->m_MachineConfigurationVersion_GetTimestamp = (PLibMCDataMachineConfigurationVersion_GetTimestampPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversion_gettimestamp"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetTimestamp == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -4501,12 +4558,12 @@ class CDataModel : public CBase { return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrentVersion = (PLibMCDataMachineConfigurationVersionIterator_GetCurrentVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversioniterator_getcurrentversion"); + pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent = (PLibMCDataMachineConfigurationVersionIterator_GetCurrentPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationversioniterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrentVersion = (PLibMCDataMachineConfigurationVersionIterator_GetCurrentVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversioniterator_getcurrentversion"); + pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent = (PLibMCDataMachineConfigurationVersionIterator_GetCurrentPtr) dlsym(hLibrary, "libmcdata_machineconfigurationversioniterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrentVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -4527,15 +4584,6 @@ class CDataModel : public CBase { if (pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationXSD_GetSchemaType = (PLibMCDataMachineConfigurationXSD_GetSchemaTypePtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationxsd_getschematype"); - #else // _WIN32 - pWrapperTable->m_MachineConfigurationXSD_GetSchemaType = (PLibMCDataMachineConfigurationXSD_GetSchemaTypePtr) dlsym(hLibrary, "libmcdata_machineconfigurationxsd_getschematype"); - dlerror(); - #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationXSD_GetSchemaType == nullptr) - return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - #ifdef _WIN32 pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion = (PLibMCDataMachineConfigurationXSD_GetXSDVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationxsd_getxsdversion"); #else // _WIN32 @@ -4555,12 +4603,21 @@ class CDataModel : public CBase { return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationXSD_ListVersions = (PLibMCDataMachineConfigurationXSD_ListVersionsPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationxsd_listversions"); + pWrapperTable->m_MachineConfigurationXSD_GetTimestamp = (PLibMCDataMachineConfigurationXSD_GetTimestampPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationxsd_gettimestamp"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationXSD_ListVersions = (PLibMCDataMachineConfigurationXSD_ListVersionsPtr) dlsym(hLibrary, "libmcdata_machineconfigurationxsd_listversions"); + pWrapperTable->m_MachineConfigurationXSD_GetTimestamp = (PLibMCDataMachineConfigurationXSD_GetTimestampPtr) dlsym(hLibrary, "libmcdata_machineconfigurationxsd_gettimestamp"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationXSD_ListVersions == nullptr) + if (pWrapperTable->m_MachineConfigurationXSD_GetTimestamp == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent = (PLibMCDataMachineConfigurationXSDIterator_GetCurrentPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationxsditerator_getcurrent"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent = (PLibMCDataMachineConfigurationXSDIterator_GetCurrentPtr) dlsym(hLibrary, "libmcdata_machineconfigurationxsditerator_getcurrent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -4590,6 +4647,15 @@ class CDataModel : public CBase { if (pWrapperTable->m_MachineConfigurationType_GetSchemaType == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_GetTimestamp = (PLibMCDataMachineConfigurationType_GetTimestampPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_gettimestamp"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_GetTimestamp = (PLibMCDataMachineConfigurationType_GetTimestampPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_gettimestamp"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_GetTimestamp == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_MachineConfigurationType_GetLatestXSD = (PLibMCDataMachineConfigurationType_GetLatestXSDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getlatestxsd"); #else // _WIN32 @@ -4600,12 +4666,39 @@ class CDataModel : public CBase { return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion = (PLibMCDataMachineConfigurationType_GetLatestXSDVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getlatestxsdversion"); + pWrapperTable->m_MachineConfigurationType_ListXSDVersions = (PLibMCDataMachineConfigurationType_ListXSDVersionsPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_listxsdversions"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_ListXSDVersions = (PLibMCDataMachineConfigurationType_ListXSDVersionsPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_listxsdversions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_ListXSDVersions == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion = (PLibMCDataMachineConfigurationType_GetLatestXSDNumericVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getlatestxsdnumericversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion = (PLibMCDataMachineConfigurationType_GetLatestXSDVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getlatestxsdversion"); + pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion = (PLibMCDataMachineConfigurationType_GetLatestXSDNumericVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getlatestxsdnumericversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_RegisterNewXSD = (PLibMCDataMachineConfigurationType_RegisterNewXSDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_registernewxsd"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_RegisterNewXSD = (PLibMCDataMachineConfigurationType_RegisterNewXSDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_registernewxsd"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_RegisterNewXSD == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion = (PLibMCDataMachineConfigurationType_FindXSDByNumericVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_findxsdbynumericversion"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion = (PLibMCDataMachineConfigurationType_FindXSDByNumericVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_findxsdbynumericversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -4618,57 +4711,75 @@ class CDataModel : public CBase { return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_CreateNewXSD = (PLibMCDataMachineConfigurationType_CreateNewXSDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_createnewxsd"); + pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration = (PLibMCDataMachineConfigurationType_CreateDefaultConfigurationPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_createdefaultconfiguration"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_CreateNewXSD = (PLibMCDataMachineConfigurationType_CreateNewXSDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_createnewxsd"); + pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration = (PLibMCDataMachineConfigurationType_CreateDefaultConfigurationPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_createdefaultconfiguration"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_CreateNewXSD == nullptr) + if (pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetXSDVersion = (PLibMCDataMachineConfigurationType_GetXSDVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getxsdversion"); + pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions = (PLibMCDataMachineConfigurationType_ListAllConfigurationVersionsPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_listallconfigurationversions"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetXSDVersion = (PLibMCDataMachineConfigurationType_GetXSDVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getxsdversion"); + pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions = (PLibMCDataMachineConfigurationType_ListAllConfigurationVersionsPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_listallconfigurationversions"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetXSDVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_ListVersions = (PLibMCDataMachineConfigurationType_ListVersionsPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_listversions"); + pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD = (PLibMCDataMachineConfigurationType_ListConfigurationVersionsForXSDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_listconfigurationversionsforxsd"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_ListVersions = (PLibMCDataMachineConfigurationType_ListVersionsPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_listversions"); + pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD = (PLibMCDataMachineConfigurationType_ListConfigurationVersionsForXSDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_listconfigurationversionsforxsd"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_ListVersions == nullptr) + if (pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_FindVersionByUUID = (PLibMCDataMachineConfigurationType_FindVersionByUUIDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_findversionbyuuid"); + pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID = (PLibMCDataMachineConfigurationType_FindConfigurationVersionByUUIDPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_findconfigurationversionbyuuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_FindVersionByUUID = (PLibMCDataMachineConfigurationType_FindVersionByUUIDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_findversionbyuuid"); + pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID = (PLibMCDataMachineConfigurationType_FindConfigurationVersionByUUIDPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_findconfigurationversionbyuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_FindVersionByUUID == nullptr) + if (pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetActiveVersion = (PLibMCDataMachineConfigurationType_GetActiveVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getactiveversion"); + pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion = (PLibMCDataMachineConfigurationType_GetActiveConfigurationVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getactiveconfigurationversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetActiveVersion = (PLibMCDataMachineConfigurationType_GetActiveVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getactiveversion"); + pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion = (PLibMCDataMachineConfigurationType_GetActiveConfigurationVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getactiveconfigurationversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetActiveVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestVersion = (PLibMCDataMachineConfigurationType_GetLatestVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getlatestversion"); + pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion = (PLibMCDataMachineConfigurationType_GetLatestConfigurationVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_getlatestconfigurationversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestVersion = (PLibMCDataMachineConfigurationType_GetLatestVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getlatestversion"); + pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion = (PLibMCDataMachineConfigurationType_GetLatestConfigurationVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_getlatestconfigurationversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetLatestVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion = (PLibMCDataMachineConfigurationType_SetActiveConfigurationVersionPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtype_setactiveconfigurationversion"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion = (PLibMCDataMachineConfigurationType_SetActiveConfigurationVersionPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtype_setactiveconfigurationversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent = (PLibMCDataMachineConfigurationTypeIterator_GetCurrentPtr) GetProcAddress(hLibrary, "libmcdata_machineconfigurationtypeiterator_getcurrent"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent = (PLibMCDataMachineConfigurationTypeIterator_GetCurrentPtr) dlsym(hLibrary, "libmcdata_machineconfigurationtypeiterator_getcurrent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -4851,6 +4962,15 @@ class CDataModel : public CBase { if (pWrapperTable->m_DataModel_HasLogCallback == nullptr) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_DataModel_ListRegisteredConfigurationTypes = (PLibMCDataDataModel_ListRegisteredConfigurationTypesPtr) GetProcAddress(hLibrary, "libmcdata_datamodel_listregisteredconfigurationtypes"); + #else // _WIN32 + pWrapperTable->m_DataModel_ListRegisteredConfigurationTypes = (PLibMCDataDataModel_ListRegisteredConfigurationTypesPtr) dlsym(hLibrary, "libmcdata_datamodel_listregisteredconfigurationtypes"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_DataModel_ListRegisteredConfigurationTypes == nullptr) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_DataModel_FindConfigurationTypeBySchema = (PLibMCDataDataModel_FindConfigurationTypeBySchemaPtr) GetProcAddress(hLibrary, "libmcdata_datamodel_findconfigurationtypebyschema"); #else // _WIN32 @@ -5845,28 +5965,24 @@ class CDataModel : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_gettypeuuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getnumericversion", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getparentuuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetParentUUID)); if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetParentUUID == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getschematype", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetSchemaType)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetSchemaType == nullptr) ) - return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - - eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getconfigurationxmlstring", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getxsdstring", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetXSDString)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetXSDString == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getuseruuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetUserUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetUserUUID == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_getconfigurationxmlstring", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_gettimestamp", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetTimestamp)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetTimestamp == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcdata_machineconfigurationversion_createnewversion", (void**)&(pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion)); @@ -5877,8 +5993,8 @@ class CDataModel : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationversioniterator_getcurrentversion", (void**)&(pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrentVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrentVersion == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationversioniterator_getcurrent", (void**)&(pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcdata_machineconfigurationxsd_getuuid", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetUUID)); @@ -5889,10 +6005,6 @@ class CDataModel : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationxsd_getschematype", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetSchemaType)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetSchemaType == nullptr) ) - return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationxsd_getxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion)); if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -5901,8 +6013,12 @@ class CDataModel : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetXSDString == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationxsd_listversions", (void**)&(pWrapperTable->m_MachineConfigurationXSD_ListVersions)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_ListVersions == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationxsd_gettimestamp", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetTimestamp)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetTimestamp == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcdata_machineconfigurationxsditerator_getcurrent", (void**)&(pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_GetUUID)); @@ -5917,40 +6033,64 @@ class CDataModel : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetSchemaType == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_gettimestamp", (void**)&(pWrapperTable->m_MachineConfigurationType_GetTimestamp)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetTimestamp == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getlatestxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestXSD)); if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestXSD == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getlatestxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_listxsdversions", (void**)&(pWrapperTable->m_MachineConfigurationType_ListXSDVersions)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListXSDVersions == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getlatestxsdnumericversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_registernewxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_RegisterNewXSD)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_RegisterNewXSD == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_findxsdbynumericversion", (void**)&(pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_findxsdbyuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_FindXSDByUUID)); if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindXSDByUUID == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_createnewxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_CreateNewXSD)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_CreateNewXSD == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_createdefaultconfiguration", (void**)&(pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_listallconfigurationversions", (void**)&(pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetXSDVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetXSDVersion == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_listconfigurationversionsforxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_listversions", (void**)&(pWrapperTable->m_MachineConfigurationType_ListVersions)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListVersions == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_findconfigurationversionbyuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_findversionbyuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_FindVersionByUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindVersionByUUID == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getactiveconfigurationversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getactiveversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetActiveVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetActiveVersion == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getlatestconfigurationversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_getlatestversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestVersion == nullptr) ) + eLookupError = (*pLookup)("libmcdata_machineconfigurationtype_setactiveconfigurationversion", (void**)&(pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcdata_machineconfigurationtypeiterator_getcurrent", (void**)&(pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcdata_installationinformation_getinstallationuuid", (void**)&(pWrapperTable->m_InstallationInformation_GetInstallationUUID)); @@ -6033,6 +6173,10 @@ class CDataModel : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_DataModel_HasLogCallback == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("libmcdata_datamodel_listregisteredconfigurationtypes", (void**)&(pWrapperTable->m_DataModel_ListRegisteredConfigurationTypes)); + if ( (eLookupError != 0) || (pWrapperTable->m_DataModel_ListRegisteredConfigurationTypes == nullptr) ) + return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("libmcdata_datamodel_findconfigurationtypebyschema", (void**)&(pWrapperTable->m_DataModel_FindConfigurationTypeBySchema)); if ( (eLookupError != 0) || (pWrapperTable->m_DataModel_FindConfigurationTypeBySchema == nullptr) ) return LIBMCDATA_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -9306,7 +9450,7 @@ class CDataModel : public CBase { */ /** - * CMachineConfigurationVersion::GetVersionUUID - Returns the UUID. + * CMachineConfigurationVersion::GetVersionUUID - Returns the UUID of the configuration version. * @return UUID of the configuration version. */ std::string CMachineConfigurationVersion::GetVersionUUID() @@ -9321,7 +9465,7 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationVersion::GetXSDUUID - Returns the UUID. + * CMachineConfigurationVersion::GetXSDUUID - Returns the UUID of the XSD used by this configuration version. * @return UUID of the configuration XSD. */ std::string CMachineConfigurationVersion::GetXSDUUID() @@ -9336,23 +9480,20 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationVersion::GetTypeUUID - Returns the UUID of the corresponding Configuration type. - * @return UUID of the configuration type. + * CMachineConfigurationVersion::GetNumericVersion - Returns the numeric version of the configuration version. + * @return Returns the configuration numeric version. */ - std::string CMachineConfigurationVersion::GetTypeUUID() + LibMCData_uint32 CMachineConfigurationVersion::GetNumericVersion() { - LibMCData_uint32 bytesNeededTypeUUID = 0; - LibMCData_uint32 bytesWrittenTypeUUID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTypeUUID(m_pHandle, 0, &bytesNeededTypeUUID, nullptr)); - std::vector bufferTypeUUID(bytesNeededTypeUUID); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTypeUUID(m_pHandle, bytesNeededTypeUUID, &bytesWrittenTypeUUID, &bufferTypeUUID[0])); + LibMCData_uint32 resultConfigurationNumericVersion = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetNumericVersion(m_pHandle, &resultConfigurationNumericVersion)); - return std::string(&bufferTypeUUID[0]); + return resultConfigurationNumericVersion; } /** - * CMachineConfigurationVersion::GetParentUUID - Returns the UUID of the parent Configuration Version. - * @return UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000, if Version is the default configuration. + * CMachineConfigurationVersion::GetParentUUID - Returns the UUID of the parent version. + * @return UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version. */ std::string CMachineConfigurationVersion::GetParentUUID() { @@ -9366,73 +9507,60 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationVersion::GetSchemaType - Returns the Schema type of the configuration. - * @return Schema type of the configuration type. - */ - std::string CMachineConfigurationVersion::GetSchemaType() - { - LibMCData_uint32 bytesNeededSchemaType = 0; - LibMCData_uint32 bytesWrittenSchemaType = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetSchemaType(m_pHandle, 0, &bytesNeededSchemaType, nullptr)); - std::vector bufferSchemaType(bytesNeededSchemaType); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetSchemaType(m_pHandle, bytesNeededSchemaType, &bytesWrittenSchemaType, &bufferSchemaType[0])); - - return std::string(&bufferSchemaType[0]); - } - - /** - * CMachineConfigurationVersion::GetXSDVersion - Returns the version number of the XSD in use.. - * @return Returns the XSD version. + * CMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration XML content as string. + * @return XML String. */ - LibMCData_uint32 CMachineConfigurationVersion::GetXSDVersion() + std::string CMachineConfigurationVersion::GetConfigurationXMLString() { - LibMCData_uint32 resultXSDVersion = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDVersion(m_pHandle, &resultXSDVersion)); + LibMCData_uint32 bytesNeededXMLString = 0; + LibMCData_uint32 bytesWrittenXMLString = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetConfigurationXMLString(m_pHandle, 0, &bytesNeededXMLString, nullptr)); + std::vector bufferXMLString(bytesNeededXMLString); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetConfigurationXMLString(m_pHandle, bytesNeededXMLString, &bytesWrittenXMLString, &bufferXMLString[0])); - return resultXSDVersion; + return std::string(&bufferXMLString[0]); } /** - * CMachineConfigurationVersion::GetXSDString - Returns the XSD in use as string.. - * @return XSD String. + * CMachineConfigurationVersion::GetUserUUID - Returns the User UUID. + * @return UUID of the User. */ - std::string CMachineConfigurationVersion::GetXSDString() + std::string CMachineConfigurationVersion::GetUserUUID() { - LibMCData_uint32 bytesNeededXSDString = 0; - LibMCData_uint32 bytesWrittenXSDString = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDString(m_pHandle, 0, &bytesNeededXSDString, nullptr)); - std::vector bufferXSDString(bytesNeededXSDString); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDString(m_pHandle, bytesNeededXSDString, &bytesWrittenXSDString, &bufferXSDString[0])); + LibMCData_uint32 bytesNeededUserUUID = 0; + LibMCData_uint32 bytesWrittenUserUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetUserUUID(m_pHandle, 0, &bytesNeededUserUUID, nullptr)); + std::vector bufferUserUUID(bytesNeededUserUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetUserUUID(m_pHandle, bytesNeededUserUUID, &bytesWrittenUserUUID, &bufferUserUUID[0])); - return std::string(&bufferXSDString[0]); + return std::string(&bufferUserUUID[0]); } /** - * CMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration XML as String. - * @return XML String. + * CMachineConfigurationVersion::GetTimestamp - Returns the creation timestamp of the configuration version. + * @return UTC timestamp of creation. */ - std::string CMachineConfigurationVersion::GetConfigurationXMLString() + std::string CMachineConfigurationVersion::GetTimestamp() { - LibMCData_uint32 bytesNeededXMLString = 0; - LibMCData_uint32 bytesWrittenXMLString = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetConfigurationXMLString(m_pHandle, 0, &bytesNeededXMLString, nullptr)); - std::vector bufferXMLString(bytesNeededXMLString); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetConfigurationXMLString(m_pHandle, bytesNeededXMLString, &bytesWrittenXMLString, &bufferXMLString[0])); + LibMCData_uint32 bytesNeededTimeStampUTC = 0; + LibMCData_uint32 bytesWrittenTimeStampUTC = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTimestamp(m_pHandle, 0, &bytesNeededTimeStampUTC, nullptr)); + std::vector bufferTimeStampUTC(bytesNeededTimeStampUTC); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTimestamp(m_pHandle, bytesNeededTimeStampUTC, &bytesWrittenTimeStampUTC, &bufferTimeStampUTC[0])); - return std::string(&bufferXMLString[0]); + return std::string(&bufferTimeStampUTC[0]); } /** - * CMachineConfigurationVersion::CreateNewVersion - Creates a new configuration version from this version with the same XSD. + * CMachineConfigurationVersion::CreateNewVersion - Creates a new configuration version from this one with the same XSD. * @param[in] sXMLString - New XML Configuration String. MUST conform to current XSD. * @param[in] sUserUUID - User UUID for logging the user who initiated the change. - * @param[in] sTimeStampUTC - Current time in UTC. - * @return returns the MachineConfigurationVersion instance. + * @return Returns the newly created MachineConfigurationVersion instance. */ - PMachineConfigurationVersion CMachineConfigurationVersion::CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) + PMachineConfigurationVersion CMachineConfigurationVersion::CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID) { LibMCDataHandle hCurrentInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_CreateNewVersion(m_pHandle, sXMLString.c_str(), sUserUUID.c_str(), sTimeStampUTC.c_str(), &hCurrentInstance)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_CreateNewVersion(m_pHandle, sXMLString.c_str(), sUserUUID.c_str(), &hCurrentInstance)); if (!hCurrentInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); @@ -9441,18 +9569,17 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationVersion::MigrateToNewXSD - Creates a new configuration version from this version with another XSD. + * CMachineConfigurationVersion::MigrateToNewXSD - Creates a new configuration version from this one but with a different XSD. * @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. * @param[in] sXMLString - New XML Configuration String. MUST conform to new XSD. * @param[in] sUserUUID - User UUID for logging the user who initiated the change. - * @param[in] sTimeStampUTC - Current time in UTC. - * @return returns the MachineConfigurationVersion instance. + * @return Returns the newly created MachineConfigurationVersion instance. */ - PMachineConfigurationVersion CMachineConfigurationVersion::MigrateToNewXSD(classParam pNewXSD, const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) + PMachineConfigurationVersion CMachineConfigurationVersion::MigrateToNewXSD(classParam pNewXSD, const std::string & sXMLString, const std::string & sUserUUID) { LibMCDataHandle hNewXSD = pNewXSD.GetHandle(); LibMCDataHandle hCurrentInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_MigrateToNewXSD(m_pHandle, hNewXSD, sXMLString.c_str(), sUserUUID.c_str(), sTimeStampUTC.c_str(), &hCurrentInstance)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_MigrateToNewXSD(m_pHandle, hNewXSD, sXMLString.c_str(), sUserUUID.c_str(), &hCurrentInstance)); if (!hCurrentInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); @@ -9465,18 +9592,18 @@ class CDataModel : public CBase { */ /** - * CMachineConfigurationVersionIterator::GetCurrentVersion - Returns the version the iterator points at. - * @return returns the MachineConfigurationVersion instance. + * CMachineConfigurationVersionIterator::GetCurrent - Returns the current MachineConfigurationVersion instance. + * @return Currently selected configuration version instance. */ - PMachineConfigurationVersion CMachineConfigurationVersionIterator::GetCurrentVersion() + PMachineConfigurationVersion CMachineConfigurationVersionIterator::GetCurrent() { - LibMCDataHandle hCurrentInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersionIterator_GetCurrentVersion(m_pHandle, &hCurrentInstance)); + LibMCDataHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersionIterator_GetCurrent(m_pHandle, &hInstance)); - if (!hCurrentInstance) { + if (!hInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hCurrentInstance); + return std::make_shared(m_pWrapper, hInstance); } /** @@ -9484,7 +9611,7 @@ class CDataModel : public CBase { */ /** - * CMachineConfigurationXSD::GetUUID - Returns the UUID. + * CMachineConfigurationXSD::GetUUID - Returns the UUID of the XSD. * @return UUID of the configuration XSD. */ std::string CMachineConfigurationXSD::GetUUID() @@ -9499,7 +9626,7 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationXSD::GetTypeUUID - Returns the UUID of the corresponding Configuration type. + * CMachineConfigurationXSD::GetTypeUUID - Returns the UUID of the associated configuration type. * @return UUID of the configuration type. */ std::string CMachineConfigurationXSD::GetTypeUUID() @@ -9514,22 +9641,7 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationXSD::GetSchemaType - Returns the Schema type of the configuration. - * @return Schema type of the configuration type. - */ - std::string CMachineConfigurationXSD::GetSchemaType() - { - LibMCData_uint32 bytesNeededSchemaType = 0; - LibMCData_uint32 bytesWrittenSchemaType = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetSchemaType(m_pHandle, 0, &bytesNeededSchemaType, nullptr)); - std::vector bufferSchemaType(bytesNeededSchemaType); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetSchemaType(m_pHandle, bytesNeededSchemaType, &bytesWrittenSchemaType, &bufferSchemaType[0])); - - return std::string(&bufferSchemaType[0]); - } - - /** - * CMachineConfigurationXSD::GetXSDVersion - Returns the version number of the XSD.. + * CMachineConfigurationXSD::GetXSDVersion - Returns the version number of the XSD. * @return Returns the XSD version. */ LibMCData_uint32 CMachineConfigurationXSD::GetXSDVersion() @@ -9541,7 +9653,7 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationXSD::GetXSDString - Returns the XSD as string.. + * CMachineConfigurationXSD::GetXSDString - Returns the XSD content as string. * @return XSD String. */ std::string CMachineConfigurationXSD::GetXSDString() @@ -9556,18 +9668,37 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationXSD::ListVersions - Lists all known Configuration version of the current XSD. - * @return Returns a list of versions. + * CMachineConfigurationXSD::GetTimestamp - Returns the creation timestamp of the XSD version. + * @return UTC timestamp of XSD creation. */ - PMachineConfigurationVersionIterator CMachineConfigurationXSD::ListVersions() + std::string CMachineConfigurationXSD::GetTimestamp() { - LibMCDataHandle hVersionIterator = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_ListVersions(m_pHandle, &hVersionIterator)); + LibMCData_uint32 bytesNeededTimeStampUTC = 0; + LibMCData_uint32 bytesWrittenTimeStampUTC = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetTimestamp(m_pHandle, 0, &bytesNeededTimeStampUTC, nullptr)); + std::vector bufferTimeStampUTC(bytesNeededTimeStampUTC); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetTimestamp(m_pHandle, bytesNeededTimeStampUTC, &bytesWrittenTimeStampUTC, &bufferTimeStampUTC[0])); - if (!hVersionIterator) { + return std::string(&bufferTimeStampUTC[0]); + } + + /** + * Method definitions for class CMachineConfigurationXSDIterator + */ + + /** + * CMachineConfigurationXSDIterator::GetCurrent - Returns the current MachineConfigurationXSD instance. + * @return Currently selected configuration XSD instance. + */ + PMachineConfigurationXSD CMachineConfigurationXSDIterator::GetCurrent() + { + LibMCDataHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSDIterator_GetCurrent(m_pHandle, &hInstance)); + + if (!hInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hVersionIterator); + return std::make_shared(m_pWrapper, hInstance); } /** @@ -9575,7 +9706,7 @@ class CDataModel : public CBase { */ /** - * CMachineConfigurationType::GetUUID - Returns the UUID. + * CMachineConfigurationType::GetUUID - Returns the UUID of the configuration type. * @return UUID of the configuration type. */ std::string CMachineConfigurationType::GetUUID() @@ -9590,7 +9721,7 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetName - Returns the Name. + * CMachineConfigurationType::GetName - Returns the name of the configuration type. * @return Name of the configuration type. */ std::string CMachineConfigurationType::GetName() @@ -9605,7 +9736,7 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetSchemaType - Returns the Schema type of the configuration. + * CMachineConfigurationType::GetSchemaType - Returns the schema type string of the configuration type. * @return Schema type of the configuration type. */ std::string CMachineConfigurationType::GetSchemaType() @@ -9620,8 +9751,23 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetLatestXSD - Returns the latest Machine Configuration XSD. - * @return Returns the latest XSD of the configuration type. + * CMachineConfigurationType::GetTimestamp - Returns the creation timestamp of the type. + * @return UTC timestamp of Type creation. + */ + std::string CMachineConfigurationType::GetTimestamp() + { + LibMCData_uint32 bytesNeededTimeStampUTC = 0; + LibMCData_uint32 bytesWrittenTimeStampUTC = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTimestamp(m_pHandle, 0, &bytesNeededTimeStampUTC, nullptr)); + std::vector bufferTimeStampUTC(bytesNeededTimeStampUTC); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTimestamp(m_pHandle, bytesNeededTimeStampUTC, &bytesWrittenTimeStampUTC, &bufferTimeStampUTC[0])); + + return std::string(&bufferTimeStampUTC[0]); + } + + /** + * CMachineConfigurationType::GetLatestXSD - Returns the latest XSD registered for this configuration type. + * @return Latest XSD of the configuration type. */ PMachineConfigurationXSD CMachineConfigurationType::GetLatestXSD() { @@ -9635,26 +9781,42 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetLatestXSDVersion - Returns the latest Machine Configuration XSD Version. - * @return Returns the latest XSD version, or 0 if no XSD exists. + * CMachineConfigurationType::ListXSDVersions - Returns all XSDs associated with this configuration type. + * @return List of XSDs. */ - LibMCData_uint32 CMachineConfigurationType::GetLatestXSDVersion() + PMachineConfigurationXSDIterator CMachineConfigurationType::ListXSDVersions() { - LibMCData_uint32 resultXSDVersion = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestXSDVersion(m_pHandle, &resultXSDVersion)); + LibMCDataHandle hXSDIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListXSDVersions(m_pHandle, &hXSDIterator)); - return resultXSDVersion; + if (!hXSDIterator) { + CheckError(LIBMCDATA_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hXSDIterator); } /** - * CMachineConfigurationType::FindXSDByUUID - Finds Machine Configuration XSD by UUID. - * @param[in] sXSDUUID - UUID of the configuration XSD. - * @return Returns the latest XSD of the configuration type. + * CMachineConfigurationType::GetLatestXSDNumericVersion - Returns the version number of the latest XSD for this type. + * @return Latest XSD version number, or 0 if none exist. */ - PMachineConfigurationXSD CMachineConfigurationType::FindXSDByUUID(const std::string & sXSDUUID) + LibMCData_uint32 CMachineConfigurationType::GetLatestXSDNumericVersion() + { + LibMCData_uint32 resultXSDNumericVersion = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestXSDNumericVersion(m_pHandle, &resultXSDNumericVersion)); + + return resultXSDNumericVersion; + } + + /** + * CMachineConfigurationType::RegisterNewXSD - Registers a new XSD Version. Fails if version already exists or is not incrementing. + * @param[in] sXSDString - XSD String of the version. MUST be a valid schema of this type. + * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. + * @return Returns the new XSD of the configuration type. + */ + PMachineConfigurationXSD CMachineConfigurationType::RegisterNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion) { LibMCDataHandle hXSDInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindXSDByUUID(m_pHandle, sXSDUUID.c_str(), &hXSDInstance)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_RegisterNewXSD(m_pHandle, sXSDString.c_str(), nXSDVersion, &hXSDInstance)); if (!hXSDInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); @@ -9663,16 +9825,14 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::CreateNewXSD - Creates a new XSD Version. Fails if version already exists or is not incrementing. - * @param[in] sXSDString - XSD String of the version. MUST be incremental. - * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. - * @param[in] sDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. - * @return Returns the new XSD of the configuration type. + * CMachineConfigurationType::FindXSDByNumericVersion - Finds a specific XSD of this type by its Numeric Version Number. + * @param[in] nXSDNumericVersion - Requested version number. + * @return XSD instance if exists. */ - PMachineConfigurationXSD CMachineConfigurationType::CreateNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) + PMachineConfigurationXSD CMachineConfigurationType::FindXSDByNumericVersion(const LibMCData_uint32 nXSDNumericVersion) { LibMCDataHandle hXSDInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_CreateNewXSD(m_pHandle, sXSDString.c_str(), nXSDVersion, sDefaultConfigurationXML.c_str(), &hXSDInstance)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindXSDByNumericVersion(m_pHandle, nXSDNumericVersion, &hXSDInstance)); if (!hXSDInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); @@ -9681,14 +9841,14 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetXSDVersion - Returns an Configuration XSD Version. - * @param[in] nXSDVersion - Version to retrieve. - * @return Returns the XSD of the configuration type with the appropriate version number or null if it does not exist. + * CMachineConfigurationType::FindXSDByUUID - Finds a specific XSD of this type by its UUID. + * @param[in] sXSDUUID - UUID of the XSD. + * @return Matching XSD instance. */ - PMachineConfigurationXSD CMachineConfigurationType::GetXSDVersion(const LibMCData_uint32 nXSDVersion) + PMachineConfigurationXSD CMachineConfigurationType::FindXSDByUUID(const std::string & sXSDUUID) { LibMCDataHandle hXSDInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetXSDVersion(m_pHandle, nXSDVersion, &hXSDInstance)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindXSDByUUID(m_pHandle, sXSDUUID.c_str(), &hXSDInstance)); if (!hXSDInstance) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); @@ -9697,13 +9857,47 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::ListVersions - Lists all known Configuration version of the current type. - * @return Returns a list of versions. + * CMachineConfigurationType::CreateDefaultConfiguration - Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. + * @param[in] sXSDUUID - UUID of the XSD to base the default configuration on. + * @param[in] sDefaultXML - Configuration XML string conforming to the given XSD. + * @param[in] sTimeStampUTC - Creation timestamp in UTC. + * @return Returns the created default configuration version. + */ + PMachineConfigurationVersion CMachineConfigurationType::CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC) + { + LibMCDataHandle hVersionInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_CreateDefaultConfiguration(m_pHandle, sXSDUUID.c_str(), sDefaultXML.c_str(), sTimeStampUTC.c_str(), &hVersionInstance)); + + if (!hVersionInstance) { + CheckError(LIBMCDATA_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hVersionInstance); + } + + /** + * CMachineConfigurationType::ListAllConfigurationVersions - Lists all configuration versions registered under this type. + * @return List of configuration versions. + */ + PMachineConfigurationVersionIterator CMachineConfigurationType::ListAllConfigurationVersions() + { + LibMCDataHandle hVersionIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListAllConfigurationVersions(m_pHandle, &hVersionIterator)); + + if (!hVersionIterator) { + CheckError(LIBMCDATA_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hVersionIterator); + } + + /** + * CMachineConfigurationType::ListConfigurationVersionsForXSD - Lists all configuration versions for specific XSD. + * @param[in] sXSDUUID - UUID of the XSD . + * @return List of configuration versions. */ - PMachineConfigurationVersionIterator CMachineConfigurationType::ListVersions() + PMachineConfigurationVersionIterator CMachineConfigurationType::ListConfigurationVersionsForXSD(const std::string & sXSDUUID) { LibMCDataHandle hVersionIterator = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListVersions(m_pHandle, &hVersionIterator)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListConfigurationVersionsForXSD(m_pHandle, sXSDUUID.c_str(), &hVersionIterator)); if (!hVersionIterator) { CheckError(LIBMCDATA_ERROR_INVALIDPARAM); @@ -9712,14 +9906,14 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::FindVersionByUUID - Finds a Configuration version by UUID. + * CMachineConfigurationType::FindConfigurationVersionByUUID - Finds a specific configuration version by UUID. * @param[in] sVersionUUID - UUID of the configuration version. - * @return Returns the specific version or null if version does not exist or is of a different type. + * @return Matching configuration version if found. */ - PMachineConfigurationVersion CMachineConfigurationType::FindVersionByUUID(const std::string & sVersionUUID) + PMachineConfigurationVersion CMachineConfigurationType::FindConfigurationVersionByUUID(const std::string & sVersionUUID) { LibMCDataHandle hVersion = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindVersionByUUID(m_pHandle, sVersionUUID.c_str(), &hVersion)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindConfigurationVersionByUUID(m_pHandle, sVersionUUID.c_str(), &hVersion)); if (hVersion) { return std::make_shared(m_pWrapper, hVersion); @@ -9729,14 +9923,13 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetActiveVersion - Returns the active Configuration version. - * @param[in] sVersionUUID - UUID of the configuration version. - * @return Returns the specific version or null if no active version exists for this type. + * CMachineConfigurationType::GetActiveConfigurationVersion - Returns the currently active configuration version for this type. + * @return Active version instance or null. */ - PMachineConfigurationVersion CMachineConfigurationType::GetActiveVersion(const std::string & sVersionUUID) + PMachineConfigurationVersion CMachineConfigurationType::GetActiveConfigurationVersion() { LibMCDataHandle hVersion = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetActiveVersion(m_pHandle, sVersionUUID.c_str(), &hVersion)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetActiveConfigurationVersion(m_pHandle, &hVersion)); if (hVersion) { return std::make_shared(m_pWrapper, hVersion); @@ -9746,13 +9939,13 @@ class CDataModel : public CBase { } /** - * CMachineConfigurationType::GetLatestVersion - Returns the latest Configuration version by Timestamp. - * @return Returns the specific version or null if no version exists for this type. + * CMachineConfigurationType::GetLatestConfigurationVersion - Returns the most recently created version for this type. + * @return Latest configuration version or null. */ - PMachineConfigurationVersion CMachineConfigurationType::GetLatestVersion() + PMachineConfigurationVersion CMachineConfigurationType::GetLatestConfigurationVersion() { LibMCDataHandle hVersion = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestVersion(m_pHandle, &hVersion)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestConfigurationVersion(m_pHandle, &hVersion)); if (hVersion) { return std::make_shared(m_pWrapper, hVersion); @@ -9761,6 +9954,34 @@ class CDataModel : public CBase { } } + /** + * CMachineConfigurationType::SetActiveConfigurationVersion - Sets the active configuration version for this type. + * @param[in] sVersionUUID - UUID of the version to set as active. + */ + void CMachineConfigurationType::SetActiveConfigurationVersion(const std::string & sVersionUUID) + { + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_SetActiveConfigurationVersion(m_pHandle, sVersionUUID.c_str())); + } + + /** + * Method definitions for class CMachineConfigurationTypeIterator + */ + + /** + * CMachineConfigurationTypeIterator::GetCurrent - Returns the current MachineConfigurationType instance. + * @return Currently selected configuration type instance. + */ + PMachineConfigurationType CMachineConfigurationTypeIterator::GetCurrent() + { + LibMCDataHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationTypeIterator_GetCurrent(m_pHandle, &hInstance)); + + if (!hInstance) { + CheckError(LIBMCDATA_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hInstance); + } + /** * Method definitions for class CInstallationInformation */ @@ -10046,6 +10267,21 @@ class CDataModel : public CBase { return resultHasCallback; } + /** + * CDataModel::ListRegisteredConfigurationTypes - Lists all registered configuration types. + * @return List of configuration types. + */ + PMachineConfigurationTypeIterator CDataModel::ListRegisteredConfigurationTypes() + { + LibMCDataHandle hConfigurationTypeIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_DataModel_ListRegisteredConfigurationTypes(m_pHandle, &hConfigurationTypeIterator)); + + if (!hConfigurationTypeIterator) { + CheckError(LIBMCDATA_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hConfigurationTypeIterator); + } + /** * CDataModel::FindConfigurationTypeBySchema - Retrieves a configuration type by schema. * @param[in] sSchemaType - Configuration Schema Type String diff --git a/Framework/HeadersCore/CppDynamic/libmcdata_types.hpp b/Framework/HeadersCore/CppDynamic/libmcdata_types.hpp index 66b3142e..f0aa60c7 100644 --- a/Framework/HeadersCore/CppDynamic/libmcdata_types.hpp +++ b/Framework/HeadersCore/CppDynamic/libmcdata_types.hpp @@ -465,6 +465,12 @@ typedef void * LibMCData_pvoid; #define LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE 438 /** Could not find machine configuration type. */ #define LIBMCDATA_ERROR_INVALIDSTORAGESTREAMSIZE 439 /** Storage stream size for build is zero. */ #define LIBMCDATA_ERROR_COULDNOTUPDATEBUILDNAME 440 /** Could not update build name */ +#define LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID 441 /** Invalid machine configuration type UUID. */ +#define LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING 442 /** Machine configuration version is not incrementing. */ +#define LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION 443 /** Could not get latest machine configuration XSD version. */ +#define LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID 444 /** Could not find latest machine configuration XSD by UUID. */ +#define LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID 445 /** Could not find latest machine configuration version by UUID. */ +#define LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH 446 /** Machine configuration mismatch. */ /************************************************************************************************************************* Error strings for LibMCData @@ -842,6 +848,12 @@ inline const char * LIBMCDATA_GETERRORSTRING (LibMCDataResult nErrorCode) { case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE: return "Could not find machine configuration type."; case LIBMCDATA_ERROR_INVALIDSTORAGESTREAMSIZE: return "Storage stream size for build is zero."; case LIBMCDATA_ERROR_COULDNOTUPDATEBUILDNAME: return "Could not update build name"; + case LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID: return "Invalid machine configuration type UUID."; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING: return "Machine configuration version is not incrementing."; + case LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION: return "Could not get latest machine configuration XSD version."; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID: return "Could not find latest machine configuration XSD by UUID."; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID: return "Could not find latest machine configuration version by UUID."; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH: return "Machine configuration mismatch."; default: return "unknown error"; } } @@ -879,7 +891,9 @@ typedef LibMCDataHandle LibMCData_PersistencyHandler; typedef LibMCDataHandle LibMCData_MachineConfigurationVersion; typedef LibMCDataHandle LibMCData_MachineConfigurationVersionIterator; typedef LibMCDataHandle LibMCData_MachineConfigurationXSD; +typedef LibMCDataHandle LibMCData_MachineConfigurationXSDIterator; typedef LibMCDataHandle LibMCData_MachineConfigurationType; +typedef LibMCDataHandle LibMCData_MachineConfigurationTypeIterator; typedef LibMCDataHandle LibMCData_InstallationInformation; typedef LibMCDataHandle LibMCData_DataModel; diff --git a/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h b/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h index a1682bd0..80242d93 100644 --- a/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h +++ b/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h @@ -8655,222 +8655,430 @@ typedef LibMCEnvResult (*PLibMCEnvUserManagementHandler_SetUserPasswordByUUIDPtr typedef LibMCEnvResult (*PLibMCEnvUserManagementHandler_GetActiveUsersPtr) (LibMCEnv_UserManagementHandler pUserManagementHandler, LibMCEnv_UserDetailList * pListInstance); /************************************************************************************************************************* - Class definition for MachineConfigurationVersion + Class definition for MachineConfigurationXSD **************************************************************************************************************************/ /** -* Returns the schema type. +* Returns the UUID of the XSD. * -* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema Type String., may be NULL +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pXSDUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXSDUUIDBuffer - buffer of UUID of the configuration XSD., may be NULL +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationXSD_GetUUIDPtr) (LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nXSDUUIDBufferSize, LibMCEnv_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); + +/** +* Returns the UUID of the associated configuration type. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeUUIDBuffer - buffer of UUID of the configuration type., may be NULL +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationXSD_GetTypeUUIDPtr) (LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nTypeUUIDBufferSize, LibMCEnv_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); + +/** +* Returns the version number of the XSD. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[out] pXSDVersion - Returns the XSD version. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationXSD_GetXSDVersionPtr) (LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, LibMCEnv_uint32 * pXSDVersion); + +/** +* Returns the XSD content as string. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXSDStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXSDStringBuffer - buffer of XSD String., may be NULL +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationXSD_GetXSDStringPtr) (LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nXSDStringBufferSize, LibMCEnv_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); + +/** +* Returns the creation timestamp of the XSD version. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of XSD creation., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetSchemaTypePtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationXSD_GetTimestampPtr) (LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/************************************************************************************************************************* + Class definition for MachineConfigurationXSDIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationXSD instance. +* +* @param[in] pMachineConfigurationXSDIterator - MachineConfigurationXSDIterator instance. +* @param[out] pInstance - Currently selected configuration XSD instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationXSDIterator_GetCurrentPtr) (LibMCEnv_MachineConfigurationXSDIterator pMachineConfigurationXSDIterator, LibMCEnv_MachineConfigurationXSD * pInstance); + +/************************************************************************************************************************* + Class definition for MachineConfigurationVersion +**************************************************************************************************************************/ /** -* Returns the Name the type. +* Returns the UUID of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of Type Name., may be NULL +* @param[in] nVersionUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pVersionUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVersionUUIDBuffer - buffer of UUID of the configuration version., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetTypeNamePtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetVersionUUIDPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nVersionUUIDBufferSize, LibMCEnv_uint32* pVersionUUIDNeededChars, char * pVersionUUIDBuffer); /** -* Returns the UUID the type. +* Returns the UUID of the XSD used by this configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of Type UUID., may be NULL +* @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pXSDUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXSDUUIDBuffer - buffer of UUID of the configuration XSD., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetTypeUUIDPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nUUIDBufferSize, LibMCEnv_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetXSDUUIDPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXSDUUIDBufferSize, LibMCEnv_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); /** -* Returns the XSD Version Number of this configuration. +* Returns the numeric version of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[out] pXSDVersion - Returns XSD version number. +* @param[out] pConfigurationNumericVersion - Returns the configuration numeric version. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetXSDVersionPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_uint32 * pXSDVersion); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetNumericVersionPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_uint32 * pConfigurationNumericVersion); /** -* Returns the XSD String that this configuration uses. +* Returns the UUID of the parent version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) -* @param[out] pXSDStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXSDStringBuffer - buffer of Returns XSD string., may be NULL +* @param[in] nParentUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pParentUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pParentUUIDBuffer - buffer of UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetXSDStringPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXSDStringBufferSize, LibMCEnv_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetParentUUIDPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nParentUUIDBufferSize, LibMCEnv_uint32* pParentUUIDNeededChars, char * pParentUUIDBuffer); /** -* Returns the configuration as XML String. +* Returns the configuration XML content as string. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) * @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXMLStringBuffer - buffer of Returns XML string., may be NULL +* @param[out] pXMLStringBuffer - buffer of XML String., may be NULL * @return error code or 0 (success) */ typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetConfigurationXMLStringPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXMLStringBufferSize, LibMCEnv_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); /** -* Returns the configuration as XML Document class. +* Returns the User UUID. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[out] pDocumentInstance - Returns XML document. +* @param[in] nUserUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUserUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUserUUIDBuffer - buffer of UUID of the User., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetConfigurationXMLDocumentPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_XMLDocument * pDocumentInstance); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetUserUUIDPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nUserUUIDBufferSize, LibMCEnv_uint32* pUserUUIDNeededChars, char * pUserUUIDBuffer); /** -* Makes the current configuration the active one. +* Returns the creation timestamp of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of creation., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_MakeActivePtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_GetTimestampPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/** +* Creates a new configuration version from this one with the same XSD. +* +* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. +* @param[in] pXMLString - New XML Configuration String. MUST conform to current XSD. +* @param[in] pUserUUID - User UUID for logging the user who initiated the change. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_CreateNewVersionPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, LibMCEnv_MachineConfigurationVersion * pCurrentInstance); + +/** +* Creates a new configuration version from this one but with a different XSD. +* +* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. +* @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. +* @param[in] pXMLString - New XML Configuration String. MUST conform to new XSD. +* @param[in] pUserUUID - User UUID for logging the user who initiated the change. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersion_MigrateToNewXSDPtr) (LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, LibMCEnv_MachineConfigurationVersion * pCurrentInstance); + +/************************************************************************************************************************* + Class definition for MachineConfigurationVersionIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationVersion instance. +* +* @param[in] pMachineConfigurationVersionIterator - MachineConfigurationVersionIterator instance. +* @param[out] pInstance - Currently selected configuration version instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationVersionIterator_GetCurrentPtr) (LibMCEnv_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCEnv_MachineConfigurationVersion * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationType **************************************************************************************************************************/ /** -* Returns the schema type. +* Returns the UUID of the configuration type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeUUIDBuffer - buffer of UUID of the configuration type., may be NULL +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetUUIDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nTypeUUIDBufferSize, LibMCEnv_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); + +/** +* Returns the name of the configuration type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Name of the configuration type., may be NULL +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetNamePtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Returns the schema type string of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) * @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema Type String., may be NULL +* @param[out] pSchemaTypeBuffer - buffer of Schema type of the configuration type., may be NULL * @return error code or 0 (success) */ typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetSchemaTypePtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); /** -* Returns the Name the type. +* Returns the creation timestamp of the type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of Type Name., may be NULL +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of Type creation., may be NULL * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetTypeNamePtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetTimestampPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); /** -* Returns the UUID the type. +* Returns the latest XSD registered for this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of Type UUID., may be NULL +* @param[out] pXSDInstance - Latest XSD of the configuration type. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetTypeUUIDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nUUIDBufferSize, LibMCEnv_uint32* pUUIDNeededChars, char * pUUIDBuffer); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetLatestXSDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationXSD * pXSDInstance); /** -* Returns the latest Machine Configuration XSD Version. +* Returns all XSDs associated with this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pXSDVersion - Returns the latest XSD version, or 0 if no XSD exists. +* @param[out] pXSDIterator - List of XSDs. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetLatestXSDVersionPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 * pXSDVersion); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_ListXSDVersionsPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationXSDIterator * pXSDIterator); /** -* Registers a new configuration XSD. +* Returns the version number of the latest XSD for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDString - XSD String of the version. MUST be incremental. -* @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. -* @param[in] pDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. +* @param[out] pXSDNumericVersion - Latest XSD version number, or 0 if none exist. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCEnv_uint32 nXSDVersion, const char * pDefaultConfigurationXML); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetLatestXSDNumericVersionPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 * pXSDNumericVersion); /** -* Registers a new configuration XSD from machine resource files. +* Registers a new XSD Version. Fails if version already exists or is not incrementing. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDResourceName - Resource identifier of the XSD file of the version. MUST be incremental. +* @param[in] pXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. -* @param[in] pDefaultConfigurationResourceName - Resource identifier of the configuration XML to use for this XSD. MUST conform to XSD in question. +* @param[out] pXSDInstance - Returns the new XSD of the configuration type. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_RegisterNewXSDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCEnv_uint32 nXSDVersion, LibMCEnv_MachineConfigurationXSD * pXSDInstance); + +/** +* Finds a specific XSD of this type by its Numeric Version Number. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nXSDNumericVersion - Requested version number. +* @param[out] pXSDInstance - XSD instance if exists. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_FindXSDByNumericVersionPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 nXSDNumericVersion, LibMCEnv_MachineConfigurationXSD * pXSDInstance); + +/** +* Finds a specific XSD of this type by its UUID. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD. +* @param[out] pXSDInstance - Matching XSD instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_FindXSDByUUIDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCEnv_MachineConfigurationXSD * pXSDInstance); + +/** +* Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD to base the default configuration on. +* @param[in] pDefaultXML - Configuration XML string conforming to the given XSD. +* @param[in] pTimeStampUTC - Creation timestamp in UTC. +* @param[out] pVersionInstance - Returns the created default configuration version. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_CreateDefaultConfigurationPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, const char * pDefaultXML, const char * pTimeStampUTC, LibMCEnv_MachineConfigurationVersion * pVersionInstance); + +/** +* Lists all configuration versions registered under this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_ListAllConfigurationVersionsPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Lists all configuration versions for specific XSD. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD . +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_ListConfigurationVersionsForXSDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCEnv_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Finds a specific configuration version by UUID. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pVersionUUID - UUID of the configuration version. +* @param[out] pVersion - Matching configuration version if found. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDFromResourcePtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDResourceName, LibMCEnv_uint32 nXSDVersion, const char * pDefaultConfigurationResourceName); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_FindConfigurationVersionByUUIDPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCEnv_MachineConfigurationVersion * pVersion); /** -* Returns the latest Machine Configuration of this configuration type. Returns the default XML of the newest XSD if no configuration exists. +* Returns the currently active configuration version for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[out] pVersion - Active version instance or null. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetLatestConfigurationPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetActiveConfigurationVersionPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pVersion); /** -* Returns the active Machine Configuration of this configuration type. +* Returns the most recently created version for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[out] pVersion - Latest configuration version or null. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetActiveConfigurationPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, bool bFallBackToDefault, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_GetLatestConfigurationVersionPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pVersion); + +/** +* Sets the active configuration version for this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pVersionUUID - UUID of the version to set as active. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationType_SetActiveConfigurationVersionPtr) (LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID); + +/************************************************************************************************************************* + Class definition for MachineConfigurationTypeIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationType instance. +* +* @param[in] pMachineConfigurationTypeIterator - MachineConfigurationTypeIterator instance. +* @param[out] pInstance - Currently selected configuration type instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationTypeIterator_GetCurrentPtr) (LibMCEnv_MachineConfigurationTypeIterator pMachineConfigurationTypeIterator, LibMCEnv_MachineConfigurationType * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationHandler **************************************************************************************************************************/ /** -* Registers a new machine configuration type, or returns the unique existing one with the same schema type. +* Registers a new configuration type or returns existing one if already registered. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. MUST not be empty. -* @param[in] pName - Type Name. MUST not be empty. If the configuration type already exists, the name will be checked for identity! -* @param[out] pTypeInstance - Instance of machine configuration type. +* @param[in] pSchemaType - Schema type string. MUST not be empty. +* @param[in] pName - Display name. MUST not be empty. Must match existing name if type exists. +* @param[out] pTypeInstance - Instance of the configuration type. * @return error code or 0 (success) */ typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_RegisterMachineConfigurationTypePtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, const char * pName, LibMCEnv_MachineConfigurationType * pTypeInstance); /** -* Checks if a certain configuration schema type has been registered. +* Checks if a schema type is already registered. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. MUST not be empty. -* @param[out] pHasBeenRegistered - Returns true, if the system knows about a configuration schema type. +* @param[in] pSchemaType - Schema type string. +* @param[out] pHasBeenRegistered - True if known, false otherwise. * @return error code or 0 (success) */ typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_HasMachineConfigurationTypePtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, bool * pHasBeenRegistered); /** -* Returns the latest Machine Configuration for a specific configuration type. Returns the default XML of the newest XSD if no configuration exists. +* Returns all configuration types registered in the system. +* +* @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. +* @param[out] pTypeIterator - Iterator over configuration types. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_ListRegisteredTypesPtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, LibMCEnv_MachineConfigurationTypeIterator * pTypeIterator); + +/** +* Returns configuration type by UUID. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. Fails if configuration schema type is not known. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[in] pTypeUUID - UUID of the configuration type. +* @param[out] pTypeInstance - Configuration type if found. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_GetLatestConfigurationPtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeByUUIDPtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pTypeUUID, LibMCEnv_MachineConfigurationType * pTypeInstance); /** -* Returns the active Machine Configuration for a specific configuration type. +* Returns configuration type by Schema Type. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. Fails if configuration schema type is not known. -* @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[in] pSchemaType - Schema Type of the configuration type. +* @param[out] pTypeInstance - Configuration type if found. * @return error code or 0 (success) */ -typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_GetActiveConfigurationPtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, bool bFallBackToDefault, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +typedef LibMCEnvResult (*PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeBySchemaPtr) (LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, LibMCEnv_MachineConfigurationType * pTypeInstance); /************************************************************************************************************************* Class definition for StateEnvironment @@ -10640,6 +10848,15 @@ typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_GetExternalEventParametersPtr) ( */ typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_GetExternalEventResultsPtr) (LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_JSONObject * pParameterValue); +/** +* creates a machine configuration handler, dealing with all persistent machine settings that the user will store in the local database. +* +* @param[in] pUIEnvironment - UIEnvironment instance. +* @param[out] pMachineConfigurationHandlerInstance - MachineConfigurationHandler instance. +* @return error code or 0 (success) +*/ +typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_CreateMachineConfigurationHandlerPtr) (LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_MachineConfigurationHandler * pMachineConfigurationHandlerInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ @@ -11500,26 +11717,45 @@ typedef struct { PLibMCEnvUserManagementHandler_SetUserDescriptionByUUIDPtr m_UserManagementHandler_SetUserDescriptionByUUID; PLibMCEnvUserManagementHandler_SetUserPasswordByUUIDPtr m_UserManagementHandler_SetUserPasswordByUUID; PLibMCEnvUserManagementHandler_GetActiveUsersPtr m_UserManagementHandler_GetActiveUsers; - PLibMCEnvMachineConfigurationVersion_GetSchemaTypePtr m_MachineConfigurationVersion_GetSchemaType; - PLibMCEnvMachineConfigurationVersion_GetTypeNamePtr m_MachineConfigurationVersion_GetTypeName; - PLibMCEnvMachineConfigurationVersion_GetTypeUUIDPtr m_MachineConfigurationVersion_GetTypeUUID; - PLibMCEnvMachineConfigurationVersion_GetXSDVersionPtr m_MachineConfigurationVersion_GetXSDVersion; - PLibMCEnvMachineConfigurationVersion_GetXSDStringPtr m_MachineConfigurationVersion_GetXSDString; + PLibMCEnvMachineConfigurationXSD_GetUUIDPtr m_MachineConfigurationXSD_GetUUID; + PLibMCEnvMachineConfigurationXSD_GetTypeUUIDPtr m_MachineConfigurationXSD_GetTypeUUID; + PLibMCEnvMachineConfigurationXSD_GetXSDVersionPtr m_MachineConfigurationXSD_GetXSDVersion; + PLibMCEnvMachineConfigurationXSD_GetXSDStringPtr m_MachineConfigurationXSD_GetXSDString; + PLibMCEnvMachineConfigurationXSD_GetTimestampPtr m_MachineConfigurationXSD_GetTimestamp; + PLibMCEnvMachineConfigurationXSDIterator_GetCurrentPtr m_MachineConfigurationXSDIterator_GetCurrent; + PLibMCEnvMachineConfigurationVersion_GetVersionUUIDPtr m_MachineConfigurationVersion_GetVersionUUID; + PLibMCEnvMachineConfigurationVersion_GetXSDUUIDPtr m_MachineConfigurationVersion_GetXSDUUID; + PLibMCEnvMachineConfigurationVersion_GetNumericVersionPtr m_MachineConfigurationVersion_GetNumericVersion; + PLibMCEnvMachineConfigurationVersion_GetParentUUIDPtr m_MachineConfigurationVersion_GetParentUUID; PLibMCEnvMachineConfigurationVersion_GetConfigurationXMLStringPtr m_MachineConfigurationVersion_GetConfigurationXMLString; - PLibMCEnvMachineConfigurationVersion_GetConfigurationXMLDocumentPtr m_MachineConfigurationVersion_GetConfigurationXMLDocument; - PLibMCEnvMachineConfigurationVersion_MakeActivePtr m_MachineConfigurationVersion_MakeActive; + PLibMCEnvMachineConfigurationVersion_GetUserUUIDPtr m_MachineConfigurationVersion_GetUserUUID; + PLibMCEnvMachineConfigurationVersion_GetTimestampPtr m_MachineConfigurationVersion_GetTimestamp; + PLibMCEnvMachineConfigurationVersion_CreateNewVersionPtr m_MachineConfigurationVersion_CreateNewVersion; + PLibMCEnvMachineConfigurationVersion_MigrateToNewXSDPtr m_MachineConfigurationVersion_MigrateToNewXSD; + PLibMCEnvMachineConfigurationVersionIterator_GetCurrentPtr m_MachineConfigurationVersionIterator_GetCurrent; + PLibMCEnvMachineConfigurationType_GetUUIDPtr m_MachineConfigurationType_GetUUID; + PLibMCEnvMachineConfigurationType_GetNamePtr m_MachineConfigurationType_GetName; PLibMCEnvMachineConfigurationType_GetSchemaTypePtr m_MachineConfigurationType_GetSchemaType; - PLibMCEnvMachineConfigurationType_GetTypeNamePtr m_MachineConfigurationType_GetTypeName; - PLibMCEnvMachineConfigurationType_GetTypeUUIDPtr m_MachineConfigurationType_GetTypeUUID; - PLibMCEnvMachineConfigurationType_GetLatestXSDVersionPtr m_MachineConfigurationType_GetLatestXSDVersion; - PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDPtr m_MachineConfigurationType_RegisterConfigurationXSD; - PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDFromResourcePtr m_MachineConfigurationType_RegisterConfigurationXSDFromResource; - PLibMCEnvMachineConfigurationType_GetLatestConfigurationPtr m_MachineConfigurationType_GetLatestConfiguration; - PLibMCEnvMachineConfigurationType_GetActiveConfigurationPtr m_MachineConfigurationType_GetActiveConfiguration; + PLibMCEnvMachineConfigurationType_GetTimestampPtr m_MachineConfigurationType_GetTimestamp; + PLibMCEnvMachineConfigurationType_GetLatestXSDPtr m_MachineConfigurationType_GetLatestXSD; + PLibMCEnvMachineConfigurationType_ListXSDVersionsPtr m_MachineConfigurationType_ListXSDVersions; + PLibMCEnvMachineConfigurationType_GetLatestXSDNumericVersionPtr m_MachineConfigurationType_GetLatestXSDNumericVersion; + PLibMCEnvMachineConfigurationType_RegisterNewXSDPtr m_MachineConfigurationType_RegisterNewXSD; + PLibMCEnvMachineConfigurationType_FindXSDByNumericVersionPtr m_MachineConfigurationType_FindXSDByNumericVersion; + PLibMCEnvMachineConfigurationType_FindXSDByUUIDPtr m_MachineConfigurationType_FindXSDByUUID; + PLibMCEnvMachineConfigurationType_CreateDefaultConfigurationPtr m_MachineConfigurationType_CreateDefaultConfiguration; + PLibMCEnvMachineConfigurationType_ListAllConfigurationVersionsPtr m_MachineConfigurationType_ListAllConfigurationVersions; + PLibMCEnvMachineConfigurationType_ListConfigurationVersionsForXSDPtr m_MachineConfigurationType_ListConfigurationVersionsForXSD; + PLibMCEnvMachineConfigurationType_FindConfigurationVersionByUUIDPtr m_MachineConfigurationType_FindConfigurationVersionByUUID; + PLibMCEnvMachineConfigurationType_GetActiveConfigurationVersionPtr m_MachineConfigurationType_GetActiveConfigurationVersion; + PLibMCEnvMachineConfigurationType_GetLatestConfigurationVersionPtr m_MachineConfigurationType_GetLatestConfigurationVersion; + PLibMCEnvMachineConfigurationType_SetActiveConfigurationVersionPtr m_MachineConfigurationType_SetActiveConfigurationVersion; + PLibMCEnvMachineConfigurationTypeIterator_GetCurrentPtr m_MachineConfigurationTypeIterator_GetCurrent; PLibMCEnvMachineConfigurationHandler_RegisterMachineConfigurationTypePtr m_MachineConfigurationHandler_RegisterMachineConfigurationType; PLibMCEnvMachineConfigurationHandler_HasMachineConfigurationTypePtr m_MachineConfigurationHandler_HasMachineConfigurationType; - PLibMCEnvMachineConfigurationHandler_GetLatestConfigurationPtr m_MachineConfigurationHandler_GetLatestConfiguration; - PLibMCEnvMachineConfigurationHandler_GetActiveConfigurationPtr m_MachineConfigurationHandler_GetActiveConfiguration; + PLibMCEnvMachineConfigurationHandler_ListRegisteredTypesPtr m_MachineConfigurationHandler_ListRegisteredTypes; + PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeByUUIDPtr m_MachineConfigurationHandler_FindConfigurationTypeByUUID; + PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeBySchemaPtr m_MachineConfigurationHandler_FindConfigurationTypeBySchema; PLibMCEnvStateEnvironment_GetMachineStatePtr m_StateEnvironment_GetMachineState; PLibMCEnvStateEnvironment_GetPreviousStatePtr m_StateEnvironment_GetPreviousState; PLibMCEnvStateEnvironment_PrepareSignalPtr m_StateEnvironment_PrepareSignal; @@ -11687,6 +11923,7 @@ typedef struct { PLibMCEnvUIEnvironment_AddExternalEventResultValuePtr m_UIEnvironment_AddExternalEventResultValue; PLibMCEnvUIEnvironment_GetExternalEventParametersPtr m_UIEnvironment_GetExternalEventParameters; PLibMCEnvUIEnvironment_GetExternalEventResultsPtr m_UIEnvironment_GetExternalEventResults; + PLibMCEnvUIEnvironment_CreateMachineConfigurationHandlerPtr m_UIEnvironment_CreateMachineConfigurationHandler; PLibMCEnvGetVersionPtr m_GetVersion; PLibMCEnvGetLastErrorPtr m_GetLastError; PLibMCEnvReleaseInstancePtr m_ReleaseInstance; diff --git a/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.hpp b/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.hpp index 42dd0b8e..97aa3777 100644 --- a/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.hpp +++ b/Framework/HeadersDev/CppDynamic/libmcenv_dynamic.hpp @@ -130,8 +130,12 @@ class CLogEntryList; class CJournalHandler; class CUserDetailList; class CUserManagementHandler; +class CMachineConfigurationXSD; +class CMachineConfigurationXSDIterator; class CMachineConfigurationVersion; +class CMachineConfigurationVersionIterator; class CMachineConfigurationType; +class CMachineConfigurationTypeIterator; class CMachineConfigurationHandler; class CStateEnvironment; class CUIItem; @@ -212,8 +216,12 @@ typedef CLogEntryList CLibMCEnvLogEntryList; typedef CJournalHandler CLibMCEnvJournalHandler; typedef CUserDetailList CLibMCEnvUserDetailList; typedef CUserManagementHandler CLibMCEnvUserManagementHandler; +typedef CMachineConfigurationXSD CLibMCEnvMachineConfigurationXSD; +typedef CMachineConfigurationXSDIterator CLibMCEnvMachineConfigurationXSDIterator; typedef CMachineConfigurationVersion CLibMCEnvMachineConfigurationVersion; +typedef CMachineConfigurationVersionIterator CLibMCEnvMachineConfigurationVersionIterator; typedef CMachineConfigurationType CLibMCEnvMachineConfigurationType; +typedef CMachineConfigurationTypeIterator CLibMCEnvMachineConfigurationTypeIterator; typedef CMachineConfigurationHandler CLibMCEnvMachineConfigurationHandler; typedef CStateEnvironment CLibMCEnvStateEnvironment; typedef CUIItem CLibMCEnvUIItem; @@ -294,8 +302,12 @@ typedef std::shared_ptr PLogEntryList; typedef std::shared_ptr PJournalHandler; typedef std::shared_ptr PUserDetailList; typedef std::shared_ptr PUserManagementHandler; +typedef std::shared_ptr PMachineConfigurationXSD; +typedef std::shared_ptr PMachineConfigurationXSDIterator; typedef std::shared_ptr PMachineConfigurationVersion; +typedef std::shared_ptr PMachineConfigurationVersionIterator; typedef std::shared_ptr PMachineConfigurationType; +typedef std::shared_ptr PMachineConfigurationTypeIterator; typedef std::shared_ptr PMachineConfigurationHandler; typedef std::shared_ptr PStateEnvironment; typedef std::shared_ptr PUIItem; @@ -376,8 +388,12 @@ typedef PLogEntryList PLibMCEnvLogEntryList; typedef PJournalHandler PLibMCEnvJournalHandler; typedef PUserDetailList PLibMCEnvUserDetailList; typedef PUserManagementHandler PLibMCEnvUserManagementHandler; +typedef PMachineConfigurationXSD PLibMCEnvMachineConfigurationXSD; +typedef PMachineConfigurationXSDIterator PLibMCEnvMachineConfigurationXSDIterator; typedef PMachineConfigurationVersion PLibMCEnvMachineConfigurationVersion; +typedef PMachineConfigurationVersionIterator PLibMCEnvMachineConfigurationVersionIterator; typedef PMachineConfigurationType PLibMCEnvMachineConfigurationType; +typedef PMachineConfigurationTypeIterator PLibMCEnvMachineConfigurationTypeIterator; typedef PMachineConfigurationHandler PLibMCEnvMachineConfigurationHandler; typedef PStateEnvironment PLibMCEnvStateEnvironment; typedef PUIItem PLibMCEnvUIItem; @@ -711,6 +727,7 @@ class ELibMCEnvException : public std::exception { case LIBMCENV_ERROR_UNDEFINEDINTERNALSIGNALPHASE: return "UNDEFINEDINTERNALSIGNALPHASE"; case LIBMCENV_ERROR_INVALIDREACTIONTIMEOUT: return "INVALIDREACTIONTIMEOUT"; case LIBMCENV_ERROR_COULDNOTSETREACTIONTIMEOUT: return "COULDNOTSETREACTIONTIMEOUT"; + case LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED: return "MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED"; } return "UNKNOWN"; } @@ -969,6 +986,7 @@ class ELibMCEnvException : public std::exception { case LIBMCENV_ERROR_UNDEFINEDINTERNALSIGNALPHASE: return "Undefined internal signal phase."; case LIBMCENV_ERROR_INVALIDREACTIONTIMEOUT: return "Invalid reaction timeout."; case LIBMCENV_ERROR_COULDNOTSETREACTIONTIMEOUT: return "Could not set reaction timeout."; + case LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED: return "Schema type already registered, but with a different name."; } return "unknown error"; } @@ -1156,8 +1174,12 @@ class CWrapper { friend class CJournalHandler; friend class CUserDetailList; friend class CUserManagementHandler; + friend class CMachineConfigurationXSD; + friend class CMachineConfigurationXSDIterator; friend class CMachineConfigurationVersion; + friend class CMachineConfigurationVersionIterator; friend class CMachineConfigurationType; + friend class CMachineConfigurationTypeIterator; friend class CMachineConfigurationHandler; friend class CStateEnvironment; friend class CUIItem; @@ -3146,6 +3168,44 @@ class CUserManagementHandler : public CBase { inline PUserDetailList GetActiveUsers(); }; +/************************************************************************************************************************* + Class CMachineConfigurationXSD +**************************************************************************************************************************/ +class CMachineConfigurationXSD : public CBase { +public: + + /** + * CMachineConfigurationXSD::CMachineConfigurationXSD - Constructor for MachineConfigurationXSD class. + */ + CMachineConfigurationXSD(CWrapper* pWrapper, LibMCEnvHandle pHandle) + : CBase(pWrapper, pHandle) + { + } + + inline std::string GetUUID(); + inline std::string GetTypeUUID(); + inline LibMCEnv_uint32 GetXSDVersion(); + inline std::string GetXSDString(); + inline std::string GetTimestamp(); +}; + +/************************************************************************************************************************* + Class CMachineConfigurationXSDIterator +**************************************************************************************************************************/ +class CMachineConfigurationXSDIterator : public CIterator { +public: + + /** + * CMachineConfigurationXSDIterator::CMachineConfigurationXSDIterator - Constructor for MachineConfigurationXSDIterator class. + */ + CMachineConfigurationXSDIterator(CWrapper* pWrapper, LibMCEnvHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PMachineConfigurationXSD GetCurrent(); +}; + /************************************************************************************************************************* Class CMachineConfigurationVersion **************************************************************************************************************************/ @@ -3160,14 +3220,32 @@ class CMachineConfigurationVersion : public CBase { { } - inline std::string GetSchemaType(); - inline std::string GetTypeName(); - inline std::string GetTypeUUID(); - inline LibMCEnv_uint32 GetXSDVersion(); - inline std::string GetXSDString(); + inline std::string GetVersionUUID(); + inline std::string GetXSDUUID(); + inline LibMCEnv_uint32 GetNumericVersion(); + inline std::string GetParentUUID(); inline std::string GetConfigurationXMLString(); - inline PXMLDocument GetConfigurationXMLDocument(); - inline void MakeActive(); + inline std::string GetUserUUID(); + inline std::string GetTimestamp(); + inline PMachineConfigurationVersion CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID); + inline PMachineConfigurationVersion MigrateToNewXSD(classParam pNewXSD, const std::string & sXMLString, const std::string & sUserUUID); +}; + +/************************************************************************************************************************* + Class CMachineConfigurationVersionIterator +**************************************************************************************************************************/ +class CMachineConfigurationVersionIterator : public CIterator { +public: + + /** + * CMachineConfigurationVersionIterator::CMachineConfigurationVersionIterator - Constructor for MachineConfigurationVersionIterator class. + */ + CMachineConfigurationVersionIterator(CWrapper* pWrapper, LibMCEnvHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PMachineConfigurationVersion GetCurrent(); }; /************************************************************************************************************************* @@ -3184,14 +3262,40 @@ class CMachineConfigurationType : public CBase { { } + inline std::string GetUUID(); + inline std::string GetName(); inline std::string GetSchemaType(); - inline std::string GetTypeName(); - inline std::string GetTypeUUID(); - inline LibMCEnv_uint32 GetLatestXSDVersion(); - inline void RegisterConfigurationXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML); - inline void RegisterConfigurationXSDFromResource(const std::string & sXSDResourceName, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationResourceName); - inline PMachineConfigurationVersion GetLatestConfiguration(); - inline PMachineConfigurationVersion GetActiveConfiguration(const bool bFallBackToDefault); + inline std::string GetTimestamp(); + inline PMachineConfigurationXSD GetLatestXSD(); + inline PMachineConfigurationXSDIterator ListXSDVersions(); + inline LibMCEnv_uint32 GetLatestXSDNumericVersion(); + inline PMachineConfigurationXSD RegisterNewXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion); + inline PMachineConfigurationXSD FindXSDByNumericVersion(const LibMCEnv_uint32 nXSDNumericVersion); + inline PMachineConfigurationXSD FindXSDByUUID(const std::string & sXSDUUID); + inline PMachineConfigurationVersion CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC); + inline PMachineConfigurationVersionIterator ListAllConfigurationVersions(); + inline PMachineConfigurationVersionIterator ListConfigurationVersionsForXSD(const std::string & sXSDUUID); + inline PMachineConfigurationVersion FindConfigurationVersionByUUID(const std::string & sVersionUUID); + inline PMachineConfigurationVersion GetActiveConfigurationVersion(); + inline PMachineConfigurationVersion GetLatestConfigurationVersion(); + inline void SetActiveConfigurationVersion(const std::string & sVersionUUID); +}; + +/************************************************************************************************************************* + Class CMachineConfigurationTypeIterator +**************************************************************************************************************************/ +class CMachineConfigurationTypeIterator : public CIterator { +public: + + /** + * CMachineConfigurationTypeIterator::CMachineConfigurationTypeIterator - Constructor for MachineConfigurationTypeIterator class. + */ + CMachineConfigurationTypeIterator(CWrapper* pWrapper, LibMCEnvHandle pHandle) + : CIterator(pWrapper, pHandle) + { + } + + inline PMachineConfigurationType GetCurrent(); }; /************************************************************************************************************************* @@ -3210,8 +3314,9 @@ class CMachineConfigurationHandler : public CBase { inline PMachineConfigurationType RegisterMachineConfigurationType(const std::string & sSchemaType, const std::string & sName); inline bool HasMachineConfigurationType(const std::string & sSchemaType); - inline PMachineConfigurationVersion GetLatestConfiguration(const std::string & sSchemaType); - inline PMachineConfigurationVersion GetActiveConfiguration(const std::string & sSchemaType, const bool bFallBackToDefault); + inline PMachineConfigurationTypeIterator ListRegisteredTypes(); + inline PMachineConfigurationType FindConfigurationTypeByUUID(const std::string & sTypeUUID); + inline PMachineConfigurationType FindConfigurationTypeBySchema(const std::string & sSchemaType); }; /************************************************************************************************************************* @@ -3427,6 +3532,7 @@ class CUIEnvironment : public CBase { inline void AddExternalEventResultValue(const std::string & sReturnValueName, const std::string & sReturnValue); inline PJSONObject GetExternalEventParameters(); inline PJSONObject GetExternalEventResults(); + inline PMachineConfigurationHandler CreateMachineConfigurationHandler(); }; /** @@ -4314,26 +4420,45 @@ class CUIEnvironment : public CBase { pWrapperTable->m_UserManagementHandler_SetUserDescriptionByUUID = nullptr; pWrapperTable->m_UserManagementHandler_SetUserPasswordByUUID = nullptr; pWrapperTable->m_UserManagementHandler_GetActiveUsers = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetSchemaType = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetTypeName = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetXSDString = nullptr; + pWrapperTable->m_MachineConfigurationXSD_GetUUID = nullptr; + pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID = nullptr; + pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion = nullptr; + pWrapperTable->m_MachineConfigurationXSD_GetXSDString = nullptr; + pWrapperTable->m_MachineConfigurationXSD_GetTimestamp = nullptr; + pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetParentUUID = nullptr; pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString = nullptr; - pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLDocument = nullptr; - pWrapperTable->m_MachineConfigurationVersion_MakeActive = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetUserUUID = nullptr; + pWrapperTable->m_MachineConfigurationVersion_GetTimestamp = nullptr; + pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion = nullptr; + pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD = nullptr; + pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent = nullptr; + pWrapperTable->m_MachineConfigurationType_GetUUID = nullptr; + pWrapperTable->m_MachineConfigurationType_GetName = nullptr; pWrapperTable->m_MachineConfigurationType_GetSchemaType = nullptr; - pWrapperTable->m_MachineConfigurationType_GetTypeName = nullptr; - pWrapperTable->m_MachineConfigurationType_GetTypeUUID = nullptr; - pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion = nullptr; - pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSD = nullptr; - pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSDFromResource = nullptr; - pWrapperTable->m_MachineConfigurationType_GetLatestConfiguration = nullptr; - pWrapperTable->m_MachineConfigurationType_GetActiveConfiguration = nullptr; + pWrapperTable->m_MachineConfigurationType_GetTimestamp = nullptr; + pWrapperTable->m_MachineConfigurationType_GetLatestXSD = nullptr; + pWrapperTable->m_MachineConfigurationType_ListXSDVersions = nullptr; + pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_RegisterNewXSD = nullptr; + pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_FindXSDByUUID = nullptr; + pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration = nullptr; + pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions = nullptr; + pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD = nullptr; + pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID = nullptr; + pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion = nullptr; + pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion = nullptr; + pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent = nullptr; pWrapperTable->m_MachineConfigurationHandler_RegisterMachineConfigurationType = nullptr; pWrapperTable->m_MachineConfigurationHandler_HasMachineConfigurationType = nullptr; - pWrapperTable->m_MachineConfigurationHandler_GetLatestConfiguration = nullptr; - pWrapperTable->m_MachineConfigurationHandler_GetActiveConfiguration = nullptr; + pWrapperTable->m_MachineConfigurationHandler_ListRegisteredTypes = nullptr; + pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeByUUID = nullptr; + pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeBySchema = nullptr; pWrapperTable->m_StateEnvironment_GetMachineState = nullptr; pWrapperTable->m_StateEnvironment_GetPreviousState = nullptr; pWrapperTable->m_StateEnvironment_PrepareSignal = nullptr; @@ -4501,6 +4626,7 @@ class CUIEnvironment : public CBase { pWrapperTable->m_UIEnvironment_AddExternalEventResultValue = nullptr; pWrapperTable->m_UIEnvironment_GetExternalEventParameters = nullptr; pWrapperTable->m_UIEnvironment_GetExternalEventResults = nullptr; + pWrapperTable->m_UIEnvironment_CreateMachineConfigurationHandler = nullptr; pWrapperTable->m_GetVersion = nullptr; pWrapperTable->m_GetLastError = nullptr; pWrapperTable->m_ReleaseInstance = nullptr; @@ -11793,48 +11919,93 @@ class CUIEnvironment : public CBase { return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetSchemaType = (PLibMCEnvMachineConfigurationVersion_GetSchemaTypePtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getschematype"); + pWrapperTable->m_MachineConfigurationXSD_GetUUID = (PLibMCEnvMachineConfigurationXSD_GetUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationxsd_getuuid"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetUUID = (PLibMCEnvMachineConfigurationXSD_GetUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationxsd_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationXSD_GetUUID == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID = (PLibMCEnvMachineConfigurationXSD_GetTypeUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationxsd_gettypeuuid"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID = (PLibMCEnvMachineConfigurationXSD_GetTypeUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationxsd_gettypeuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion = (PLibMCEnvMachineConfigurationXSD_GetXSDVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationxsd_getxsdversion"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion = (PLibMCEnvMachineConfigurationXSD_GetXSDVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationxsd_getxsdversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetXSDString = (PLibMCEnvMachineConfigurationXSD_GetXSDStringPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationxsd_getxsdstring"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetXSDString = (PLibMCEnvMachineConfigurationXSD_GetXSDStringPtr) dlsym(hLibrary, "libmcenv_machineconfigurationxsd_getxsdstring"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationXSD_GetXSDString == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetTimestamp = (PLibMCEnvMachineConfigurationXSD_GetTimestampPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationxsd_gettimestamp"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationXSD_GetTimestamp = (PLibMCEnvMachineConfigurationXSD_GetTimestampPtr) dlsym(hLibrary, "libmcenv_machineconfigurationxsd_gettimestamp"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationXSD_GetTimestamp == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent = (PLibMCEnvMachineConfigurationXSDIterator_GetCurrentPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationxsditerator_getcurrent"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetSchemaType = (PLibMCEnvMachineConfigurationVersion_GetSchemaTypePtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getschematype"); + pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent = (PLibMCEnvMachineConfigurationXSDIterator_GetCurrentPtr) dlsym(hLibrary, "libmcenv_machineconfigurationxsditerator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetSchemaType == nullptr) + if (pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetTypeName = (PLibMCEnvMachineConfigurationVersion_GetTypeNamePtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_gettypename"); + pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID = (PLibMCEnvMachineConfigurationVersion_GetVersionUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getversionuuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetTypeName = (PLibMCEnvMachineConfigurationVersion_GetTypeNamePtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_gettypename"); + pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID = (PLibMCEnvMachineConfigurationVersion_GetVersionUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getversionuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetTypeName == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID = (PLibMCEnvMachineConfigurationVersion_GetTypeUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_gettypeuuid"); + pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID = (PLibMCEnvMachineConfigurationVersion_GetXSDUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getxsduuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID = (PLibMCEnvMachineConfigurationVersion_GetTypeUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_gettypeuuid"); + pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID = (PLibMCEnvMachineConfigurationVersion_GetXSDUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getxsduuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion = (PLibMCEnvMachineConfigurationVersion_GetXSDVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getxsdversion"); + pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion = (PLibMCEnvMachineConfigurationVersion_GetNumericVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getnumericversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion = (PLibMCEnvMachineConfigurationVersion_GetXSDVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getxsdversion"); + pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion = (PLibMCEnvMachineConfigurationVersion_GetNumericVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getnumericversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDString = (PLibMCEnvMachineConfigurationVersion_GetXSDStringPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getxsdstring"); + pWrapperTable->m_MachineConfigurationVersion_GetParentUUID = (PLibMCEnvMachineConfigurationVersion_GetParentUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getparentuuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetXSDString = (PLibMCEnvMachineConfigurationVersion_GetXSDStringPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getxsdstring"); + pWrapperTable->m_MachineConfigurationVersion_GetParentUUID = (PLibMCEnvMachineConfigurationVersion_GetParentUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getparentuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetXSDString == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_GetParentUUID == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -11847,21 +12018,66 @@ class CUIEnvironment : public CBase { return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLDocument = (PLibMCEnvMachineConfigurationVersion_GetConfigurationXMLDocumentPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getconfigurationxmldocument"); + pWrapperTable->m_MachineConfigurationVersion_GetUserUUID = (PLibMCEnvMachineConfigurationVersion_GetUserUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_getuseruuid"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationVersion_GetUserUUID = (PLibMCEnvMachineConfigurationVersion_GetUserUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getuseruuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationVersion_GetUserUUID == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationVersion_GetTimestamp = (PLibMCEnvMachineConfigurationVersion_GetTimestampPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_gettimestamp"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationVersion_GetTimestamp = (PLibMCEnvMachineConfigurationVersion_GetTimestampPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_gettimestamp"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationVersion_GetTimestamp == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion = (PLibMCEnvMachineConfigurationVersion_CreateNewVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_createnewversion"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion = (PLibMCEnvMachineConfigurationVersion_CreateNewVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_createnewversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD = (PLibMCEnvMachineConfigurationVersion_MigrateToNewXSDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_migratetonewxsd"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLDocument = (PLibMCEnvMachineConfigurationVersion_GetConfigurationXMLDocumentPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_getconfigurationxmldocument"); + pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD = (PLibMCEnvMachineConfigurationVersion_MigrateToNewXSDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_migratetonewxsd"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLDocument == nullptr) + if (pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationVersion_MakeActive = (PLibMCEnvMachineConfigurationVersion_MakeActivePtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversion_makeactive"); + pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent = (PLibMCEnvMachineConfigurationVersionIterator_GetCurrentPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationversioniterator_getcurrent"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationVersion_MakeActive = (PLibMCEnvMachineConfigurationVersion_MakeActivePtr) dlsym(hLibrary, "libmcenv_machineconfigurationversion_makeactive"); + pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent = (PLibMCEnvMachineConfigurationVersionIterator_GetCurrentPtr) dlsym(hLibrary, "libmcenv_machineconfigurationversioniterator_getcurrent"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationVersion_MakeActive == nullptr) + if (pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_GetUUID = (PLibMCEnvMachineConfigurationType_GetUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getuuid"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_GetUUID = (PLibMCEnvMachineConfigurationType_GetUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_GetUUID == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_GetName = (PLibMCEnvMachineConfigurationType_GetNamePtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getname"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_GetName = (PLibMCEnvMachineConfigurationType_GetNamePtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getname"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_GetName == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -11874,66 +12090,138 @@ class CUIEnvironment : public CBase { return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetTypeName = (PLibMCEnvMachineConfigurationType_GetTypeNamePtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_gettypename"); + pWrapperTable->m_MachineConfigurationType_GetTimestamp = (PLibMCEnvMachineConfigurationType_GetTimestampPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_gettimestamp"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_GetTimestamp = (PLibMCEnvMachineConfigurationType_GetTimestampPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_gettimestamp"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_GetTimestamp == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_GetLatestXSD = (PLibMCEnvMachineConfigurationType_GetLatestXSDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getlatestxsd"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_GetLatestXSD = (PLibMCEnvMachineConfigurationType_GetLatestXSDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getlatestxsd"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_GetLatestXSD == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_ListXSDVersions = (PLibMCEnvMachineConfigurationType_ListXSDVersionsPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_listxsdversions"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_ListXSDVersions = (PLibMCEnvMachineConfigurationType_ListXSDVersionsPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_listxsdversions"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_ListXSDVersions == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion = (PLibMCEnvMachineConfigurationType_GetLatestXSDNumericVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getlatestxsdnumericversion"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion = (PLibMCEnvMachineConfigurationType_GetLatestXSDNumericVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getlatestxsdnumericversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_RegisterNewXSD = (PLibMCEnvMachineConfigurationType_RegisterNewXSDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_registernewxsd"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_RegisterNewXSD = (PLibMCEnvMachineConfigurationType_RegisterNewXSDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_registernewxsd"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_RegisterNewXSD == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion = (PLibMCEnvMachineConfigurationType_FindXSDByNumericVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_findxsdbynumericversion"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion = (PLibMCEnvMachineConfigurationType_FindXSDByNumericVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_findxsdbynumericversion"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_FindXSDByUUID = (PLibMCEnvMachineConfigurationType_FindXSDByUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_findxsdbyuuid"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationType_FindXSDByUUID = (PLibMCEnvMachineConfigurationType_FindXSDByUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_findxsdbyuuid"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationType_FindXSDByUUID == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration = (PLibMCEnvMachineConfigurationType_CreateDefaultConfigurationPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_createdefaultconfiguration"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetTypeName = (PLibMCEnvMachineConfigurationType_GetTypeNamePtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_gettypename"); + pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration = (PLibMCEnvMachineConfigurationType_CreateDefaultConfigurationPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_createdefaultconfiguration"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetTypeName == nullptr) + if (pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetTypeUUID = (PLibMCEnvMachineConfigurationType_GetTypeUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_gettypeuuid"); + pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions = (PLibMCEnvMachineConfigurationType_ListAllConfigurationVersionsPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_listallconfigurationversions"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetTypeUUID = (PLibMCEnvMachineConfigurationType_GetTypeUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_gettypeuuid"); + pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions = (PLibMCEnvMachineConfigurationType_ListAllConfigurationVersionsPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_listallconfigurationversions"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetTypeUUID == nullptr) + if (pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion = (PLibMCEnvMachineConfigurationType_GetLatestXSDVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getlatestxsdversion"); + pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD = (PLibMCEnvMachineConfigurationType_ListConfigurationVersionsForXSDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_listconfigurationversionsforxsd"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion = (PLibMCEnvMachineConfigurationType_GetLatestXSDVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getlatestxsdversion"); + pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD = (PLibMCEnvMachineConfigurationType_ListConfigurationVersionsForXSDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_listconfigurationversionsforxsd"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion == nullptr) + if (pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSD = (PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_registerconfigurationxsd"); + pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID = (PLibMCEnvMachineConfigurationType_FindConfigurationVersionByUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_findconfigurationversionbyuuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSD = (PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_registerconfigurationxsd"); + pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID = (PLibMCEnvMachineConfigurationType_FindConfigurationVersionByUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_findconfigurationversionbyuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSD == nullptr) + if (pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSDFromResource = (PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDFromResourcePtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource"); + pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion = (PLibMCEnvMachineConfigurationType_GetActiveConfigurationVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getactiveconfigurationversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSDFromResource = (PLibMCEnvMachineConfigurationType_RegisterConfigurationXSDFromResourcePtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource"); + pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion = (PLibMCEnvMachineConfigurationType_GetActiveConfigurationVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getactiveconfigurationversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSDFromResource == nullptr) + if (pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestConfiguration = (PLibMCEnvMachineConfigurationType_GetLatestConfigurationPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getlatestconfiguration"); + pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion = (PLibMCEnvMachineConfigurationType_GetLatestConfigurationVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getlatestconfigurationversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetLatestConfiguration = (PLibMCEnvMachineConfigurationType_GetLatestConfigurationPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getlatestconfiguration"); + pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion = (PLibMCEnvMachineConfigurationType_GetLatestConfigurationVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getlatestconfigurationversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetLatestConfiguration == nullptr) + if (pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationType_GetActiveConfiguration = (PLibMCEnvMachineConfigurationType_GetActiveConfigurationPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_getactiveconfiguration"); + pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion = (PLibMCEnvMachineConfigurationType_SetActiveConfigurationVersionPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtype_setactiveconfigurationversion"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationType_GetActiveConfiguration = (PLibMCEnvMachineConfigurationType_GetActiveConfigurationPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_getactiveconfiguration"); + pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion = (PLibMCEnvMachineConfigurationType_SetActiveConfigurationVersionPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtype_setactiveconfigurationversion"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationType_GetActiveConfiguration == nullptr) + if (pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent = (PLibMCEnvMachineConfigurationTypeIterator_GetCurrentPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationtypeiterator_getcurrent"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent = (PLibMCEnvMachineConfigurationTypeIterator_GetCurrentPtr) dlsym(hLibrary, "libmcenv_machineconfigurationtypeiterator_getcurrent"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -11955,21 +12243,30 @@ class CUIEnvironment : public CBase { return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationHandler_GetLatestConfiguration = (PLibMCEnvMachineConfigurationHandler_GetLatestConfigurationPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationhandler_getlatestconfiguration"); + pWrapperTable->m_MachineConfigurationHandler_ListRegisteredTypes = (PLibMCEnvMachineConfigurationHandler_ListRegisteredTypesPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationhandler_listregisteredtypes"); + #else // _WIN32 + pWrapperTable->m_MachineConfigurationHandler_ListRegisteredTypes = (PLibMCEnvMachineConfigurationHandler_ListRegisteredTypesPtr) dlsym(hLibrary, "libmcenv_machineconfigurationhandler_listregisteredtypes"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_MachineConfigurationHandler_ListRegisteredTypes == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + #ifdef _WIN32 + pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeByUUID = (PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeByUUIDPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationHandler_GetLatestConfiguration = (PLibMCEnvMachineConfigurationHandler_GetLatestConfigurationPtr) dlsym(hLibrary, "libmcenv_machineconfigurationhandler_getlatestconfiguration"); + pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeByUUID = (PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeByUUIDPtr) dlsym(hLibrary, "libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationHandler_GetLatestConfiguration == nullptr) + if (pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeByUUID == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 - pWrapperTable->m_MachineConfigurationHandler_GetActiveConfiguration = (PLibMCEnvMachineConfigurationHandler_GetActiveConfigurationPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationhandler_getactiveconfiguration"); + pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeBySchema = (PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeBySchemaPtr) GetProcAddress(hLibrary, "libmcenv_machineconfigurationhandler_findconfigurationtypebyschema"); #else // _WIN32 - pWrapperTable->m_MachineConfigurationHandler_GetActiveConfiguration = (PLibMCEnvMachineConfigurationHandler_GetActiveConfigurationPtr) dlsym(hLibrary, "libmcenv_machineconfigurationhandler_getactiveconfiguration"); + pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeBySchema = (PLibMCEnvMachineConfigurationHandler_FindConfigurationTypeBySchemaPtr) dlsym(hLibrary, "libmcenv_machineconfigurationhandler_findconfigurationtypebyschema"); dlerror(); #endif // _WIN32 - if (pWrapperTable->m_MachineConfigurationHandler_GetActiveConfiguration == nullptr) + if (pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeBySchema == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; #ifdef _WIN32 @@ -13475,6 +13772,15 @@ class CUIEnvironment : public CBase { if (pWrapperTable->m_UIEnvironment_GetExternalEventResults == nullptr) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 + pWrapperTable->m_UIEnvironment_CreateMachineConfigurationHandler = (PLibMCEnvUIEnvironment_CreateMachineConfigurationHandlerPtr) GetProcAddress(hLibrary, "libmcenv_uienvironment_createmachineconfigurationhandler"); + #else // _WIN32 + pWrapperTable->m_UIEnvironment_CreateMachineConfigurationHandler = (PLibMCEnvUIEnvironment_CreateMachineConfigurationHandlerPtr) dlsym(hLibrary, "libmcenv_uienvironment_createmachineconfigurationhandler"); + dlerror(); + #endif // _WIN32 + if (pWrapperTable->m_UIEnvironment_CreateMachineConfigurationHandler == nullptr) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + #ifdef _WIN32 pWrapperTable->m_GetVersion = (PLibMCEnvGetVersionPtr) GetProcAddress(hLibrary, "libmcenv_getversion"); #else // _WIN32 @@ -16752,68 +17058,140 @@ class CUIEnvironment : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_UserManagementHandler_GetActiveUsers == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getschematype", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetSchemaType)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetSchemaType == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationxsd_getuuid", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetUUID == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationxsd_gettypeuuid", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetTypeUUID == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationxsd_getxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetXSDVersion == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationxsd_getxsdstring", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetXSDString)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetXSDString == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationxsd_gettimestamp", (void**)&(pWrapperTable->m_MachineConfigurationXSD_GetTimestamp)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSD_GetTimestamp == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_gettypename", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetTypeName)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetTypeName == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationxsditerator_getcurrent", (void**)&(pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationXSDIterator_GetCurrent == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_gettypeuuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetTypeUUID == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getversionuuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetVersionUUID == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetXSDVersion == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getxsduuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetXSDUUID == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getxsdstring", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetXSDString)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetXSDString == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getnumericversion", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetNumericVersion == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getparentuuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetParentUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetParentUUID == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getconfigurationxmlstring", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString)); if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLString == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getconfigurationxmldocument", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLDocument)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetConfigurationXMLDocument == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_getuseruuid", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetUserUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetUserUUID == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_gettimestamp", (void**)&(pWrapperTable->m_MachineConfigurationVersion_GetTimestamp)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_GetTimestamp == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_makeactive", (void**)&(pWrapperTable->m_MachineConfigurationVersion_MakeActive)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_MakeActive == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_createnewversion", (void**)&(pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_CreateNewVersion == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationversion_migratetonewxsd", (void**)&(pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersion_MigrateToNewXSD == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationversioniterator_getcurrent", (void**)&(pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationVersionIterator_GetCurrent == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_GetUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetUUID == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getname", (void**)&(pWrapperTable->m_MachineConfigurationType_GetName)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetName == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getschematype", (void**)&(pWrapperTable->m_MachineConfigurationType_GetSchemaType)); if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetSchemaType == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_gettypename", (void**)&(pWrapperTable->m_MachineConfigurationType_GetTypeName)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetTypeName == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_gettimestamp", (void**)&(pWrapperTable->m_MachineConfigurationType_GetTimestamp)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetTimestamp == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getlatestxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestXSD)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestXSD == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_gettypeuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_GetTypeUUID)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetTypeUUID == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_listxsdversions", (void**)&(pWrapperTable->m_MachineConfigurationType_ListXSDVersions)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListXSDVersions == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getlatestxsdversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestXSDVersion == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getlatestxsdnumericversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestXSDNumericVersion == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_registerconfigurationxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSD)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSD == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_registernewxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_RegisterNewXSD)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_RegisterNewXSD == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource", (void**)&(pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSDFromResource)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_RegisterConfigurationXSDFromResource == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_findxsdbynumericversion", (void**)&(pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindXSDByNumericVersion == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getlatestconfiguration", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestConfiguration)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestConfiguration == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_findxsdbyuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_FindXSDByUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindXSDByUUID == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getactiveconfiguration", (void**)&(pWrapperTable->m_MachineConfigurationType_GetActiveConfiguration)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetActiveConfiguration == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_createdefaultconfiguration", (void**)&(pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_CreateDefaultConfiguration == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_listallconfigurationversions", (void**)&(pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListAllConfigurationVersions == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_listconfigurationversionsforxsd", (void**)&(pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_ListConfigurationVersionsForXSD == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_findconfigurationversionbyuuid", (void**)&(pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_FindConfigurationVersionByUUID == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getactiveconfigurationversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetActiveConfigurationVersion == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_getlatestconfigurationversion", (void**)&(pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_GetLatestConfigurationVersion == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtype_setactiveconfigurationversion", (void**)&(pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationType_SetActiveConfigurationVersion == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationtypeiterator_getcurrent", (void**)&(pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationTypeIterator_GetCurrent == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcenv_machineconfigurationhandler_registermachineconfigurationtype", (void**)&(pWrapperTable->m_MachineConfigurationHandler_RegisterMachineConfigurationType)); @@ -16824,12 +17202,16 @@ class CUIEnvironment : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationHandler_HasMachineConfigurationType == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationhandler_getlatestconfiguration", (void**)&(pWrapperTable->m_MachineConfigurationHandler_GetLatestConfiguration)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationHandler_GetLatestConfiguration == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationhandler_listregisteredtypes", (void**)&(pWrapperTable->m_MachineConfigurationHandler_ListRegisteredTypes)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationHandler_ListRegisteredTypes == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; - eLookupError = (*pLookup)("libmcenv_machineconfigurationhandler_getactiveconfiguration", (void**)&(pWrapperTable->m_MachineConfigurationHandler_GetActiveConfiguration)); - if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationHandler_GetActiveConfiguration == nullptr) ) + eLookupError = (*pLookup)("libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid", (void**)&(pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeByUUID)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeByUUID == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + + eLookupError = (*pLookup)("libmcenv_machineconfigurationhandler_findconfigurationtypebyschema", (void**)&(pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeBySchema)); + if ( (eLookupError != 0) || (pWrapperTable->m_MachineConfigurationHandler_FindConfigurationTypeBySchema == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; eLookupError = (*pLookup)("libmcenv_stateenvironment_getmachinestate", (void**)&(pWrapperTable->m_StateEnvironment_GetMachineState)); @@ -17500,6 +17882,10 @@ class CUIEnvironment : public CBase { if ( (eLookupError != 0) || (pWrapperTable->m_UIEnvironment_GetExternalEventResults == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("libmcenv_uienvironment_createmachineconfigurationhandler", (void**)&(pWrapperTable->m_UIEnvironment_CreateMachineConfigurationHandler)); + if ( (eLookupError != 0) || (pWrapperTable->m_UIEnvironment_CreateMachineConfigurationHandler == nullptr) ) + return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; + eLookupError = (*pLookup)("libmcenv_getversion", (void**)&(pWrapperTable->m_GetVersion)); if ( (eLookupError != 0) || (pWrapperTable->m_GetVersion == nullptr) ) return LIBMCENV_ERROR_COULDNOTFINDLIBRARYEXPORT; @@ -28480,84 +28866,164 @@ class CUIEnvironment : public CBase { } /** - * Method definitions for class CMachineConfigurationVersion + * Method definitions for class CMachineConfigurationXSD */ /** - * CMachineConfigurationVersion::GetSchemaType - Returns the schema type. - * @return Schema Type String. + * CMachineConfigurationXSD::GetUUID - Returns the UUID of the XSD. + * @return UUID of the configuration XSD. */ - std::string CMachineConfigurationVersion::GetSchemaType() + std::string CMachineConfigurationXSD::GetUUID() { - LibMCEnv_uint32 bytesNeededSchemaType = 0; - LibMCEnv_uint32 bytesWrittenSchemaType = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetSchemaType(m_pHandle, 0, &bytesNeededSchemaType, nullptr)); - std::vector bufferSchemaType(bytesNeededSchemaType); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetSchemaType(m_pHandle, bytesNeededSchemaType, &bytesWrittenSchemaType, &bufferSchemaType[0])); - - return std::string(&bufferSchemaType[0]); - } - - /** - * CMachineConfigurationVersion::GetTypeName - Returns the Name the type. - * @return Type Name. - */ - std::string CMachineConfigurationVersion::GetTypeName() - { - LibMCEnv_uint32 bytesNeededName = 0; - LibMCEnv_uint32 bytesWrittenName = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTypeName(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTypeName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + LibMCEnv_uint32 bytesNeededXSDUUID = 0; + LibMCEnv_uint32 bytesWrittenXSDUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetUUID(m_pHandle, 0, &bytesNeededXSDUUID, nullptr)); + std::vector bufferXSDUUID(bytesNeededXSDUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetUUID(m_pHandle, bytesNeededXSDUUID, &bytesWrittenXSDUUID, &bufferXSDUUID[0])); - return std::string(&bufferName[0]); + return std::string(&bufferXSDUUID[0]); } /** - * CMachineConfigurationVersion::GetTypeUUID - Returns the UUID the type. - * @return Type UUID. + * CMachineConfigurationXSD::GetTypeUUID - Returns the UUID of the associated configuration type. + * @return UUID of the configuration type. */ - std::string CMachineConfigurationVersion::GetTypeUUID() + std::string CMachineConfigurationXSD::GetTypeUUID() { - LibMCEnv_uint32 bytesNeededUUID = 0; - LibMCEnv_uint32 bytesWrittenUUID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTypeUUID(m_pHandle, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTypeUUID(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + LibMCEnv_uint32 bytesNeededTypeUUID = 0; + LibMCEnv_uint32 bytesWrittenTypeUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetTypeUUID(m_pHandle, 0, &bytesNeededTypeUUID, nullptr)); + std::vector bufferTypeUUID(bytesNeededTypeUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetTypeUUID(m_pHandle, bytesNeededTypeUUID, &bytesWrittenTypeUUID, &bufferTypeUUID[0])); - return std::string(&bufferUUID[0]); + return std::string(&bufferTypeUUID[0]); } /** - * CMachineConfigurationVersion::GetXSDVersion - Returns the XSD Version Number of this configuration. - * @return Returns XSD version number. + * CMachineConfigurationXSD::GetXSDVersion - Returns the version number of the XSD. + * @return Returns the XSD version. */ - LibMCEnv_uint32 CMachineConfigurationVersion::GetXSDVersion() + LibMCEnv_uint32 CMachineConfigurationXSD::GetXSDVersion() { LibMCEnv_uint32 resultXSDVersion = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDVersion(m_pHandle, &resultXSDVersion)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetXSDVersion(m_pHandle, &resultXSDVersion)); return resultXSDVersion; } /** - * CMachineConfigurationVersion::GetXSDString - Returns the XSD String that this configuration uses. - * @return Returns XSD string. + * CMachineConfigurationXSD::GetXSDString - Returns the XSD content as string. + * @return XSD String. */ - std::string CMachineConfigurationVersion::GetXSDString() + std::string CMachineConfigurationXSD::GetXSDString() { LibMCEnv_uint32 bytesNeededXSDString = 0; LibMCEnv_uint32 bytesWrittenXSDString = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDString(m_pHandle, 0, &bytesNeededXSDString, nullptr)); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetXSDString(m_pHandle, 0, &bytesNeededXSDString, nullptr)); std::vector bufferXSDString(bytesNeededXSDString); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDString(m_pHandle, bytesNeededXSDString, &bytesWrittenXSDString, &bufferXSDString[0])); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetXSDString(m_pHandle, bytesNeededXSDString, &bytesWrittenXSDString, &bufferXSDString[0])); return std::string(&bufferXSDString[0]); } /** - * CMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration as XML String. - * @return Returns XML string. + * CMachineConfigurationXSD::GetTimestamp - Returns the creation timestamp of the XSD version. + * @return UTC timestamp of XSD creation. + */ + std::string CMachineConfigurationXSD::GetTimestamp() + { + LibMCEnv_uint32 bytesNeededTimeStampUTC = 0; + LibMCEnv_uint32 bytesWrittenTimeStampUTC = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetTimestamp(m_pHandle, 0, &bytesNeededTimeStampUTC, nullptr)); + std::vector bufferTimeStampUTC(bytesNeededTimeStampUTC); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSD_GetTimestamp(m_pHandle, bytesNeededTimeStampUTC, &bytesWrittenTimeStampUTC, &bufferTimeStampUTC[0])); + + return std::string(&bufferTimeStampUTC[0]); + } + + /** + * Method definitions for class CMachineConfigurationXSDIterator + */ + + /** + * CMachineConfigurationXSDIterator::GetCurrent - Returns the current MachineConfigurationXSD instance. + * @return Currently selected configuration XSD instance. + */ + PMachineConfigurationXSD CMachineConfigurationXSDIterator::GetCurrent() + { + LibMCEnvHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationXSDIterator_GetCurrent(m_pHandle, &hInstance)); + + if (!hInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hInstance); + } + + /** + * Method definitions for class CMachineConfigurationVersion + */ + + /** + * CMachineConfigurationVersion::GetVersionUUID - Returns the UUID of the configuration version. + * @return UUID of the configuration version. + */ + std::string CMachineConfigurationVersion::GetVersionUUID() + { + LibMCEnv_uint32 bytesNeededVersionUUID = 0; + LibMCEnv_uint32 bytesWrittenVersionUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetVersionUUID(m_pHandle, 0, &bytesNeededVersionUUID, nullptr)); + std::vector bufferVersionUUID(bytesNeededVersionUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetVersionUUID(m_pHandle, bytesNeededVersionUUID, &bytesWrittenVersionUUID, &bufferVersionUUID[0])); + + return std::string(&bufferVersionUUID[0]); + } + + /** + * CMachineConfigurationVersion::GetXSDUUID - Returns the UUID of the XSD used by this configuration version. + * @return UUID of the configuration XSD. + */ + std::string CMachineConfigurationVersion::GetXSDUUID() + { + LibMCEnv_uint32 bytesNeededXSDUUID = 0; + LibMCEnv_uint32 bytesWrittenXSDUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDUUID(m_pHandle, 0, &bytesNeededXSDUUID, nullptr)); + std::vector bufferXSDUUID(bytesNeededXSDUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetXSDUUID(m_pHandle, bytesNeededXSDUUID, &bytesWrittenXSDUUID, &bufferXSDUUID[0])); + + return std::string(&bufferXSDUUID[0]); + } + + /** + * CMachineConfigurationVersion::GetNumericVersion - Returns the numeric version of the configuration version. + * @return Returns the configuration numeric version. + */ + LibMCEnv_uint32 CMachineConfigurationVersion::GetNumericVersion() + { + LibMCEnv_uint32 resultConfigurationNumericVersion = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetNumericVersion(m_pHandle, &resultConfigurationNumericVersion)); + + return resultConfigurationNumericVersion; + } + + /** + * CMachineConfigurationVersion::GetParentUUID - Returns the UUID of the parent version. + * @return UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version. + */ + std::string CMachineConfigurationVersion::GetParentUUID() + { + LibMCEnv_uint32 bytesNeededParentUUID = 0; + LibMCEnv_uint32 bytesWrittenParentUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetParentUUID(m_pHandle, 0, &bytesNeededParentUUID, nullptr)); + std::vector bufferParentUUID(bytesNeededParentUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetParentUUID(m_pHandle, bytesNeededParentUUID, &bytesWrittenParentUUID, &bufferParentUUID[0])); + + return std::string(&bufferParentUUID[0]); + } + + /** + * CMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration XML content as string. + * @return XML String. */ std::string CMachineConfigurationVersion::GetConfigurationXMLString() { @@ -28571,26 +29037,88 @@ class CUIEnvironment : public CBase { } /** - * CMachineConfigurationVersion::GetConfigurationXMLDocument - Returns the configuration as XML Document class. - * @return Returns XML document. + * CMachineConfigurationVersion::GetUserUUID - Returns the User UUID. + * @return UUID of the User. + */ + std::string CMachineConfigurationVersion::GetUserUUID() + { + LibMCEnv_uint32 bytesNeededUserUUID = 0; + LibMCEnv_uint32 bytesWrittenUserUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetUserUUID(m_pHandle, 0, &bytesNeededUserUUID, nullptr)); + std::vector bufferUserUUID(bytesNeededUserUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetUserUUID(m_pHandle, bytesNeededUserUUID, &bytesWrittenUserUUID, &bufferUserUUID[0])); + + return std::string(&bufferUserUUID[0]); + } + + /** + * CMachineConfigurationVersion::GetTimestamp - Returns the creation timestamp of the configuration version. + * @return UTC timestamp of creation. + */ + std::string CMachineConfigurationVersion::GetTimestamp() + { + LibMCEnv_uint32 bytesNeededTimeStampUTC = 0; + LibMCEnv_uint32 bytesWrittenTimeStampUTC = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTimestamp(m_pHandle, 0, &bytesNeededTimeStampUTC, nullptr)); + std::vector bufferTimeStampUTC(bytesNeededTimeStampUTC); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetTimestamp(m_pHandle, bytesNeededTimeStampUTC, &bytesWrittenTimeStampUTC, &bufferTimeStampUTC[0])); + + return std::string(&bufferTimeStampUTC[0]); + } + + /** + * CMachineConfigurationVersion::CreateNewVersion - Creates a new configuration version from this one with the same XSD. + * @param[in] sXMLString - New XML Configuration String. MUST conform to current XSD. + * @param[in] sUserUUID - User UUID for logging the user who initiated the change. + * @return Returns the newly created MachineConfigurationVersion instance. */ - PXMLDocument CMachineConfigurationVersion::GetConfigurationXMLDocument() + PMachineConfigurationVersion CMachineConfigurationVersion::CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID) { - LibMCEnvHandle hDocumentInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_GetConfigurationXMLDocument(m_pHandle, &hDocumentInstance)); + LibMCEnvHandle hCurrentInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_CreateNewVersion(m_pHandle, sXMLString.c_str(), sUserUUID.c_str(), &hCurrentInstance)); - if (!hDocumentInstance) { + if (!hCurrentInstance) { CheckError(LIBMCENV_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hDocumentInstance); + return std::make_shared(m_pWrapper, hCurrentInstance); } /** - * CMachineConfigurationVersion::MakeActive - Makes the current configuration the active one. + * CMachineConfigurationVersion::MigrateToNewXSD - Creates a new configuration version from this one but with a different XSD. + * @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. + * @param[in] sXMLString - New XML Configuration String. MUST conform to new XSD. + * @param[in] sUserUUID - User UUID for logging the user who initiated the change. + * @return Returns the newly created MachineConfigurationVersion instance. */ - void CMachineConfigurationVersion::MakeActive() + PMachineConfigurationVersion CMachineConfigurationVersion::MigrateToNewXSD(classParam pNewXSD, const std::string & sXMLString, const std::string & sUserUUID) { - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_MakeActive(m_pHandle)); + LibMCEnvHandle hNewXSD = pNewXSD.GetHandle(); + LibMCEnvHandle hCurrentInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersion_MigrateToNewXSD(m_pHandle, hNewXSD, sXMLString.c_str(), sUserUUID.c_str(), &hCurrentInstance)); + + if (!hCurrentInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hCurrentInstance); + } + + /** + * Method definitions for class CMachineConfigurationVersionIterator + */ + + /** + * CMachineConfigurationVersionIterator::GetCurrent - Returns the current MachineConfigurationVersion instance. + * @return Currently selected configuration version instance. + */ + PMachineConfigurationVersion CMachineConfigurationVersionIterator::GetCurrent() + { + LibMCEnvHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationVersionIterator_GetCurrent(m_pHandle, &hInstance)); + + if (!hInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hInstance); } /** @@ -28598,8 +29126,38 @@ class CUIEnvironment : public CBase { */ /** - * CMachineConfigurationType::GetSchemaType - Returns the schema type. - * @return Schema Type String. + * CMachineConfigurationType::GetUUID - Returns the UUID of the configuration type. + * @return UUID of the configuration type. + */ + std::string CMachineConfigurationType::GetUUID() + { + LibMCEnv_uint32 bytesNeededTypeUUID = 0; + LibMCEnv_uint32 bytesWrittenTypeUUID = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetUUID(m_pHandle, 0, &bytesNeededTypeUUID, nullptr)); + std::vector bufferTypeUUID(bytesNeededTypeUUID); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetUUID(m_pHandle, bytesNeededTypeUUID, &bytesWrittenTypeUUID, &bufferTypeUUID[0])); + + return std::string(&bufferTypeUUID[0]); + } + + /** + * CMachineConfigurationType::GetName - Returns the name of the configuration type. + * @return Name of the configuration type. + */ + std::string CMachineConfigurationType::GetName() + { + LibMCEnv_uint32 bytesNeededName = 0; + LibMCEnv_uint32 bytesWrittenName = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetName(m_pHandle, 0, &bytesNeededName, nullptr)); + std::vector bufferName(bytesNeededName); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + + return std::string(&bufferName[0]); + } + + /** + * CMachineConfigurationType::GetSchemaType - Returns the schema type string of the configuration type. + * @return Schema type of the configuration type. */ std::string CMachineConfigurationType::GetSchemaType() { @@ -28613,110 +29171,246 @@ class CUIEnvironment : public CBase { } /** - * CMachineConfigurationType::GetTypeName - Returns the Name the type. - * @return Type Name. + * CMachineConfigurationType::GetTimestamp - Returns the creation timestamp of the type. + * @return UTC timestamp of Type creation. */ - std::string CMachineConfigurationType::GetTypeName() + std::string CMachineConfigurationType::GetTimestamp() { - LibMCEnv_uint32 bytesNeededName = 0; - LibMCEnv_uint32 bytesWrittenName = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTypeName(m_pHandle, 0, &bytesNeededName, nullptr)); - std::vector bufferName(bytesNeededName); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTypeName(m_pHandle, bytesNeededName, &bytesWrittenName, &bufferName[0])); + LibMCEnv_uint32 bytesNeededTimeStampUTC = 0; + LibMCEnv_uint32 bytesWrittenTimeStampUTC = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTimestamp(m_pHandle, 0, &bytesNeededTimeStampUTC, nullptr)); + std::vector bufferTimeStampUTC(bytesNeededTimeStampUTC); + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTimestamp(m_pHandle, bytesNeededTimeStampUTC, &bytesWrittenTimeStampUTC, &bufferTimeStampUTC[0])); - return std::string(&bufferName[0]); + return std::string(&bufferTimeStampUTC[0]); } /** - * CMachineConfigurationType::GetTypeUUID - Returns the UUID the type. - * @return Type UUID. + * CMachineConfigurationType::GetLatestXSD - Returns the latest XSD registered for this configuration type. + * @return Latest XSD of the configuration type. */ - std::string CMachineConfigurationType::GetTypeUUID() + PMachineConfigurationXSD CMachineConfigurationType::GetLatestXSD() { - LibMCEnv_uint32 bytesNeededUUID = 0; - LibMCEnv_uint32 bytesWrittenUUID = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTypeUUID(m_pHandle, 0, &bytesNeededUUID, nullptr)); - std::vector bufferUUID(bytesNeededUUID); - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetTypeUUID(m_pHandle, bytesNeededUUID, &bytesWrittenUUID, &bufferUUID[0])); + LibMCEnvHandle hXSDInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestXSD(m_pHandle, &hXSDInstance)); - return std::string(&bufferUUID[0]); + if (!hXSDInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hXSDInstance); } /** - * CMachineConfigurationType::GetLatestXSDVersion - Returns the latest Machine Configuration XSD Version. - * @return Returns the latest XSD version, or 0 if no XSD exists. + * CMachineConfigurationType::ListXSDVersions - Returns all XSDs associated with this configuration type. + * @return List of XSDs. */ - LibMCEnv_uint32 CMachineConfigurationType::GetLatestXSDVersion() + PMachineConfigurationXSDIterator CMachineConfigurationType::ListXSDVersions() { - LibMCEnv_uint32 resultXSDVersion = 0; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestXSDVersion(m_pHandle, &resultXSDVersion)); + LibMCEnvHandle hXSDIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListXSDVersions(m_pHandle, &hXSDIterator)); - return resultXSDVersion; + if (!hXSDIterator) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hXSDIterator); } /** - * CMachineConfigurationType::RegisterConfigurationXSD - Registers a new configuration XSD. - * @param[in] sXSDString - XSD String of the version. MUST be incremental. - * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. - * @param[in] sDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. + * CMachineConfigurationType::GetLatestXSDNumericVersion - Returns the version number of the latest XSD for this type. + * @return Latest XSD version number, or 0 if none exist. */ - void CMachineConfigurationType::RegisterConfigurationXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) + LibMCEnv_uint32 CMachineConfigurationType::GetLatestXSDNumericVersion() { - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_RegisterConfigurationXSD(m_pHandle, sXSDString.c_str(), nXSDVersion, sDefaultConfigurationXML.c_str())); + LibMCEnv_uint32 resultXSDNumericVersion = 0; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestXSDNumericVersion(m_pHandle, &resultXSDNumericVersion)); + + return resultXSDNumericVersion; } /** - * CMachineConfigurationType::RegisterConfigurationXSDFromResource - Registers a new configuration XSD from machine resource files. - * @param[in] sXSDResourceName - Resource identifier of the XSD file of the version. MUST be incremental. + * CMachineConfigurationType::RegisterNewXSD - Registers a new XSD Version. Fails if version already exists or is not incrementing. + * @param[in] sXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. - * @param[in] sDefaultConfigurationResourceName - Resource identifier of the configuration XML to use for this XSD. MUST conform to XSD in question. + * @return Returns the new XSD of the configuration type. + */ + PMachineConfigurationXSD CMachineConfigurationType::RegisterNewXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion) + { + LibMCEnvHandle hXSDInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_RegisterNewXSD(m_pHandle, sXSDString.c_str(), nXSDVersion, &hXSDInstance)); + + if (!hXSDInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hXSDInstance); + } + + /** + * CMachineConfigurationType::FindXSDByNumericVersion - Finds a specific XSD of this type by its Numeric Version Number. + * @param[in] nXSDNumericVersion - Requested version number. + * @return XSD instance if exists. + */ + PMachineConfigurationXSD CMachineConfigurationType::FindXSDByNumericVersion(const LibMCEnv_uint32 nXSDNumericVersion) + { + LibMCEnvHandle hXSDInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindXSDByNumericVersion(m_pHandle, nXSDNumericVersion, &hXSDInstance)); + + if (!hXSDInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hXSDInstance); + } + + /** + * CMachineConfigurationType::FindXSDByUUID - Finds a specific XSD of this type by its UUID. + * @param[in] sXSDUUID - UUID of the XSD. + * @return Matching XSD instance. + */ + PMachineConfigurationXSD CMachineConfigurationType::FindXSDByUUID(const std::string & sXSDUUID) + { + LibMCEnvHandle hXSDInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindXSDByUUID(m_pHandle, sXSDUUID.c_str(), &hXSDInstance)); + + if (!hXSDInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hXSDInstance); + } + + /** + * CMachineConfigurationType::CreateDefaultConfiguration - Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. + * @param[in] sXSDUUID - UUID of the XSD to base the default configuration on. + * @param[in] sDefaultXML - Configuration XML string conforming to the given XSD. + * @param[in] sTimeStampUTC - Creation timestamp in UTC. + * @return Returns the created default configuration version. + */ + PMachineConfigurationVersion CMachineConfigurationType::CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC) + { + LibMCEnvHandle hVersionInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_CreateDefaultConfiguration(m_pHandle, sXSDUUID.c_str(), sDefaultXML.c_str(), sTimeStampUTC.c_str(), &hVersionInstance)); + + if (!hVersionInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hVersionInstance); + } + + /** + * CMachineConfigurationType::ListAllConfigurationVersions - Lists all configuration versions registered under this type. + * @return List of configuration versions. */ - void CMachineConfigurationType::RegisterConfigurationXSDFromResource(const std::string & sXSDResourceName, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationResourceName) + PMachineConfigurationVersionIterator CMachineConfigurationType::ListAllConfigurationVersions() { - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_RegisterConfigurationXSDFromResource(m_pHandle, sXSDResourceName.c_str(), nXSDVersion, sDefaultConfigurationResourceName.c_str())); + LibMCEnvHandle hVersionIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListAllConfigurationVersions(m_pHandle, &hVersionIterator)); + + if (!hVersionIterator) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hVersionIterator); } /** - * CMachineConfigurationType::GetLatestConfiguration - Returns the latest Machine Configuration of this configuration type. Returns the default XML of the newest XSD if no configuration exists. - * @return Configuration Version instance. + * CMachineConfigurationType::ListConfigurationVersionsForXSD - Lists all configuration versions for specific XSD. + * @param[in] sXSDUUID - UUID of the XSD . + * @return List of configuration versions. */ - PMachineConfigurationVersion CMachineConfigurationType::GetLatestConfiguration() + PMachineConfigurationVersionIterator CMachineConfigurationType::ListConfigurationVersionsForXSD(const std::string & sXSDUUID) { - LibMCEnvHandle hConfigurationInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestConfiguration(m_pHandle, &hConfigurationInstance)); + LibMCEnvHandle hVersionIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_ListConfigurationVersionsForXSD(m_pHandle, sXSDUUID.c_str(), &hVersionIterator)); - if (!hConfigurationInstance) { + if (!hVersionIterator) { CheckError(LIBMCENV_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hConfigurationInstance); + return std::make_shared(m_pWrapper, hVersionIterator); } /** - * CMachineConfigurationType::GetActiveConfiguration - Returns the active Machine Configuration of this configuration type. - * @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. - * @return Configuration Version instance. + * CMachineConfigurationType::FindConfigurationVersionByUUID - Finds a specific configuration version by UUID. + * @param[in] sVersionUUID - UUID of the configuration version. + * @return Matching configuration version if found. */ - PMachineConfigurationVersion CMachineConfigurationType::GetActiveConfiguration(const bool bFallBackToDefault) + PMachineConfigurationVersion CMachineConfigurationType::FindConfigurationVersionByUUID(const std::string & sVersionUUID) { - LibMCEnvHandle hConfigurationInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetActiveConfiguration(m_pHandle, bFallBackToDefault, &hConfigurationInstance)); + LibMCEnvHandle hVersion = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_FindConfigurationVersionByUUID(m_pHandle, sVersionUUID.c_str(), &hVersion)); - if (hConfigurationInstance) { - return std::make_shared(m_pWrapper, hConfigurationInstance); + if (hVersion) { + return std::make_shared(m_pWrapper, hVersion); } else { return nullptr; } } + /** + * CMachineConfigurationType::GetActiveConfigurationVersion - Returns the currently active configuration version for this type. + * @return Active version instance or null. + */ + PMachineConfigurationVersion CMachineConfigurationType::GetActiveConfigurationVersion() + { + LibMCEnvHandle hVersion = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetActiveConfigurationVersion(m_pHandle, &hVersion)); + + if (hVersion) { + return std::make_shared(m_pWrapper, hVersion); + } else { + return nullptr; + } + } + + /** + * CMachineConfigurationType::GetLatestConfigurationVersion - Returns the most recently created version for this type. + * @return Latest configuration version or null. + */ + PMachineConfigurationVersion CMachineConfigurationType::GetLatestConfigurationVersion() + { + LibMCEnvHandle hVersion = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_GetLatestConfigurationVersion(m_pHandle, &hVersion)); + + if (hVersion) { + return std::make_shared(m_pWrapper, hVersion); + } else { + return nullptr; + } + } + + /** + * CMachineConfigurationType::SetActiveConfigurationVersion - Sets the active configuration version for this type. + * @param[in] sVersionUUID - UUID of the version to set as active. + */ + void CMachineConfigurationType::SetActiveConfigurationVersion(const std::string & sVersionUUID) + { + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationType_SetActiveConfigurationVersion(m_pHandle, sVersionUUID.c_str())); + } + + /** + * Method definitions for class CMachineConfigurationTypeIterator + */ + + /** + * CMachineConfigurationTypeIterator::GetCurrent - Returns the current MachineConfigurationType instance. + * @return Currently selected configuration type instance. + */ + PMachineConfigurationType CMachineConfigurationTypeIterator::GetCurrent() + { + LibMCEnvHandle hInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationTypeIterator_GetCurrent(m_pHandle, &hInstance)); + + if (!hInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hInstance); + } + /** * Method definitions for class CMachineConfigurationHandler */ /** - * CMachineConfigurationHandler::RegisterMachineConfigurationType - Registers a new machine configuration type, or returns the unique existing one with the same schema type. - * @param[in] sSchemaType - Schema Type String. MUST not be empty. - * @param[in] sName - Type Name. MUST not be empty. If the configuration type already exists, the name will be checked for identity! - * @return Instance of machine configuration type. + * CMachineConfigurationHandler::RegisterMachineConfigurationType - Registers a new configuration type or returns existing one if already registered. + * @param[in] sSchemaType - Schema type string. MUST not be empty. + * @param[in] sName - Display name. MUST not be empty. Must match existing name if type exists. + * @return Instance of the configuration type. */ PMachineConfigurationType CMachineConfigurationHandler::RegisterMachineConfigurationType(const std::string & sSchemaType, const std::string & sName) { @@ -28730,9 +29424,9 @@ class CUIEnvironment : public CBase { } /** - * CMachineConfigurationHandler::HasMachineConfigurationType - Checks if a certain configuration schema type has been registered. - * @param[in] sSchemaType - Schema Type String. MUST not be empty. - * @return Returns true, if the system knows about a configuration schema type. + * CMachineConfigurationHandler::HasMachineConfigurationType - Checks if a schema type is already registered. + * @param[in] sSchemaType - Schema type string. + * @return True if known, false otherwise. */ bool CMachineConfigurationHandler::HasMachineConfigurationType(const std::string & sSchemaType) { @@ -28743,34 +29437,49 @@ class CUIEnvironment : public CBase { } /** - * CMachineConfigurationHandler::GetLatestConfiguration - Returns the latest Machine Configuration for a specific configuration type. Returns the default XML of the newest XSD if no configuration exists. - * @param[in] sSchemaType - Schema Type String. Fails if configuration schema type is not known. - * @return Configuration Version instance. + * CMachineConfigurationHandler::ListRegisteredTypes - Returns all configuration types registered in the system. + * @return Iterator over configuration types. */ - PMachineConfigurationVersion CMachineConfigurationHandler::GetLatestConfiguration(const std::string & sSchemaType) + PMachineConfigurationTypeIterator CMachineConfigurationHandler::ListRegisteredTypes() { - LibMCEnvHandle hConfigurationInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationHandler_GetLatestConfiguration(m_pHandle, sSchemaType.c_str(), &hConfigurationInstance)); + LibMCEnvHandle hTypeIterator = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationHandler_ListRegisteredTypes(m_pHandle, &hTypeIterator)); - if (!hConfigurationInstance) { + if (!hTypeIterator) { CheckError(LIBMCENV_ERROR_INVALIDPARAM); } - return std::make_shared(m_pWrapper, hConfigurationInstance); + return std::make_shared(m_pWrapper, hTypeIterator); } /** - * CMachineConfigurationHandler::GetActiveConfiguration - Returns the active Machine Configuration for a specific configuration type. - * @param[in] sSchemaType - Schema Type String. Fails if configuration schema type is not known. - * @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. - * @return Configuration Version instance. + * CMachineConfigurationHandler::FindConfigurationTypeByUUID - Returns configuration type by UUID. + * @param[in] sTypeUUID - UUID of the configuration type. + * @return Configuration type if found. */ - PMachineConfigurationVersion CMachineConfigurationHandler::GetActiveConfiguration(const std::string & sSchemaType, const bool bFallBackToDefault) + PMachineConfigurationType CMachineConfigurationHandler::FindConfigurationTypeByUUID(const std::string & sTypeUUID) { - LibMCEnvHandle hConfigurationInstance = nullptr; - CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationHandler_GetActiveConfiguration(m_pHandle, sSchemaType.c_str(), bFallBackToDefault, &hConfigurationInstance)); + LibMCEnvHandle hTypeInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationHandler_FindConfigurationTypeByUUID(m_pHandle, sTypeUUID.c_str(), &hTypeInstance)); - if (hConfigurationInstance) { - return std::make_shared(m_pWrapper, hConfigurationInstance); + if (hTypeInstance) { + return std::make_shared(m_pWrapper, hTypeInstance); + } else { + return nullptr; + } + } + + /** + * CMachineConfigurationHandler::FindConfigurationTypeBySchema - Returns configuration type by Schema Type. + * @param[in] sSchemaType - Schema Type of the configuration type. + * @return Configuration type if found. + */ + PMachineConfigurationType CMachineConfigurationHandler::FindConfigurationTypeBySchema(const std::string & sSchemaType) + { + LibMCEnvHandle hTypeInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_MachineConfigurationHandler_FindConfigurationTypeBySchema(m_pHandle, sSchemaType.c_str(), &hTypeInstance)); + + if (hTypeInstance) { + return std::make_shared(m_pWrapper, hTypeInstance); } else { return nullptr; } @@ -31171,6 +31880,21 @@ class CUIEnvironment : public CBase { } return std::make_shared(m_pWrapper, hParameterValue); } + + /** + * CUIEnvironment::CreateMachineConfigurationHandler - creates a machine configuration handler, dealing with all persistent machine settings that the user will store in the local database. + * @return MachineConfigurationHandler instance. + */ + PMachineConfigurationHandler CUIEnvironment::CreateMachineConfigurationHandler() + { + LibMCEnvHandle hMachineConfigurationHandlerInstance = nullptr; + CheckError(m_pWrapper->m_WrapperTable.m_UIEnvironment_CreateMachineConfigurationHandler(m_pHandle, &hMachineConfigurationHandlerInstance)); + + if (!hMachineConfigurationHandlerInstance) { + CheckError(LIBMCENV_ERROR_INVALIDPARAM); + } + return std::make_shared(m_pWrapper, hMachineConfigurationHandlerInstance); + } } // namespace LibMCEnv diff --git a/Framework/HeadersDev/CppDynamic/libmcenv_types.hpp b/Framework/HeadersDev/CppDynamic/libmcenv_types.hpp index 74169629..54d8562e 100644 --- a/Framework/HeadersDev/CppDynamic/libmcenv_types.hpp +++ b/Framework/HeadersDev/CppDynamic/libmcenv_types.hpp @@ -346,6 +346,7 @@ typedef void * LibMCEnv_pvoid; #define LIBMCENV_ERROR_UNDEFINEDINTERNALSIGNALPHASE 10249 /** Undefined internal signal phase. */ #define LIBMCENV_ERROR_INVALIDREACTIONTIMEOUT 10250 /** Invalid reaction timeout. */ #define LIBMCENV_ERROR_COULDNOTSETREACTIONTIMEOUT 10251 /** Could not set reaction timeout. */ +#define LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED 10252 /** Schema type already registered, but with a different name. */ /************************************************************************************************************************* Error strings for LibMCEnv @@ -604,6 +605,7 @@ inline const char * LIBMCENV_GETERRORSTRING (LibMCEnvResult nErrorCode) { case LIBMCENV_ERROR_UNDEFINEDINTERNALSIGNALPHASE: return "Undefined internal signal phase."; case LIBMCENV_ERROR_INVALIDREACTIONTIMEOUT: return "Invalid reaction timeout."; case LIBMCENV_ERROR_COULDNOTSETREACTIONTIMEOUT: return "Could not set reaction timeout."; + case LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED: return "Schema type already registered, but with a different name."; default: return "unknown error"; } } @@ -683,8 +685,12 @@ typedef LibMCEnvHandle LibMCEnv_LogEntryList; typedef LibMCEnvHandle LibMCEnv_JournalHandler; typedef LibMCEnvHandle LibMCEnv_UserDetailList; typedef LibMCEnvHandle LibMCEnv_UserManagementHandler; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationXSD; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationXSDIterator; typedef LibMCEnvHandle LibMCEnv_MachineConfigurationVersion; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationVersionIterator; typedef LibMCEnvHandle LibMCEnv_MachineConfigurationType; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationTypeIterator; typedef LibMCEnvHandle LibMCEnv_MachineConfigurationHandler; typedef LibMCEnvHandle LibMCEnv_StateEnvironment; typedef LibMCEnvHandle LibMCEnv_UIItem; diff --git a/Framework/InterfacesCore/libmcdata_abi.hpp b/Framework/InterfacesCore/libmcdata_abi.hpp index 68ee0504..d1c36752 100644 --- a/Framework/InterfacesCore/libmcdata_abi.hpp +++ b/Framework/InterfacesCore/libmcdata_abi.hpp @@ -2559,7 +2559,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_persistencyhandler_retrievepersiste **************************************************************************************************************************/ /** -* Returns the UUID. +* Returns the UUID of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nVersionUUIDBufferSize - size of the buffer (including trailing 0) @@ -2570,7 +2570,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_persistencyhandler_retrievepersiste LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getversionuuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nVersionUUIDBufferSize, LibMCData_uint32* pVersionUUIDNeededChars, char * pVersionUUIDBuffer); /** -* Returns the UUID. +* Returns the UUID of the XSD used by this configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) @@ -2581,113 +2581,100 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getvers LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getxsduuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXSDUUIDBufferSize, LibMCData_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); /** -* Returns the UUID of the corresponding Configuration type. +* Returns the numeric version of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pTypeUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pTypeUUIDBuffer - buffer of UUID of the configuration type., may be NULL +* @param[out] pConfigurationNumericVersion - Returns the configuration numeric version. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_gettypeuuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getnumericversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_uint32 * pConfigurationNumericVersion); /** -* Returns the UUID of the parent Configuration Version. +* Returns the UUID of the parent version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nParentUUIDBufferSize - size of the buffer (including trailing 0) * @param[out] pParentUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pParentUUIDBuffer - buffer of UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000, if Version is the default configuration., may be NULL +* @param[out] pParentUUIDBuffer - buffer of UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version., may be NULL * @return error code or 0 (success) */ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getparentuuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nParentUUIDBufferSize, LibMCData_uint32* pParentUUIDNeededChars, char * pParentUUIDBuffer); /** -* Returns the Schema type of the configuration. +* Returns the configuration XML content as string. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema type of the configuration type., may be NULL +* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXMLStringBuffer - buffer of XML String., may be NULL * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getschematype(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getconfigurationxmlstring(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXMLStringBufferSize, LibMCData_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); /** -* Returns the version number of the XSD in use.. +* Returns the User UUID. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[out] pXSDVersion - Returns the XSD version. +* @param[in] nUserUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUserUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUserUUIDBuffer - buffer of UUID of the User., may be NULL * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getxsdversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_uint32 * pXSDVersion); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getuseruuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nUserUUIDBufferSize, LibMCData_uint32* pUserUUIDNeededChars, char * pUserUUIDBuffer); /** -* Returns the XSD in use as string.. +* Returns the creation timestamp of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) -* @param[out] pXSDStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXSDStringBuffer - buffer of XSD String., may be NULL +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of creation., may be NULL * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getxsdstring(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_gettimestamp(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); /** -* Returns the configuration XML as String. -* -* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) -* @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXMLStringBuffer - buffer of XML String., may be NULL -* @return error code or 0 (success) -*/ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_getconfigurationxmlstring(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXMLStringBufferSize, LibMCData_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); - -/** -* Creates a new configuration version from this version with the same XSD. +* Creates a new configuration version from this one with the same XSD. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] pXMLString - New XML Configuration String. MUST conform to current XSD. * @param[in] pUserUUID - User UUID for logging the user who initiated the change. -* @param[in] pTimeStampUTC - Current time in UTC. -* @param[out] pCurrentInstance - returns the MachineConfigurationVersion instance. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_createnewversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pCurrentInstance); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_createnewversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, LibMCData_MachineConfigurationVersion * pCurrentInstance); /** -* Creates a new configuration version from this version with another XSD. +* Creates a new configuration version from this one but with a different XSD. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. * @param[in] pXMLString - New XML Configuration String. MUST conform to new XSD. * @param[in] pUserUUID - User UUID for logging the user who initiated the change. -* @param[in] pTimeStampUTC - Current time in UTC. -* @param[out] pCurrentInstance - returns the MachineConfigurationVersion instance. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pCurrentInstance); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, LibMCData_MachineConfigurationVersion * pCurrentInstance); /************************************************************************************************************************* Class definition for MachineConfigurationVersionIterator **************************************************************************************************************************/ /** -* Returns the version the iterator points at. +* Returns the current MachineConfigurationVersion instance. * * @param[in] pMachineConfigurationVersionIterator - MachineConfigurationVersionIterator instance. -* @param[out] pCurrentInstance - returns the MachineConfigurationVersion instance. +* @param[out] pInstance - Currently selected configuration version instance. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversioniterator_getcurrentversion(LibMCData_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCData_MachineConfigurationVersion * pCurrentInstance); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversioniterator_getcurrent(LibMCData_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCData_MachineConfigurationVersion * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationXSD **************************************************************************************************************************/ /** -* Returns the UUID. +* Returns the UUID of the XSD. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) @@ -2698,7 +2685,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationversioniterator LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getuuid(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nXSDUUIDBufferSize, LibMCData_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); /** -* Returns the UUID of the corresponding Configuration type. +* Returns the UUID of the associated configuration type. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) @@ -2709,18 +2696,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getuuid(Lib LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_gettypeuuid(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); /** -* Returns the Schema type of the configuration. -* -* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. -* @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema type of the configuration type., may be NULL -* @return error code or 0 (success) -*/ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getschematype(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); - -/** -* Returns the version number of the XSD.. +* Returns the version number of the XSD. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[out] pXSDVersion - Returns the XSD version. @@ -2729,7 +2705,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getschematy LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getxsdversion(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_uint32 * pXSDVersion); /** -* Returns the XSD as string.. +* Returns the XSD content as string. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. * @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) @@ -2740,20 +2716,35 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getxsdversi LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_getxsdstring(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); /** -* Lists all known Configuration version of the current XSD. +* Returns the creation timestamp of the XSD version. * * @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. -* @param[out] pVersionIterator - Returns a list of versions. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of XSD creation., may be NULL * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_listversions(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_gettimestamp(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/************************************************************************************************************************* + Class definition for MachineConfigurationXSDIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationXSD instance. +* +* @param[in] pMachineConfigurationXSDIterator - MachineConfigurationXSDIterator instance. +* @param[out] pInstance - Currently selected configuration XSD instance. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsditerator_getcurrent(LibMCData_MachineConfigurationXSDIterator pMachineConfigurationXSDIterator, LibMCData_MachineConfigurationXSD * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationType **************************************************************************************************************************/ /** -* Returns the UUID. +* Returns the UUID of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) @@ -2764,7 +2755,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationxsd_listversion LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); /** -* Returns the Name. +* Returns the name of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nNameBufferSize - size of the buffer (including trailing 0) @@ -2775,7 +2766,7 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getuuid(Li LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getname(LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nNameBufferSize, LibMCData_uint32* pNameNeededChars, char * pNameBuffer); /** -* Returns the Schema type of the configuration. +* Returns the schema type string of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) @@ -2786,92 +2777,154 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getname(Li LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getschematype(LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); /** -* Returns the latest Machine Configuration XSD. +* Returns the creation timestamp of the type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of Type creation., may be NULL +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_gettimestamp(LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/** +* Returns the latest XSD registered for this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pXSDInstance - Returns the latest XSD of the configuration type. +* @param[out] pXSDInstance - Latest XSD of the configuration type. * @return error code or 0 (success) */ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Returns the latest Machine Configuration XSD Version. +* Returns all XSDs associated with this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pXSDVersion - Returns the latest XSD version, or 0 if no XSD exists. +* @param[out] pXSDIterator - List of XSDs. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsdversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 * pXSDVersion); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_listxsdversions(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationXSDIterator * pXSDIterator); /** -* Finds Machine Configuration XSD by UUID. +* Returns the version number of the latest XSD for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDUUID - UUID of the configuration XSD. -* @param[out] pXSDInstance - Returns the latest XSD of the configuration type. +* @param[out] pXSDNumericVersion - Latest XSD version number, or 0 if none exist. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_findxsdbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationXSD * pXSDInstance); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsdnumericversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 * pXSDNumericVersion); /** -* Creates a new XSD Version. Fails if version already exists or is not incrementing. +* Registers a new XSD Version. Fails if version already exists or is not incrementing. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDString - XSD String of the version. MUST be incremental. +* @param[in] pXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. -* @param[in] pDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. * @param[out] pXSDInstance - Returns the new XSD of the configuration type. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_createnewxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCData_uint32 nXSDVersion, const char * pDefaultConfigurationXML, LibMCData_MachineConfigurationXSD * pXSDInstance); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_registernewxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCData_uint32 nXSDVersion, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Returns an Configuration XSD Version. +* Finds a specific XSD of this type by its Numeric Version Number. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] nXSDVersion - Version to retrieve. -* @param[out] pXSDInstance - Returns the XSD of the configuration type with the appropriate version number or null if it does not exist. +* @param[in] nXSDNumericVersion - Requested version number. +* @param[out] pXSDInstance - XSD instance if exists. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getxsdversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 nXSDVersion, LibMCData_MachineConfigurationXSD * pXSDInstance); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_findxsdbynumericversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 nXSDNumericVersion, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Lists all known Configuration version of the current type. +* Finds a specific XSD of this type by its UUID. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pVersionIterator - Returns a list of versions. +* @param[in] pXSDUUID - UUID of the XSD. +* @param[out] pXSDInstance - Matching XSD instance. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_listversions(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_findxsdbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationXSD * pXSDInstance); /** -* Finds a Configuration version by UUID. +* Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pVersionUUID - UUID of the configuration version. -* @param[out] pVersion - Returns the specific version or null if version does not exist or is of a different type. +* @param[in] pXSDUUID - UUID of the XSD to base the default configuration on. +* @param[in] pDefaultXML - Configuration XML string conforming to the given XSD. +* @param[in] pTimeStampUTC - Creation timestamp in UTC. +* @param[out] pVersionInstance - Returns the created default configuration version. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_findversionbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_createdefaultconfiguration(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, const char * pDefaultXML, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pVersionInstance); /** -* Returns the active Configuration version. +* Lists all configuration versions registered under this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_listallconfigurationversions(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Lists all configuration versions for specific XSD. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD . +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_listconfigurationversionsforxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Finds a specific configuration version by UUID. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] pVersionUUID - UUID of the configuration version. -* @param[out] pVersion - Returns the specific version or null if no active version exists for this type. +* @param[out] pVersion - Matching configuration version if found. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getactiveversion(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_findconfigurationversionbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion); /** -* Returns the latest Configuration version by Timestamp. +* Returns the currently active configuration version for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pVersion - Returns the specific version or null if no version exists for this type. +* @param[out] pVersion - Active version instance or null. * @return error code or 0 (success) */ -LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getlatestversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion); +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getactiveconfigurationversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion); + +/** +* Returns the most recently created version for this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[out] pVersion - Latest configuration version or null. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_getlatestconfigurationversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion); + +/** +* Sets the active configuration version for this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pVersionUUID - UUID of the version to set as active. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtype_setactiveconfigurationversion(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID); + +/************************************************************************************************************************* + Class definition for MachineConfigurationTypeIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationType instance. +* +* @param[in] pMachineConfigurationTypeIterator - MachineConfigurationTypeIterator instance. +* @param[out] pInstance - Currently selected configuration type instance. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_machineconfigurationtypeiterator_getcurrent(LibMCData_MachineConfigurationTypeIterator pMachineConfigurationTypeIterator, LibMCData_MachineConfigurationType * pInstance); /************************************************************************************************************************* Class definition for InstallationInformation @@ -3077,6 +3130,15 @@ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_datamodel_clearlogcallback(LibMCDat */ LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_datamodel_haslogcallback(LibMCData_DataModel pDataModel, bool * pHasCallback); +/** +* Lists all registered configuration types. +* +* @param[in] pDataModel - DataModel instance. +* @param[out] pConfigurationTypeIterator - List of configuration types. +* @return error code or 0 (success) +*/ +LIBMCDATA_DECLSPEC LibMCDataResult libmcdata_datamodel_listregisteredconfigurationtypes(LibMCData_DataModel pDataModel, LibMCData_MachineConfigurationTypeIterator * pConfigurationTypeIterator); + /** * Retrieves a configuration type by schema. * diff --git a/Framework/InterfacesCore/libmcdata_interfaces.hpp b/Framework/InterfacesCore/libmcdata_interfaces.hpp index baac461c..33cd23b4 100644 --- a/Framework/InterfacesCore/libmcdata_interfaces.hpp +++ b/Framework/InterfacesCore/libmcdata_interfaces.hpp @@ -83,7 +83,9 @@ class IPersistencyHandler; class IMachineConfigurationVersion; class IMachineConfigurationVersionIterator; class IMachineConfigurationXSD; +class IMachineConfigurationXSDIterator; class IMachineConfigurationType; +class IMachineConfigurationTypeIterator; class IInstallationInformation; class IDataModel; @@ -2142,71 +2144,63 @@ typedef IBaseSharedPtr PIPersistencyHandler; class IMachineConfigurationVersion : public virtual IBase { public: /** - * IMachineConfigurationVersion::GetVersionUUID - Returns the UUID. + * IMachineConfigurationVersion::GetVersionUUID - Returns the UUID of the configuration version. * @return UUID of the configuration version. */ virtual std::string GetVersionUUID() = 0; /** - * IMachineConfigurationVersion::GetXSDUUID - Returns the UUID. + * IMachineConfigurationVersion::GetXSDUUID - Returns the UUID of the XSD used by this configuration version. * @return UUID of the configuration XSD. */ virtual std::string GetXSDUUID() = 0; /** - * IMachineConfigurationVersion::GetTypeUUID - Returns the UUID of the corresponding Configuration type. - * @return UUID of the configuration type. + * IMachineConfigurationVersion::GetNumericVersion - Returns the numeric version of the configuration version. + * @return Returns the configuration numeric version. */ - virtual std::string GetTypeUUID() = 0; + virtual LibMCData_uint32 GetNumericVersion() = 0; /** - * IMachineConfigurationVersion::GetParentUUID - Returns the UUID of the parent Configuration Version. - * @return UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000, if Version is the default configuration. + * IMachineConfigurationVersion::GetParentUUID - Returns the UUID of the parent version. + * @return UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version. */ virtual std::string GetParentUUID() = 0; /** - * IMachineConfigurationVersion::GetSchemaType - Returns the Schema type of the configuration. - * @return Schema type of the configuration type. - */ - virtual std::string GetSchemaType() = 0; - - /** - * IMachineConfigurationVersion::GetXSDVersion - Returns the version number of the XSD in use.. - * @return Returns the XSD version. + * IMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration XML content as string. + * @return XML String. */ - virtual LibMCData_uint32 GetXSDVersion() = 0; + virtual std::string GetConfigurationXMLString() = 0; /** - * IMachineConfigurationVersion::GetXSDString - Returns the XSD in use as string.. - * @return XSD String. + * IMachineConfigurationVersion::GetUserUUID - Returns the User UUID. + * @return UUID of the User. */ - virtual std::string GetXSDString() = 0; + virtual std::string GetUserUUID() = 0; /** - * IMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration XML as String. - * @return XML String. + * IMachineConfigurationVersion::GetTimestamp - Returns the creation timestamp of the configuration version. + * @return UTC timestamp of creation. */ - virtual std::string GetConfigurationXMLString() = 0; + virtual std::string GetTimestamp() = 0; /** - * IMachineConfigurationVersion::CreateNewVersion - Creates a new configuration version from this version with the same XSD. + * IMachineConfigurationVersion::CreateNewVersion - Creates a new configuration version from this one with the same XSD. * @param[in] sXMLString - New XML Configuration String. MUST conform to current XSD. * @param[in] sUserUUID - User UUID for logging the user who initiated the change. - * @param[in] sTimeStampUTC - Current time in UTC. - * @return returns the MachineConfigurationVersion instance. + * @return Returns the newly created MachineConfigurationVersion instance. */ - virtual IMachineConfigurationVersion * CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) = 0; + virtual IMachineConfigurationVersion * CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID) = 0; /** - * IMachineConfigurationVersion::MigrateToNewXSD - Creates a new configuration version from this version with another XSD. + * IMachineConfigurationVersion::MigrateToNewXSD - Creates a new configuration version from this one but with a different XSD. * @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. * @param[in] sXMLString - New XML Configuration String. MUST conform to new XSD. * @param[in] sUserUUID - User UUID for logging the user who initiated the change. - * @param[in] sTimeStampUTC - Current time in UTC. - * @return returns the MachineConfigurationVersion instance. + * @return Returns the newly created MachineConfigurationVersion instance. */ - virtual IMachineConfigurationVersion * MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) = 0; + virtual IMachineConfigurationVersion * MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID) = 0; }; @@ -2220,10 +2214,10 @@ typedef IBaseSharedPtr PIMachineConfigurationVersi class IMachineConfigurationVersionIterator : public virtual IIterator { public: /** - * IMachineConfigurationVersionIterator::GetCurrentVersion - Returns the version the iterator points at. - * @return returns the MachineConfigurationVersion instance. + * IMachineConfigurationVersionIterator::GetCurrent - Returns the current MachineConfigurationVersion instance. + * @return Currently selected configuration version instance. */ - virtual IMachineConfigurationVersion * GetCurrentVersion() = 0; + virtual IMachineConfigurationVersion * GetCurrent() = 0; }; @@ -2237,46 +2231,57 @@ typedef IBaseSharedPtr PIMachineConfigurat class IMachineConfigurationXSD : public virtual IBase { public: /** - * IMachineConfigurationXSD::GetUUID - Returns the UUID. + * IMachineConfigurationXSD::GetUUID - Returns the UUID of the XSD. * @return UUID of the configuration XSD. */ virtual std::string GetUUID() = 0; /** - * IMachineConfigurationXSD::GetTypeUUID - Returns the UUID of the corresponding Configuration type. + * IMachineConfigurationXSD::GetTypeUUID - Returns the UUID of the associated configuration type. * @return UUID of the configuration type. */ virtual std::string GetTypeUUID() = 0; /** - * IMachineConfigurationXSD::GetSchemaType - Returns the Schema type of the configuration. - * @return Schema type of the configuration type. - */ - virtual std::string GetSchemaType() = 0; - - /** - * IMachineConfigurationXSD::GetXSDVersion - Returns the version number of the XSD.. + * IMachineConfigurationXSD::GetXSDVersion - Returns the version number of the XSD. * @return Returns the XSD version. */ virtual LibMCData_uint32 GetXSDVersion() = 0; /** - * IMachineConfigurationXSD::GetXSDString - Returns the XSD as string.. + * IMachineConfigurationXSD::GetXSDString - Returns the XSD content as string. * @return XSD String. */ virtual std::string GetXSDString() = 0; /** - * IMachineConfigurationXSD::ListVersions - Lists all known Configuration version of the current XSD. - * @return Returns a list of versions. + * IMachineConfigurationXSD::GetTimestamp - Returns the creation timestamp of the XSD version. + * @return UTC timestamp of XSD creation. */ - virtual IMachineConfigurationVersionIterator * ListVersions() = 0; + virtual std::string GetTimestamp() = 0; }; typedef IBaseSharedPtr PIMachineConfigurationXSD; +/************************************************************************************************************************* + Class interface for MachineConfigurationXSDIterator +**************************************************************************************************************************/ + +class IMachineConfigurationXSDIterator : public virtual IIterator { +public: + /** + * IMachineConfigurationXSDIterator::GetCurrent - Returns the current MachineConfigurationXSD instance. + * @return Currently selected configuration XSD instance. + */ + virtual IMachineConfigurationXSD * GetCurrent() = 0; + +}; + +typedef IBaseSharedPtr PIMachineConfigurationXSDIterator; + + /************************************************************************************************************************* Class interface for MachineConfigurationType **************************************************************************************************************************/ @@ -2284,89 +2289,138 @@ typedef IBaseSharedPtr PIMachineConfigurationXSD; class IMachineConfigurationType : public virtual IBase { public: /** - * IMachineConfigurationType::GetUUID - Returns the UUID. + * IMachineConfigurationType::GetUUID - Returns the UUID of the configuration type. * @return UUID of the configuration type. */ virtual std::string GetUUID() = 0; /** - * IMachineConfigurationType::GetName - Returns the Name. + * IMachineConfigurationType::GetName - Returns the name of the configuration type. * @return Name of the configuration type. */ virtual std::string GetName() = 0; /** - * IMachineConfigurationType::GetSchemaType - Returns the Schema type of the configuration. + * IMachineConfigurationType::GetSchemaType - Returns the schema type string of the configuration type. * @return Schema type of the configuration type. */ virtual std::string GetSchemaType() = 0; /** - * IMachineConfigurationType::GetLatestXSD - Returns the latest Machine Configuration XSD. - * @return Returns the latest XSD of the configuration type. + * IMachineConfigurationType::GetTimestamp - Returns the creation timestamp of the type. + * @return UTC timestamp of Type creation. + */ + virtual std::string GetTimestamp() = 0; + + /** + * IMachineConfigurationType::GetLatestXSD - Returns the latest XSD registered for this configuration type. + * @return Latest XSD of the configuration type. */ virtual IMachineConfigurationXSD * GetLatestXSD() = 0; /** - * IMachineConfigurationType::GetLatestXSDVersion - Returns the latest Machine Configuration XSD Version. - * @return Returns the latest XSD version, or 0 if no XSD exists. + * IMachineConfigurationType::ListXSDVersions - Returns all XSDs associated with this configuration type. + * @return List of XSDs. */ - virtual LibMCData_uint32 GetLatestXSDVersion() = 0; + virtual IMachineConfigurationXSDIterator * ListXSDVersions() = 0; /** - * IMachineConfigurationType::FindXSDByUUID - Finds Machine Configuration XSD by UUID. - * @param[in] sXSDUUID - UUID of the configuration XSD. - * @return Returns the latest XSD of the configuration type. + * IMachineConfigurationType::GetLatestXSDNumericVersion - Returns the version number of the latest XSD for this type. + * @return Latest XSD version number, or 0 if none exist. */ - virtual IMachineConfigurationXSD * FindXSDByUUID(const std::string & sXSDUUID) = 0; + virtual LibMCData_uint32 GetLatestXSDNumericVersion() = 0; /** - * IMachineConfigurationType::CreateNewXSD - Creates a new XSD Version. Fails if version already exists or is not incrementing. - * @param[in] sXSDString - XSD String of the version. MUST be incremental. + * IMachineConfigurationType::RegisterNewXSD - Registers a new XSD Version. Fails if version already exists or is not incrementing. + * @param[in] sXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. - * @param[in] sDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. * @return Returns the new XSD of the configuration type. */ - virtual IMachineConfigurationXSD * CreateNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) = 0; + virtual IMachineConfigurationXSD * RegisterNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion) = 0; /** - * IMachineConfigurationType::GetXSDVersion - Returns an Configuration XSD Version. - * @param[in] nXSDVersion - Version to retrieve. - * @return Returns the XSD of the configuration type with the appropriate version number or null if it does not exist. + * IMachineConfigurationType::FindXSDByNumericVersion - Finds a specific XSD of this type by its Numeric Version Number. + * @param[in] nXSDNumericVersion - Requested version number. + * @return XSD instance if exists. */ - virtual IMachineConfigurationXSD * GetXSDVersion(const LibMCData_uint32 nXSDVersion) = 0; + virtual IMachineConfigurationXSD * FindXSDByNumericVersion(const LibMCData_uint32 nXSDNumericVersion) = 0; /** - * IMachineConfigurationType::ListVersions - Lists all known Configuration version of the current type. - * @return Returns a list of versions. + * IMachineConfigurationType::FindXSDByUUID - Finds a specific XSD of this type by its UUID. + * @param[in] sXSDUUID - UUID of the XSD. + * @return Matching XSD instance. */ - virtual IMachineConfigurationVersionIterator * ListVersions() = 0; + virtual IMachineConfigurationXSD * FindXSDByUUID(const std::string & sXSDUUID) = 0; /** - * IMachineConfigurationType::FindVersionByUUID - Finds a Configuration version by UUID. - * @param[in] sVersionUUID - UUID of the configuration version. - * @return Returns the specific version or null if version does not exist or is of a different type. + * IMachineConfigurationType::CreateDefaultConfiguration - Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. + * @param[in] sXSDUUID - UUID of the XSD to base the default configuration on. + * @param[in] sDefaultXML - Configuration XML string conforming to the given XSD. + * @param[in] sTimeStampUTC - Creation timestamp in UTC. + * @return Returns the created default configuration version. + */ + virtual IMachineConfigurationVersion * CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC) = 0; + + /** + * IMachineConfigurationType::ListAllConfigurationVersions - Lists all configuration versions registered under this type. + * @return List of configuration versions. + */ + virtual IMachineConfigurationVersionIterator * ListAllConfigurationVersions() = 0; + + /** + * IMachineConfigurationType::ListConfigurationVersionsForXSD - Lists all configuration versions for specific XSD. + * @param[in] sXSDUUID - UUID of the XSD . + * @return List of configuration versions. */ - virtual IMachineConfigurationVersion * FindVersionByUUID(const std::string & sVersionUUID) = 0; + virtual IMachineConfigurationVersionIterator * ListConfigurationVersionsForXSD(const std::string & sXSDUUID) = 0; /** - * IMachineConfigurationType::GetActiveVersion - Returns the active Configuration version. + * IMachineConfigurationType::FindConfigurationVersionByUUID - Finds a specific configuration version by UUID. * @param[in] sVersionUUID - UUID of the configuration version. - * @return Returns the specific version or null if no active version exists for this type. + * @return Matching configuration version if found. + */ + virtual IMachineConfigurationVersion * FindConfigurationVersionByUUID(const std::string & sVersionUUID) = 0; + + /** + * IMachineConfigurationType::GetActiveConfigurationVersion - Returns the currently active configuration version for this type. + * @return Active version instance or null. + */ + virtual IMachineConfigurationVersion * GetActiveConfigurationVersion() = 0; + + /** + * IMachineConfigurationType::GetLatestConfigurationVersion - Returns the most recently created version for this type. + * @return Latest configuration version or null. */ - virtual IMachineConfigurationVersion * GetActiveVersion(const std::string & sVersionUUID) = 0; + virtual IMachineConfigurationVersion * GetLatestConfigurationVersion() = 0; /** - * IMachineConfigurationType::GetLatestVersion - Returns the latest Configuration version by Timestamp. - * @return Returns the specific version or null if no version exists for this type. + * IMachineConfigurationType::SetActiveConfigurationVersion - Sets the active configuration version for this type. + * @param[in] sVersionUUID - UUID of the version to set as active. */ - virtual IMachineConfigurationVersion * GetLatestVersion() = 0; + virtual void SetActiveConfigurationVersion(const std::string & sVersionUUID) = 0; }; typedef IBaseSharedPtr PIMachineConfigurationType; +/************************************************************************************************************************* + Class interface for MachineConfigurationTypeIterator +**************************************************************************************************************************/ + +class IMachineConfigurationTypeIterator : public virtual IIterator { +public: + /** + * IMachineConfigurationTypeIterator::GetCurrent - Returns the current MachineConfigurationType instance. + * @return Currently selected configuration type instance. + */ + virtual IMachineConfigurationType * GetCurrent() = 0; + +}; + +typedef IBaseSharedPtr PIMachineConfigurationTypeIterator; + + /************************************************************************************************************************* Class interface for InstallationInformation **************************************************************************************************************************/ @@ -2508,6 +2562,12 @@ class IDataModel : public virtual IBase { */ virtual bool HasLogCallback() = 0; + /** + * IDataModel::ListRegisteredConfigurationTypes - Lists all registered configuration types. + * @return List of configuration types. + */ + virtual IMachineConfigurationTypeIterator * ListRegisteredConfigurationTypes() = 0; + /** * IDataModel::FindConfigurationTypeBySchema - Retrieves a configuration type by schema. * @param[in] sSchemaType - Configuration Schema Type String diff --git a/Framework/InterfacesCore/libmcdata_interfacewrapper.cpp b/Framework/InterfacesCore/libmcdata_interfacewrapper.cpp index 17f12f44..6bb24a94 100644 --- a/Framework/InterfacesCore/libmcdata_interfacewrapper.cpp +++ b/Framework/InterfacesCore/libmcdata_interfacewrapper.cpp @@ -8309,41 +8309,19 @@ LibMCDataResult libmcdata_machineconfigurationversion_getxsduuid(LibMCData_Machi } } -LibMCDataResult libmcdata_machineconfigurationversion_gettypeuuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nTypeUUIDBufferSize, LibMCData_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer) +LibMCDataResult libmcdata_machineconfigurationversion_getnumericversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_uint32 * pConfigurationNumericVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; try { - if ( (!pTypeUUIDBuffer) && !(pTypeUUIDNeededChars) ) + if (pConfigurationNumericVersion == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sTypeUUID(""); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - bool isCacheCall = (pTypeUUIDBuffer == nullptr); - if (isCacheCall) { - sTypeUUID = pIMachineConfigurationVersion->GetTypeUUID(); + *pConfigurationNumericVersion = pIMachineConfigurationVersion->GetNumericVersion(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sTypeUUID)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); - if (cache == nullptr) - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - cache->retrieveData (sTypeUUID); - pIMachineConfigurationVersion->_setCache (nullptr); - } - - if (pTypeUUIDNeededChars) - *pTypeUUIDNeededChars = (LibMCData_uint32) (sTypeUUID.size()+1); - if (pTypeUUIDBuffer) { - if (sTypeUUID.size() >= nTypeUUIDBufferSize) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); - for (size_t iTypeUUID = 0; iTypeUUID < sTypeUUID.size(); iTypeUUID++) - pTypeUUIDBuffer[iTypeUUID] = sTypeUUID[iTypeUUID]; - pTypeUUIDBuffer[sTypeUUID.size()] = 0; - } return LIBMCDATA_SUCCESS; } catch (ELibMCDataInterfaceException & Exception) { @@ -8405,40 +8383,40 @@ LibMCDataResult libmcdata_machineconfigurationversion_getparentuuid(LibMCData_Ma } } -LibMCDataResult libmcdata_machineconfigurationversion_getschematype(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer) +LibMCDataResult libmcdata_machineconfigurationversion_getconfigurationxmlstring(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXMLStringBufferSize, LibMCData_uint32* pXMLStringNeededChars, char * pXMLStringBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; try { - if ( (!pSchemaTypeBuffer) && !(pSchemaTypeNeededChars) ) + if ( (!pXMLStringBuffer) && !(pXMLStringNeededChars) ) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sSchemaType(""); + std::string sXMLString(""); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - bool isCacheCall = (pSchemaTypeBuffer == nullptr); + bool isCacheCall = (pXMLStringBuffer == nullptr); if (isCacheCall) { - sSchemaType = pIMachineConfigurationVersion->GetSchemaType(); + sXMLString = pIMachineConfigurationVersion->GetConfigurationXMLString(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sSchemaType)); + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXMLString)); } else { auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); if (cache == nullptr) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - cache->retrieveData (sSchemaType); + cache->retrieveData (sXMLString); pIMachineConfigurationVersion->_setCache (nullptr); } - if (pSchemaTypeNeededChars) - *pSchemaTypeNeededChars = (LibMCData_uint32) (sSchemaType.size()+1); - if (pSchemaTypeBuffer) { - if (sSchemaType.size() >= nSchemaTypeBufferSize) + if (pXMLStringNeededChars) + *pXMLStringNeededChars = (LibMCData_uint32) (sXMLString.size()+1); + if (pXMLStringBuffer) { + if (sXMLString.size() >= nXMLStringBufferSize) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); - for (size_t iSchemaType = 0; iSchemaType < sSchemaType.size(); iSchemaType++) - pSchemaTypeBuffer[iSchemaType] = sSchemaType[iSchemaType]; - pSchemaTypeBuffer[sSchemaType.size()] = 0; + for (size_t iXMLString = 0; iXMLString < sXMLString.size(); iXMLString++) + pXMLStringBuffer[iXMLString] = sXMLString[iXMLString]; + pXMLStringBuffer[sXMLString.size()] = 0; } return LIBMCDATA_SUCCESS; } @@ -8453,66 +8431,40 @@ LibMCDataResult libmcdata_machineconfigurationversion_getschematype(LibMCData_Ma } } -LibMCDataResult libmcdata_machineconfigurationversion_getxsdversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_uint32 * pXSDVersion) -{ - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; - - try { - if (pXSDVersion == nullptr) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - - *pXSDVersion = pIMachineConfigurationVersion->GetXSDVersion(); - - return LIBMCDATA_SUCCESS; - } - catch (ELibMCDataInterfaceException & Exception) { - return handleLibMCDataException(pIBaseClass, Exception); - } - catch (std::exception & StdException) { - return handleStdException(pIBaseClass, StdException); - } - catch (...) { - return handleUnhandledException(pIBaseClass); - } -} - -LibMCDataResult libmcdata_machineconfigurationversion_getxsdstring(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer) +LibMCDataResult libmcdata_machineconfigurationversion_getuseruuid(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nUserUUIDBufferSize, LibMCData_uint32* pUserUUIDNeededChars, char * pUserUUIDBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; try { - if ( (!pXSDStringBuffer) && !(pXSDStringNeededChars) ) + if ( (!pUserUUIDBuffer) && !(pUserUUIDNeededChars) ) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sXSDString(""); + std::string sUserUUID(""); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - bool isCacheCall = (pXSDStringBuffer == nullptr); + bool isCacheCall = (pUserUUIDBuffer == nullptr); if (isCacheCall) { - sXSDString = pIMachineConfigurationVersion->GetXSDString(); + sUserUUID = pIMachineConfigurationVersion->GetUserUUID(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXSDString)); + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sUserUUID)); } else { auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); if (cache == nullptr) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - cache->retrieveData (sXSDString); + cache->retrieveData (sUserUUID); pIMachineConfigurationVersion->_setCache (nullptr); } - if (pXSDStringNeededChars) - *pXSDStringNeededChars = (LibMCData_uint32) (sXSDString.size()+1); - if (pXSDStringBuffer) { - if (sXSDString.size() >= nXSDStringBufferSize) + if (pUserUUIDNeededChars) + *pUserUUIDNeededChars = (LibMCData_uint32) (sUserUUID.size()+1); + if (pUserUUIDBuffer) { + if (sUserUUID.size() >= nUserUUIDBufferSize) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); - for (size_t iXSDString = 0; iXSDString < sXSDString.size(); iXSDString++) - pXSDStringBuffer[iXSDString] = sXSDString[iXSDString]; - pXSDStringBuffer[sXSDString.size()] = 0; + for (size_t iUserUUID = 0; iUserUUID < sUserUUID.size(); iUserUUID++) + pUserUUIDBuffer[iUserUUID] = sUserUUID[iUserUUID]; + pUserUUIDBuffer[sUserUUID.size()] = 0; } return LIBMCDATA_SUCCESS; } @@ -8527,40 +8479,40 @@ LibMCDataResult libmcdata_machineconfigurationversion_getxsdstring(LibMCData_Mac } } -LibMCDataResult libmcdata_machineconfigurationversion_getconfigurationxmlstring(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nXMLStringBufferSize, LibMCData_uint32* pXMLStringNeededChars, char * pXMLStringBuffer) +LibMCDataResult libmcdata_machineconfigurationversion_gettimestamp(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; try { - if ( (!pXMLStringBuffer) && !(pXMLStringNeededChars) ) + if ( (!pTimeStampUTCBuffer) && !(pTimeStampUTCNeededChars) ) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sXMLString(""); + std::string sTimeStampUTC(""); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - bool isCacheCall = (pXMLStringBuffer == nullptr); + bool isCacheCall = (pTimeStampUTCBuffer == nullptr); if (isCacheCall) { - sXMLString = pIMachineConfigurationVersion->GetConfigurationXMLString(); + sTimeStampUTC = pIMachineConfigurationVersion->GetTimestamp(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXMLString)); + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sTimeStampUTC)); } else { auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); if (cache == nullptr) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - cache->retrieveData (sXMLString); + cache->retrieveData (sTimeStampUTC); pIMachineConfigurationVersion->_setCache (nullptr); } - if (pXMLStringNeededChars) - *pXMLStringNeededChars = (LibMCData_uint32) (sXMLString.size()+1); - if (pXMLStringBuffer) { - if (sXMLString.size() >= nXMLStringBufferSize) + if (pTimeStampUTCNeededChars) + *pTimeStampUTCNeededChars = (LibMCData_uint32) (sTimeStampUTC.size()+1); + if (pTimeStampUTCBuffer) { + if (sTimeStampUTC.size() >= nTimeStampUTCBufferSize) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); - for (size_t iXMLString = 0; iXMLString < sXMLString.size(); iXMLString++) - pXMLStringBuffer[iXMLString] = sXMLString[iXMLString]; - pXMLStringBuffer[sXMLString.size()] = 0; + for (size_t iTimeStampUTC = 0; iTimeStampUTC < sTimeStampUTC.size(); iTimeStampUTC++) + pTimeStampUTCBuffer[iTimeStampUTC] = sTimeStampUTC[iTimeStampUTC]; + pTimeStampUTCBuffer[sTimeStampUTC.size()] = 0; } return LIBMCDATA_SUCCESS; } @@ -8575,7 +8527,7 @@ LibMCDataResult libmcdata_machineconfigurationversion_getconfigurationxmlstring( } } -LibMCDataResult libmcdata_machineconfigurationversion_createnewversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pCurrentInstance) +LibMCDataResult libmcdata_machineconfigurationversion_createnewversion(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, LibMCData_MachineConfigurationVersion * pCurrentInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; @@ -8584,19 +8536,16 @@ LibMCDataResult libmcdata_machineconfigurationversion_createnewversion(LibMCData throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pUserUUID == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - if (pTimeStampUTC == nullptr) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pCurrentInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); std::string sXMLString(pXMLString); std::string sUserUUID(pUserUUID); - std::string sTimeStampUTC(pTimeStampUTC); IBase* pBaseCurrentInstance(nullptr); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseCurrentInstance = pIMachineConfigurationVersion->CreateNewVersion(sXMLString, sUserUUID, sTimeStampUTC); + pBaseCurrentInstance = pIMachineConfigurationVersion->CreateNewVersion(sXMLString, sUserUUID); *pCurrentInstance = (IBase*)(pBaseCurrentInstance); return LIBMCDATA_SUCCESS; @@ -8612,7 +8561,7 @@ LibMCDataResult libmcdata_machineconfigurationversion_createnewversion(LibMCData } } -LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pCurrentInstance) +LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_MachineConfigurationVersion pMachineConfigurationVersion, LibMCData_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, LibMCData_MachineConfigurationVersion * pCurrentInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; @@ -8621,8 +8570,6 @@ LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_ throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pUserUUID == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - if (pTimeStampUTC == nullptr) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pCurrentInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); IBase* pIBaseClassNewXSD = (IBase *)pNewXSD; @@ -8632,13 +8579,12 @@ LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_ std::string sXMLString(pXMLString); std::string sUserUUID(pUserUUID); - std::string sTimeStampUTC(pTimeStampUTC); IBase* pBaseCurrentInstance(nullptr); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseCurrentInstance = pIMachineConfigurationVersion->MigrateToNewXSD(pINewXSD, sXMLString, sUserUUID, sTimeStampUTC); + pBaseCurrentInstance = pIMachineConfigurationVersion->MigrateToNewXSD(pINewXSD, sXMLString, sUserUUID); *pCurrentInstance = (IBase*)(pBaseCurrentInstance); return LIBMCDATA_SUCCESS; @@ -8658,21 +8604,21 @@ LibMCDataResult libmcdata_machineconfigurationversion_migratetonewxsd(LibMCData_ /************************************************************************************************************************* Class implementation for MachineConfigurationVersionIterator **************************************************************************************************************************/ -LibMCDataResult libmcdata_machineconfigurationversioniterator_getcurrentversion(LibMCData_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCData_MachineConfigurationVersion * pCurrentInstance) +LibMCDataResult libmcdata_machineconfigurationversioniterator_getcurrent(LibMCData_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCData_MachineConfigurationVersion * pInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersionIterator; try { - if (pCurrentInstance == nullptr) + if (pInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - IBase* pBaseCurrentInstance(nullptr); + IBase* pBaseInstance(nullptr); IMachineConfigurationVersionIterator* pIMachineConfigurationVersionIterator = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersionIterator) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseCurrentInstance = pIMachineConfigurationVersionIterator->GetCurrentVersion(); + pBaseInstance = pIMachineConfigurationVersionIterator->GetCurrent(); - *pCurrentInstance = (IBase*)(pBaseCurrentInstance); + *pInstance = (IBase*)(pBaseInstance); return LIBMCDATA_SUCCESS; } catch (ELibMCDataInterfaceException & Exception) { @@ -8786,41 +8732,19 @@ LibMCDataResult libmcdata_machineconfigurationxsd_gettypeuuid(LibMCData_MachineC } } -LibMCDataResult libmcdata_machineconfigurationxsd_getschematype(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nSchemaTypeBufferSize, LibMCData_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer) +LibMCDataResult libmcdata_machineconfigurationxsd_getxsdversion(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_uint32 * pXSDVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; try { - if ( (!pSchemaTypeBuffer) && !(pSchemaTypeNeededChars) ) + if (pXSDVersion == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sSchemaType(""); IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationXSD) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - bool isCacheCall = (pSchemaTypeBuffer == nullptr); - if (isCacheCall) { - sSchemaType = pIMachineConfigurationXSD->GetSchemaType(); + *pXSDVersion = pIMachineConfigurationXSD->GetXSDVersion(); - pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sSchemaType)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); - if (cache == nullptr) - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - cache->retrieveData (sSchemaType); - pIMachineConfigurationXSD->_setCache (nullptr); - } - - if (pSchemaTypeNeededChars) - *pSchemaTypeNeededChars = (LibMCData_uint32) (sSchemaType.size()+1); - if (pSchemaTypeBuffer) { - if (sSchemaType.size() >= nSchemaTypeBufferSize) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); - for (size_t iSchemaType = 0; iSchemaType < sSchemaType.size(); iSchemaType++) - pSchemaTypeBuffer[iSchemaType] = sSchemaType[iSchemaType]; - pSchemaTypeBuffer[sSchemaType.size()] = 0; - } return LIBMCDATA_SUCCESS; } catch (ELibMCDataInterfaceException & Exception) { @@ -8834,19 +8758,41 @@ LibMCDataResult libmcdata_machineconfigurationxsd_getschematype(LibMCData_Machin } } -LibMCDataResult libmcdata_machineconfigurationxsd_getxsdversion(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_uint32 * pXSDVersion) +LibMCDataResult libmcdata_machineconfigurationxsd_getxsdstring(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; try { - if (pXSDVersion == nullptr) + if ( (!pXSDStringBuffer) && !(pXSDStringNeededChars) ) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + std::string sXSDString(""); IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationXSD) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - *pXSDVersion = pIMachineConfigurationXSD->GetXSDVersion(); + bool isCacheCall = (pXSDStringBuffer == nullptr); + if (isCacheCall) { + sXSDString = pIMachineConfigurationXSD->GetXSDString(); + pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sXSDString)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); + if (cache == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + cache->retrieveData (sXSDString); + pIMachineConfigurationXSD->_setCache (nullptr); + } + + if (pXSDStringNeededChars) + *pXSDStringNeededChars = (LibMCData_uint32) (sXSDString.size()+1); + if (pXSDStringBuffer) { + if (sXSDString.size() >= nXSDStringBufferSize) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); + for (size_t iXSDString = 0; iXSDString < sXSDString.size(); iXSDString++) + pXSDStringBuffer[iXSDString] = sXSDString[iXSDString]; + pXSDStringBuffer[sXSDString.size()] = 0; + } return LIBMCDATA_SUCCESS; } catch (ELibMCDataInterfaceException & Exception) { @@ -8860,40 +8806,40 @@ LibMCDataResult libmcdata_machineconfigurationxsd_getxsdversion(LibMCData_Machin } } -LibMCDataResult libmcdata_machineconfigurationxsd_getxsdstring(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nXSDStringBufferSize, LibMCData_uint32* pXSDStringNeededChars, char * pXSDStringBuffer) +LibMCDataResult libmcdata_machineconfigurationxsd_gettimestamp(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; try { - if ( (!pXSDStringBuffer) && !(pXSDStringNeededChars) ) + if ( (!pTimeStampUTCBuffer) && !(pTimeStampUTCNeededChars) ) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sXSDString(""); + std::string sTimeStampUTC(""); IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationXSD) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - bool isCacheCall = (pXSDStringBuffer == nullptr); + bool isCacheCall = (pTimeStampUTCBuffer == nullptr); if (isCacheCall) { - sXSDString = pIMachineConfigurationXSD->GetXSDString(); + sTimeStampUTC = pIMachineConfigurationXSD->GetTimestamp(); - pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sXSDString)); + pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sTimeStampUTC)); } else { auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); if (cache == nullptr) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - cache->retrieveData (sXSDString); + cache->retrieveData (sTimeStampUTC); pIMachineConfigurationXSD->_setCache (nullptr); } - if (pXSDStringNeededChars) - *pXSDStringNeededChars = (LibMCData_uint32) (sXSDString.size()+1); - if (pXSDStringBuffer) { - if (sXSDString.size() >= nXSDStringBufferSize) + if (pTimeStampUTCNeededChars) + *pTimeStampUTCNeededChars = (LibMCData_uint32) (sTimeStampUTC.size()+1); + if (pTimeStampUTCBuffer) { + if (sTimeStampUTC.size() >= nTimeStampUTCBufferSize) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); - for (size_t iXSDString = 0; iXSDString < sXSDString.size(); iXSDString++) - pXSDStringBuffer[iXSDString] = sXSDString[iXSDString]; - pXSDStringBuffer[sXSDString.size()] = 0; + for (size_t iTimeStampUTC = 0; iTimeStampUTC < sTimeStampUTC.size(); iTimeStampUTC++) + pTimeStampUTCBuffer[iTimeStampUTC] = sTimeStampUTC[iTimeStampUTC]; + pTimeStampUTCBuffer[sTimeStampUTC.size()] = 0; } return LIBMCDATA_SUCCESS; } @@ -8908,21 +8854,25 @@ LibMCDataResult libmcdata_machineconfigurationxsd_getxsdstring(LibMCData_Machine } } -LibMCDataResult libmcdata_machineconfigurationxsd_listversions(LibMCData_MachineConfigurationXSD pMachineConfigurationXSD, LibMCData_MachineConfigurationVersionIterator * pVersionIterator) + +/************************************************************************************************************************* + Class implementation for MachineConfigurationXSDIterator +**************************************************************************************************************************/ +LibMCDataResult libmcdata_machineconfigurationxsditerator_getcurrent(LibMCData_MachineConfigurationXSDIterator pMachineConfigurationXSDIterator, LibMCData_MachineConfigurationXSD * pInstance) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSDIterator; try { - if (pVersionIterator == nullptr) + if (pInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - IBase* pBaseVersionIterator(nullptr); - IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationXSD) + IBase* pBaseInstance(nullptr); + IMachineConfigurationXSDIterator* pIMachineConfigurationXSDIterator = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSDIterator) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseVersionIterator = pIMachineConfigurationXSD->ListVersions(); + pBaseInstance = pIMachineConfigurationXSDIterator->GetCurrent(); - *pVersionIterator = (IBase*)(pBaseVersionIterator); + *pInstance = (IBase*)(pBaseInstance); return LIBMCDATA_SUCCESS; } catch (ELibMCDataInterfaceException & Exception) { @@ -9084,6 +9034,54 @@ LibMCDataResult libmcdata_machineconfigurationtype_getschematype(LibMCData_Machi } } +LibMCDataResult libmcdata_machineconfigurationtype_gettimestamp(LibMCData_MachineConfigurationType pMachineConfigurationType, const LibMCData_uint32 nTimeStampUTCBufferSize, LibMCData_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if ( (!pTimeStampUTCBuffer) && !(pTimeStampUTCNeededChars) ) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + std::string sTimeStampUTC(""); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + bool isCacheCall = (pTimeStampUTCBuffer == nullptr); + if (isCacheCall) { + sTimeStampUTC = pIMachineConfigurationType->GetTimestamp(); + + pIMachineConfigurationType->_setCache (new ParameterCache_1 (sTimeStampUTC)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); + if (cache == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + cache->retrieveData (sTimeStampUTC); + pIMachineConfigurationType->_setCache (nullptr); + } + + if (pTimeStampUTCNeededChars) + *pTimeStampUTCNeededChars = (LibMCData_uint32) (sTimeStampUTC.size()+1); + if (pTimeStampUTCBuffer) { + if (sTimeStampUTC.size() >= nTimeStampUTCBufferSize) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_BUFFERTOOSMALL); + for (size_t iTimeStampUTC = 0; iTimeStampUTC < sTimeStampUTC.size(); iTimeStampUTC++) + pTimeStampUTCBuffer[iTimeStampUTC] = sTimeStampUTC[iTimeStampUTC]; + pTimeStampUTCBuffer[sTimeStampUTC.size()] = 0; + } + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationXSD * pXSDInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; @@ -9112,19 +9110,21 @@ LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsd(LibMCData_Machin } } -LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsdversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 * pXSDVersion) +LibMCDataResult libmcdata_machineconfigurationtype_listxsdversions(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationXSDIterator * pXSDIterator) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDVersion == nullptr) + if (pXSDIterator == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + IBase* pBaseXSDIterator(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - *pXSDVersion = pIMachineConfigurationType->GetLatestXSDVersion(); + pBaseXSDIterator = pIMachineConfigurationType->ListXSDVersions(); + *pXSDIterator = (IBase*)(pBaseXSDIterator); return LIBMCDATA_SUCCESS; } catch (ELibMCDataInterfaceException & Exception) { @@ -9138,22 +9138,48 @@ LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsdversion(LibMCData } } -LibMCDataResult libmcdata_machineconfigurationtype_findxsdbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationXSD * pXSDInstance) +LibMCDataResult libmcdata_machineconfigurationtype_getlatestxsdnumericversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 * pXSDNumericVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDUUID == nullptr) + if (pXSDNumericVersion == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + *pXSDNumericVersion = pIMachineConfigurationType->GetLatestXSDNumericVersion(); + + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCDataResult libmcdata_machineconfigurationtype_registernewxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCData_uint32 nXSDVersion, LibMCData_MachineConfigurationXSD * pXSDInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if (pXSDString == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pXSDInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sXSDUUID(pXSDUUID); + std::string sXSDString(pXSDString); IBase* pBaseXSDInstance(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseXSDInstance = pIMachineConfigurationType->FindXSDByUUID(sXSDUUID); + pBaseXSDInstance = pIMachineConfigurationType->RegisterNewXSD(sXSDString, nXSDVersion); *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCDATA_SUCCESS; @@ -9169,25 +9195,19 @@ LibMCDataResult libmcdata_machineconfigurationtype_findxsdbyuuid(LibMCData_Machi } } -LibMCDataResult libmcdata_machineconfigurationtype_createnewxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCData_uint32 nXSDVersion, const char * pDefaultConfigurationXML, LibMCData_MachineConfigurationXSD * pXSDInstance) +LibMCDataResult libmcdata_machineconfigurationtype_findxsdbynumericversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 nXSDNumericVersion, LibMCData_MachineConfigurationXSD * pXSDInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDString == nullptr) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - if (pDefaultConfigurationXML == nullptr) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pXSDInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sXSDString(pXSDString); - std::string sDefaultConfigurationXML(pDefaultConfigurationXML); IBase* pBaseXSDInstance(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseXSDInstance = pIMachineConfigurationType->CreateNewXSD(sXSDString, nXSDVersion, sDefaultConfigurationXML); + pBaseXSDInstance = pIMachineConfigurationType->FindXSDByNumericVersion(nXSDNumericVersion); *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCDATA_SUCCESS; @@ -9203,19 +9223,22 @@ LibMCDataResult libmcdata_machineconfigurationtype_createnewxsd(LibMCData_Machin } } -LibMCDataResult libmcdata_machineconfigurationtype_getxsdversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_uint32 nXSDVersion, LibMCData_MachineConfigurationXSD * pXSDInstance) +LibMCDataResult libmcdata_machineconfigurationtype_findxsdbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationXSD * pXSDInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { + if (pXSDUUID == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pXSDInstance == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + std::string sXSDUUID(pXSDUUID); IBase* pBaseXSDInstance(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseXSDInstance = pIMachineConfigurationType->GetXSDVersion(nXSDVersion); + pBaseXSDInstance = pIMachineConfigurationType->FindXSDByUUID(sXSDUUID); *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCDATA_SUCCESS; @@ -9231,7 +9254,44 @@ LibMCDataResult libmcdata_machineconfigurationtype_getxsdversion(LibMCData_Machi } } -LibMCDataResult libmcdata_machineconfigurationtype_listversions(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersionIterator * pVersionIterator) +LibMCDataResult libmcdata_machineconfigurationtype_createdefaultconfiguration(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, const char * pDefaultXML, const char * pTimeStampUTC, LibMCData_MachineConfigurationVersion * pVersionInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if (pXSDUUID == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + if (pDefaultXML == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + if (pTimeStampUTC == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + if (pVersionInstance == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + std::string sXSDUUID(pXSDUUID); + std::string sDefaultXML(pDefaultXML); + std::string sTimeStampUTC(pTimeStampUTC); + IBase* pBaseVersionInstance(nullptr); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + pBaseVersionInstance = pIMachineConfigurationType->CreateDefaultConfiguration(sXSDUUID, sDefaultXML, sTimeStampUTC); + + *pVersionInstance = (IBase*)(pBaseVersionInstance); + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCDataResult libmcdata_machineconfigurationtype_listallconfigurationversions(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersionIterator * pVersionIterator) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; @@ -9243,7 +9303,7 @@ LibMCDataResult libmcdata_machineconfigurationtype_listversions(LibMCData_Machin if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseVersionIterator = pIMachineConfigurationType->ListVersions(); + pBaseVersionIterator = pIMachineConfigurationType->ListAllConfigurationVersions(); *pVersionIterator = (IBase*)(pBaseVersionIterator); return LIBMCDATA_SUCCESS; @@ -9259,7 +9319,38 @@ LibMCDataResult libmcdata_machineconfigurationtype_listversions(LibMCData_Machin } } -LibMCDataResult libmcdata_machineconfigurationtype_findversionbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion) +LibMCDataResult libmcdata_machineconfigurationtype_listconfigurationversionsforxsd(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCData_MachineConfigurationVersionIterator * pVersionIterator) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if (pXSDUUID == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + if (pVersionIterator == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + std::string sXSDUUID(pXSDUUID); + IBase* pBaseVersionIterator(nullptr); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + pBaseVersionIterator = pIMachineConfigurationType->ListConfigurationVersionsForXSD(sXSDUUID); + + *pVersionIterator = (IBase*)(pBaseVersionIterator); + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCDataResult libmcdata_machineconfigurationtype_findconfigurationversionbyuuid(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; @@ -9274,7 +9365,7 @@ LibMCDataResult libmcdata_machineconfigurationtype_findversionbyuuid(LibMCData_M if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseVersion = pIMachineConfigurationType->FindVersionByUUID(sVersionUUID); + pBaseVersion = pIMachineConfigurationType->FindConfigurationVersionByUUID(sVersionUUID); *pVersion = (IBase*)(pBaseVersion); return LIBMCDATA_SUCCESS; @@ -9290,22 +9381,19 @@ LibMCDataResult libmcdata_machineconfigurationtype_findversionbyuuid(LibMCData_M } } -LibMCDataResult libmcdata_machineconfigurationtype_getactiveversion(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCData_MachineConfigurationVersion * pVersion) +LibMCDataResult libmcdata_machineconfigurationtype_getactiveconfigurationversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pVersionUUID == nullptr) - throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); if (pVersion == nullptr) throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); - std::string sVersionUUID(pVersionUUID); IBase* pBaseVersion(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseVersion = pIMachineConfigurationType->GetActiveVersion(sVersionUUID); + pBaseVersion = pIMachineConfigurationType->GetActiveConfigurationVersion(); *pVersion = (IBase*)(pBaseVersion); return LIBMCDATA_SUCCESS; @@ -9321,7 +9409,7 @@ LibMCDataResult libmcdata_machineconfigurationtype_getactiveversion(LibMCData_Ma } } -LibMCDataResult libmcdata_machineconfigurationtype_getlatestversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion) +LibMCDataResult libmcdata_machineconfigurationtype_getlatestconfigurationversion(LibMCData_MachineConfigurationType pMachineConfigurationType, LibMCData_MachineConfigurationVersion * pVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; @@ -9333,7 +9421,7 @@ LibMCDataResult libmcdata_machineconfigurationtype_getlatestversion(LibMCData_Ma if (!pIMachineConfigurationType) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); - pBaseVersion = pIMachineConfigurationType->GetLatestVersion(); + pBaseVersion = pIMachineConfigurationType->GetLatestConfigurationVersion(); *pVersion = (IBase*)(pBaseVersion); return LIBMCDATA_SUCCESS; @@ -9349,6 +9437,65 @@ LibMCDataResult libmcdata_machineconfigurationtype_getlatestversion(LibMCData_Ma } } +LibMCDataResult libmcdata_machineconfigurationtype_setactiveconfigurationversion(LibMCData_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if (pVersionUUID == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + std::string sVersionUUID(pVersionUUID); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + pIMachineConfigurationType->SetActiveConfigurationVersion(sVersionUUID); + + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + + +/************************************************************************************************************************* + Class implementation for MachineConfigurationTypeIterator +**************************************************************************************************************************/ +LibMCDataResult libmcdata_machineconfigurationtypeiterator_getcurrent(LibMCData_MachineConfigurationTypeIterator pMachineConfigurationTypeIterator, LibMCData_MachineConfigurationType * pInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationTypeIterator; + + try { + if (pInstance == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + IBase* pBaseInstance(nullptr); + IMachineConfigurationTypeIterator* pIMachineConfigurationTypeIterator = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationTypeIterator) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + pBaseInstance = pIMachineConfigurationTypeIterator->GetCurrent(); + + *pInstance = (IBase*)(pBaseInstance); + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + /************************************************************************************************************************* Class implementation for InstallationInformation @@ -10021,6 +10168,34 @@ LibMCDataResult libmcdata_datamodel_haslogcallback(LibMCData_DataModel pDataMode } } +LibMCDataResult libmcdata_datamodel_listregisteredconfigurationtypes(LibMCData_DataModel pDataModel, LibMCData_MachineConfigurationTypeIterator * pConfigurationTypeIterator) +{ + IBase* pIBaseClass = (IBase *)pDataModel; + + try { + if (pConfigurationTypeIterator == nullptr) + throw ELibMCDataInterfaceException (LIBMCDATA_ERROR_INVALIDPARAM); + IBase* pBaseConfigurationTypeIterator(nullptr); + IDataModel* pIDataModel = dynamic_cast(pIBaseClass); + if (!pIDataModel) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + pBaseConfigurationTypeIterator = pIDataModel->ListRegisteredConfigurationTypes(); + + *pConfigurationTypeIterator = (IBase*)(pBaseConfigurationTypeIterator); + return LIBMCDATA_SUCCESS; + } + catch (ELibMCDataInterfaceException & Exception) { + return handleLibMCDataException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + LibMCDataResult libmcdata_datamodel_findconfigurationtypebyschema(LibMCData_DataModel pDataModel, const char * pSchemaType, LibMCData_MachineConfigurationType * pIteratorInstance) { IBase* pIBaseClass = (IBase *)pDataModel; @@ -10609,60 +10784,70 @@ LibMCDataResult LibMCData::Impl::LibMCData_GetProcAddress (const char * pProcNam *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getversionuuid; if (sProcName == "libmcdata_machineconfigurationversion_getxsduuid") *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getxsduuid; - if (sProcName == "libmcdata_machineconfigurationversion_gettypeuuid") - *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_gettypeuuid; + if (sProcName == "libmcdata_machineconfigurationversion_getnumericversion") + *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getnumericversion; if (sProcName == "libmcdata_machineconfigurationversion_getparentuuid") *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getparentuuid; - if (sProcName == "libmcdata_machineconfigurationversion_getschematype") - *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getschematype; - if (sProcName == "libmcdata_machineconfigurationversion_getxsdversion") - *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getxsdversion; - if (sProcName == "libmcdata_machineconfigurationversion_getxsdstring") - *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getxsdstring; if (sProcName == "libmcdata_machineconfigurationversion_getconfigurationxmlstring") *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getconfigurationxmlstring; + if (sProcName == "libmcdata_machineconfigurationversion_getuseruuid") + *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_getuseruuid; + if (sProcName == "libmcdata_machineconfigurationversion_gettimestamp") + *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_gettimestamp; if (sProcName == "libmcdata_machineconfigurationversion_createnewversion") *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_createnewversion; if (sProcName == "libmcdata_machineconfigurationversion_migratetonewxsd") *ppProcAddress = (void*) &libmcdata_machineconfigurationversion_migratetonewxsd; - if (sProcName == "libmcdata_machineconfigurationversioniterator_getcurrentversion") - *ppProcAddress = (void*) &libmcdata_machineconfigurationversioniterator_getcurrentversion; + if (sProcName == "libmcdata_machineconfigurationversioniterator_getcurrent") + *ppProcAddress = (void*) &libmcdata_machineconfigurationversioniterator_getcurrent; if (sProcName == "libmcdata_machineconfigurationxsd_getuuid") *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_getuuid; if (sProcName == "libmcdata_machineconfigurationxsd_gettypeuuid") *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_gettypeuuid; - if (sProcName == "libmcdata_machineconfigurationxsd_getschematype") - *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_getschematype; if (sProcName == "libmcdata_machineconfigurationxsd_getxsdversion") *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_getxsdversion; if (sProcName == "libmcdata_machineconfigurationxsd_getxsdstring") *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_getxsdstring; - if (sProcName == "libmcdata_machineconfigurationxsd_listversions") - *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_listversions; + if (sProcName == "libmcdata_machineconfigurationxsd_gettimestamp") + *ppProcAddress = (void*) &libmcdata_machineconfigurationxsd_gettimestamp; + if (sProcName == "libmcdata_machineconfigurationxsditerator_getcurrent") + *ppProcAddress = (void*) &libmcdata_machineconfigurationxsditerator_getcurrent; if (sProcName == "libmcdata_machineconfigurationtype_getuuid") *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getuuid; if (sProcName == "libmcdata_machineconfigurationtype_getname") *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getname; if (sProcName == "libmcdata_machineconfigurationtype_getschematype") *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getschematype; + if (sProcName == "libmcdata_machineconfigurationtype_gettimestamp") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_gettimestamp; if (sProcName == "libmcdata_machineconfigurationtype_getlatestxsd") *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getlatestxsd; - if (sProcName == "libmcdata_machineconfigurationtype_getlatestxsdversion") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getlatestxsdversion; + if (sProcName == "libmcdata_machineconfigurationtype_listxsdversions") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_listxsdversions; + if (sProcName == "libmcdata_machineconfigurationtype_getlatestxsdnumericversion") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getlatestxsdnumericversion; + if (sProcName == "libmcdata_machineconfigurationtype_registernewxsd") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_registernewxsd; + if (sProcName == "libmcdata_machineconfigurationtype_findxsdbynumericversion") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_findxsdbynumericversion; if (sProcName == "libmcdata_machineconfigurationtype_findxsdbyuuid") *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_findxsdbyuuid; - if (sProcName == "libmcdata_machineconfigurationtype_createnewxsd") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_createnewxsd; - if (sProcName == "libmcdata_machineconfigurationtype_getxsdversion") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getxsdversion; - if (sProcName == "libmcdata_machineconfigurationtype_listversions") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_listversions; - if (sProcName == "libmcdata_machineconfigurationtype_findversionbyuuid") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_findversionbyuuid; - if (sProcName == "libmcdata_machineconfigurationtype_getactiveversion") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getactiveversion; - if (sProcName == "libmcdata_machineconfigurationtype_getlatestversion") - *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getlatestversion; + if (sProcName == "libmcdata_machineconfigurationtype_createdefaultconfiguration") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_createdefaultconfiguration; + if (sProcName == "libmcdata_machineconfigurationtype_listallconfigurationversions") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_listallconfigurationversions; + if (sProcName == "libmcdata_machineconfigurationtype_listconfigurationversionsforxsd") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_listconfigurationversionsforxsd; + if (sProcName == "libmcdata_machineconfigurationtype_findconfigurationversionbyuuid") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_findconfigurationversionbyuuid; + if (sProcName == "libmcdata_machineconfigurationtype_getactiveconfigurationversion") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getactiveconfigurationversion; + if (sProcName == "libmcdata_machineconfigurationtype_getlatestconfigurationversion") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_getlatestconfigurationversion; + if (sProcName == "libmcdata_machineconfigurationtype_setactiveconfigurationversion") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtype_setactiveconfigurationversion; + if (sProcName == "libmcdata_machineconfigurationtypeiterator_getcurrent") + *ppProcAddress = (void*) &libmcdata_machineconfigurationtypeiterator_getcurrent; if (sProcName == "libmcdata_installationinformation_getinstallationuuid") *ppProcAddress = (void*) &libmcdata_installationinformation_getinstallationuuid; if (sProcName == "libmcdata_installationinformation_getinstallationsecret") @@ -10703,6 +10888,8 @@ LibMCDataResult LibMCData::Impl::LibMCData_GetProcAddress (const char * pProcNam *ppProcAddress = (void*) &libmcdata_datamodel_clearlogcallback; if (sProcName == "libmcdata_datamodel_haslogcallback") *ppProcAddress = (void*) &libmcdata_datamodel_haslogcallback; + if (sProcName == "libmcdata_datamodel_listregisteredconfigurationtypes") + *ppProcAddress = (void*) &libmcdata_datamodel_listregisteredconfigurationtypes; if (sProcName == "libmcdata_datamodel_findconfigurationtypebyschema") *ppProcAddress = (void*) &libmcdata_datamodel_findconfigurationtypebyschema; if (sProcName == "libmcdata_datamodel_findconfigurationtypebyuuid") diff --git a/Framework/InterfacesCore/libmcdata_types.hpp b/Framework/InterfacesCore/libmcdata_types.hpp index 66b3142e..f0aa60c7 100644 --- a/Framework/InterfacesCore/libmcdata_types.hpp +++ b/Framework/InterfacesCore/libmcdata_types.hpp @@ -465,6 +465,12 @@ typedef void * LibMCData_pvoid; #define LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE 438 /** Could not find machine configuration type. */ #define LIBMCDATA_ERROR_INVALIDSTORAGESTREAMSIZE 439 /** Storage stream size for build is zero. */ #define LIBMCDATA_ERROR_COULDNOTUPDATEBUILDNAME 440 /** Could not update build name */ +#define LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID 441 /** Invalid machine configuration type UUID. */ +#define LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING 442 /** Machine configuration version is not incrementing. */ +#define LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION 443 /** Could not get latest machine configuration XSD version. */ +#define LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID 444 /** Could not find latest machine configuration XSD by UUID. */ +#define LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID 445 /** Could not find latest machine configuration version by UUID. */ +#define LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH 446 /** Machine configuration mismatch. */ /************************************************************************************************************************* Error strings for LibMCData @@ -842,6 +848,12 @@ inline const char * LIBMCDATA_GETERRORSTRING (LibMCDataResult nErrorCode) { case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE: return "Could not find machine configuration type."; case LIBMCDATA_ERROR_INVALIDSTORAGESTREAMSIZE: return "Storage stream size for build is zero."; case LIBMCDATA_ERROR_COULDNOTUPDATEBUILDNAME: return "Could not update build name"; + case LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID: return "Invalid machine configuration type UUID."; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING: return "Machine configuration version is not incrementing."; + case LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION: return "Could not get latest machine configuration XSD version."; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID: return "Could not find latest machine configuration XSD by UUID."; + case LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID: return "Could not find latest machine configuration version by UUID."; + case LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH: return "Machine configuration mismatch."; default: return "unknown error"; } } @@ -879,7 +891,9 @@ typedef LibMCDataHandle LibMCData_PersistencyHandler; typedef LibMCDataHandle LibMCData_MachineConfigurationVersion; typedef LibMCDataHandle LibMCData_MachineConfigurationVersionIterator; typedef LibMCDataHandle LibMCData_MachineConfigurationXSD; +typedef LibMCDataHandle LibMCData_MachineConfigurationXSDIterator; typedef LibMCDataHandle LibMCData_MachineConfigurationType; +typedef LibMCDataHandle LibMCData_MachineConfigurationTypeIterator; typedef LibMCDataHandle LibMCData_InstallationInformation; typedef LibMCDataHandle LibMCData_DataModel; diff --git a/Framework/InterfacesCore/libmcenv_abi.hpp b/Framework/InterfacesCore/libmcenv_abi.hpp index a9f1633f..c1ba748e 100644 --- a/Framework/InterfacesCore/libmcenv_abi.hpp +++ b/Framework/InterfacesCore/libmcenv_abi.hpp @@ -8668,222 +8668,430 @@ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_usermanagementhandler_setuserpasswordb LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_usermanagementhandler_getactiveusers(LibMCEnv_UserManagementHandler pUserManagementHandler, LibMCEnv_UserDetailList * pListInstance); /************************************************************************************************************************* - Class definition for MachineConfigurationVersion + Class definition for MachineConfigurationXSD **************************************************************************************************************************/ /** -* Returns the schema type. +* Returns the UUID of the XSD. * -* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) -* @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema Type String., may be NULL +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pXSDUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXSDUUIDBuffer - buffer of UUID of the configuration XSD., may be NULL +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationxsd_getuuid(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nXSDUUIDBufferSize, LibMCEnv_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); + +/** +* Returns the UUID of the associated configuration type. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeUUIDBuffer - buffer of UUID of the configuration type., may be NULL +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationxsd_gettypeuuid(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nTypeUUIDBufferSize, LibMCEnv_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); + +/** +* Returns the version number of the XSD. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[out] pXSDVersion - Returns the XSD version. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationxsd_getxsdversion(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, LibMCEnv_uint32 * pXSDVersion); + +/** +* Returns the XSD content as string. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) +* @param[out] pXSDStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXSDStringBuffer - buffer of XSD String., may be NULL +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationxsd_getxsdstring(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nXSDStringBufferSize, LibMCEnv_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); + +/** +* Returns the creation timestamp of the XSD version. +* +* @param[in] pMachineConfigurationXSD - MachineConfigurationXSD instance. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of XSD creation., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getschematype(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationxsd_gettimestamp(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/************************************************************************************************************************* + Class definition for MachineConfigurationXSDIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationXSD instance. +* +* @param[in] pMachineConfigurationXSDIterator - MachineConfigurationXSDIterator instance. +* @param[out] pInstance - Currently selected configuration XSD instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationxsditerator_getcurrent(LibMCEnv_MachineConfigurationXSDIterator pMachineConfigurationXSDIterator, LibMCEnv_MachineConfigurationXSD * pInstance); + +/************************************************************************************************************************* + Class definition for MachineConfigurationVersion +**************************************************************************************************************************/ /** -* Returns the Name the type. +* Returns the UUID of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of Type Name., may be NULL +* @param[in] nVersionUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pVersionUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pVersionUUIDBuffer - buffer of UUID of the configuration version., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_gettypename(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getversionuuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nVersionUUIDBufferSize, LibMCEnv_uint32* pVersionUUIDNeededChars, char * pVersionUUIDBuffer); /** -* Returns the UUID the type. +* Returns the UUID of the XSD used by this configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of Type UUID., may be NULL +* @param[in] nXSDUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pXSDUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pXSDUUIDBuffer - buffer of UUID of the configuration XSD., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_gettypeuuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nUUIDBufferSize, LibMCEnv_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getxsduuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXSDUUIDBufferSize, LibMCEnv_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer); /** -* Returns the XSD Version Number of this configuration. +* Returns the numeric version of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[out] pXSDVersion - Returns XSD version number. +* @param[out] pConfigurationNumericVersion - Returns the configuration numeric version. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getxsdversion(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_uint32 * pXSDVersion); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getnumericversion(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_uint32 * pConfigurationNumericVersion); /** -* Returns the XSD String that this configuration uses. +* Returns the UUID of the parent version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[in] nXSDStringBufferSize - size of the buffer (including trailing 0) -* @param[out] pXSDStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXSDStringBuffer - buffer of Returns XSD string., may be NULL +* @param[in] nParentUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pParentUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pParentUUIDBuffer - buffer of UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getxsdstring(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXSDStringBufferSize, LibMCEnv_uint32* pXSDStringNeededChars, char * pXSDStringBuffer); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getparentuuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nParentUUIDBufferSize, LibMCEnv_uint32* pParentUUIDNeededChars, char * pParentUUIDBuffer); /** -* Returns the configuration as XML String. +* Returns the configuration XML content as string. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. * @param[in] nXMLStringBufferSize - size of the buffer (including trailing 0) * @param[out] pXMLStringNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pXMLStringBuffer - buffer of Returns XML string., may be NULL +* @param[out] pXMLStringBuffer - buffer of XML String., may be NULL * @return error code or 0 (success) */ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmlstring(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXMLStringBufferSize, LibMCEnv_uint32* pXMLStringNeededChars, char * pXMLStringBuffer); /** -* Returns the configuration as XML Document class. +* Returns the User UUID. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. -* @param[out] pDocumentInstance - Returns XML document. +* @param[in] nUserUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pUserUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pUserUUIDBuffer - buffer of UUID of the User., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmldocument(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_XMLDocument * pDocumentInstance); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_getuseruuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nUserUUIDBufferSize, LibMCEnv_uint32* pUserUUIDNeededChars, char * pUserUUIDBuffer); /** -* Makes the current configuration the active one. +* Returns the creation timestamp of the configuration version. * * @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of creation., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_makeactive(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_gettimestamp(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); + +/** +* Creates a new configuration version from this one with the same XSD. +* +* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. +* @param[in] pXMLString - New XML Configuration String. MUST conform to current XSD. +* @param[in] pUserUUID - User UUID for logging the user who initiated the change. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_createnewversion(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, LibMCEnv_MachineConfigurationVersion * pCurrentInstance); + +/** +* Creates a new configuration version from this one but with a different XSD. +* +* @param[in] pMachineConfigurationVersion - MachineConfigurationVersion instance. +* @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. +* @param[in] pXMLString - New XML Configuration String. MUST conform to new XSD. +* @param[in] pUserUUID - User UUID for logging the user who initiated the change. +* @param[out] pCurrentInstance - Returns the newly created MachineConfigurationVersion instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversion_migratetonewxsd(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, LibMCEnv_MachineConfigurationVersion * pCurrentInstance); + +/************************************************************************************************************************* + Class definition for MachineConfigurationVersionIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationVersion instance. +* +* @param[in] pMachineConfigurationVersionIterator - MachineConfigurationVersionIterator instance. +* @param[out] pInstance - Currently selected configuration version instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationversioniterator_getcurrent(LibMCEnv_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCEnv_MachineConfigurationVersion * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationType **************************************************************************************************************************/ /** -* Returns the schema type. +* Returns the UUID of the configuration type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nTypeUUIDBufferSize - size of the buffer (including trailing 0) +* @param[out] pTypeUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTypeUUIDBuffer - buffer of UUID of the configuration type., may be NULL +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nTypeUUIDBufferSize, LibMCEnv_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer); + +/** +* Returns the name of the configuration type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nNameBufferSize - size of the buffer (including trailing 0) +* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pNameBuffer - buffer of Name of the configuration type., may be NULL +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getname(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer); + +/** +* Returns the schema type string of the configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. * @param[in] nSchemaTypeBufferSize - size of the buffer (including trailing 0) * @param[out] pSchemaTypeNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pSchemaTypeBuffer - buffer of Schema Type String., may be NULL +* @param[out] pSchemaTypeBuffer - buffer of Schema type of the configuration type., may be NULL * @return error code or 0 (success) */ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getschematype(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer); /** -* Returns the Name the type. +* Returns the creation timestamp of the type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] nNameBufferSize - size of the buffer (including trailing 0) -* @param[out] pNameNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pNameBuffer - buffer of Type Name., may be NULL +* @param[in] nTimeStampUTCBufferSize - size of the buffer (including trailing 0) +* @param[out] pTimeStampUTCNeededChars - will be filled with the count of the written bytes, or needed buffer size. +* @param[out] pTimeStampUTCBuffer - buffer of UTC timestamp of Type creation., may be NULL * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_gettypename(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_gettimestamp(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer); /** -* Returns the UUID the type. +* Returns the latest XSD registered for this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] nUUIDBufferSize - size of the buffer (including trailing 0) -* @param[out] pUUIDNeededChars - will be filled with the count of the written bytes, or needed buffer size. -* @param[out] pUUIDBuffer - buffer of Type UUID., may be NULL +* @param[out] pXSDInstance - Latest XSD of the configuration type. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_gettypeuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nUUIDBufferSize, LibMCEnv_uint32* pUUIDNeededChars, char * pUUIDBuffer); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationXSD * pXSDInstance); /** -* Returns the latest Machine Configuration XSD Version. +* Returns all XSDs associated with this configuration type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pXSDVersion - Returns the latest XSD version, or 0 if no XSD exists. +* @param[out] pXSDIterator - List of XSDs. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsdversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 * pXSDVersion); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_listxsdversions(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationXSDIterator * pXSDIterator); /** -* Registers a new configuration XSD. +* Returns the version number of the latest XSD for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDString - XSD String of the version. MUST be incremental. -* @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. -* @param[in] pDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. +* @param[out] pXSDNumericVersion - Latest XSD version number, or 0 if none exist. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_registerconfigurationxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCEnv_uint32 nXSDVersion, const char * pDefaultConfigurationXML); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsdnumericversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 * pXSDNumericVersion); /** -* Registers a new configuration XSD from machine resource files. +* Registers a new XSD Version. Fails if version already exists or is not incrementing. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] pXSDResourceName - Resource identifier of the XSD file of the version. MUST be incremental. +* @param[in] pXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. -* @param[in] pDefaultConfigurationResourceName - Resource identifier of the configuration XML to use for this XSD. MUST conform to XSD in question. +* @param[out] pXSDInstance - Returns the new XSD of the configuration type. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_registernewxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCEnv_uint32 nXSDVersion, LibMCEnv_MachineConfigurationXSD * pXSDInstance); + +/** +* Finds a specific XSD of this type by its Numeric Version Number. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] nXSDNumericVersion - Requested version number. +* @param[out] pXSDInstance - XSD instance if exists. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_findxsdbynumericversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 nXSDNumericVersion, LibMCEnv_MachineConfigurationXSD * pXSDInstance); + +/** +* Finds a specific XSD of this type by its UUID. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD. +* @param[out] pXSDInstance - Matching XSD instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_findxsdbyuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCEnv_MachineConfigurationXSD * pXSDInstance); + +/** +* Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD to base the default configuration on. +* @param[in] pDefaultXML - Configuration XML string conforming to the given XSD. +* @param[in] pTimeStampUTC - Creation timestamp in UTC. +* @param[out] pVersionInstance - Returns the created default configuration version. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_createdefaultconfiguration(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, const char * pDefaultXML, const char * pTimeStampUTC, LibMCEnv_MachineConfigurationVersion * pVersionInstance); + +/** +* Lists all configuration versions registered under this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_listallconfigurationversions(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Lists all configuration versions for specific XSD. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pXSDUUID - UUID of the XSD . +* @param[out] pVersionIterator - List of configuration versions. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_listconfigurationversionsforxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCEnv_MachineConfigurationVersionIterator * pVersionIterator); + +/** +* Finds a specific configuration version by UUID. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pVersionUUID - UUID of the configuration version. +* @param[out] pVersion - Matching configuration version if found. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDResourceName, LibMCEnv_uint32 nXSDVersion, const char * pDefaultConfigurationResourceName); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_findconfigurationversionbyuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCEnv_MachineConfigurationVersion * pVersion); /** -* Returns the latest Machine Configuration of this configuration type. Returns the default XML of the newest XSD if no configuration exists. +* Returns the currently active configuration version for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[out] pVersion - Active version instance or null. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getlatestconfiguration(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getactiveconfigurationversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pVersion); /** -* Returns the active Machine Configuration of this configuration type. +* Returns the most recently created version for this type. * * @param[in] pMachineConfigurationType - MachineConfigurationType instance. -* @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[out] pVersion - Latest configuration version or null. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getactiveconfiguration(LibMCEnv_MachineConfigurationType pMachineConfigurationType, bool bFallBackToDefault, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_getlatestconfigurationversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pVersion); + +/** +* Sets the active configuration version for this type. +* +* @param[in] pMachineConfigurationType - MachineConfigurationType instance. +* @param[in] pVersionUUID - UUID of the version to set as active. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtype_setactiveconfigurationversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID); + +/************************************************************************************************************************* + Class definition for MachineConfigurationTypeIterator +**************************************************************************************************************************/ + +/** +* Returns the current MachineConfigurationType instance. +* +* @param[in] pMachineConfigurationTypeIterator - MachineConfigurationTypeIterator instance. +* @param[out] pInstance - Currently selected configuration type instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationtypeiterator_getcurrent(LibMCEnv_MachineConfigurationTypeIterator pMachineConfigurationTypeIterator, LibMCEnv_MachineConfigurationType * pInstance); /************************************************************************************************************************* Class definition for MachineConfigurationHandler **************************************************************************************************************************/ /** -* Registers a new machine configuration type, or returns the unique existing one with the same schema type. +* Registers a new configuration type or returns existing one if already registered. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. MUST not be empty. -* @param[in] pName - Type Name. MUST not be empty. If the configuration type already exists, the name will be checked for identity! -* @param[out] pTypeInstance - Instance of machine configuration type. +* @param[in] pSchemaType - Schema type string. MUST not be empty. +* @param[in] pName - Display name. MUST not be empty. Must match existing name if type exists. +* @param[out] pTypeInstance - Instance of the configuration type. * @return error code or 0 (success) */ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_registermachineconfigurationtype(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, const char * pName, LibMCEnv_MachineConfigurationType * pTypeInstance); /** -* Checks if a certain configuration schema type has been registered. +* Checks if a schema type is already registered. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. MUST not be empty. -* @param[out] pHasBeenRegistered - Returns true, if the system knows about a configuration schema type. +* @param[in] pSchemaType - Schema type string. +* @param[out] pHasBeenRegistered - True if known, false otherwise. * @return error code or 0 (success) */ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_hasmachineconfigurationtype(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, bool * pHasBeenRegistered); /** -* Returns the latest Machine Configuration for a specific configuration type. Returns the default XML of the newest XSD if no configuration exists. +* Returns all configuration types registered in the system. +* +* @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. +* @param[out] pTypeIterator - Iterator over configuration types. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_listregisteredtypes(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, LibMCEnv_MachineConfigurationTypeIterator * pTypeIterator); + +/** +* Returns configuration type by UUID. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. Fails if configuration schema type is not known. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[in] pTypeUUID - UUID of the configuration type. +* @param[out] pTypeInstance - Configuration type if found. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_getlatestconfiguration(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pTypeUUID, LibMCEnv_MachineConfigurationType * pTypeInstance); /** -* Returns the active Machine Configuration for a specific configuration type. +* Returns configuration type by Schema Type. * * @param[in] pMachineConfigurationHandler - MachineConfigurationHandler instance. -* @param[in] pSchemaType - Schema Type String. Fails if configuration schema type is not known. -* @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. -* @param[out] pConfigurationInstance - Configuration Version instance. +* @param[in] pSchemaType - Schema Type of the configuration type. +* @param[out] pTypeInstance - Configuration type if found. * @return error code or 0 (success) */ -LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_getactiveconfiguration(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, bool bFallBackToDefault, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance); +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_machineconfigurationhandler_findconfigurationtypebyschema(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, LibMCEnv_MachineConfigurationType * pTypeInstance); /************************************************************************************************************************* Class definition for StateEnvironment @@ -10653,6 +10861,15 @@ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_uienvironment_getexternaleventparamete */ LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_uienvironment_getexternaleventresults(LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_JSONObject * pParameterValue); +/** +* creates a machine configuration handler, dealing with all persistent machine settings that the user will store in the local database. +* +* @param[in] pUIEnvironment - UIEnvironment instance. +* @param[out] pMachineConfigurationHandlerInstance - MachineConfigurationHandler instance. +* @return error code or 0 (success) +*/ +LIBMCENV_DECLSPEC LibMCEnvResult libmcenv_uienvironment_createmachineconfigurationhandler(LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_MachineConfigurationHandler * pMachineConfigurationHandlerInstance); + /************************************************************************************************************************* Global functions **************************************************************************************************************************/ diff --git a/Framework/InterfacesCore/libmcenv_interfaces.hpp b/Framework/InterfacesCore/libmcenv_interfaces.hpp index cc440847..900d0a9f 100644 --- a/Framework/InterfacesCore/libmcenv_interfaces.hpp +++ b/Framework/InterfacesCore/libmcenv_interfaces.hpp @@ -125,8 +125,12 @@ class ILogEntryList; class IJournalHandler; class IUserDetailList; class IUserManagementHandler; +class IMachineConfigurationXSD; +class IMachineConfigurationXSDIterator; class IMachineConfigurationVersion; +class IMachineConfigurationVersionIterator; class IMachineConfigurationType; +class IMachineConfigurationTypeIterator; class IMachineConfigurationHandler; class IStateEnvironment; class IUIItem; @@ -6734,6 +6738,64 @@ class IUserManagementHandler : public virtual IBase { typedef IBaseSharedPtr PIUserManagementHandler; +/************************************************************************************************************************* + Class interface for MachineConfigurationXSD +**************************************************************************************************************************/ + +class IMachineConfigurationXSD : public virtual IBase { +public: + /** + * IMachineConfigurationXSD::GetUUID - Returns the UUID of the XSD. + * @return UUID of the configuration XSD. + */ + virtual std::string GetUUID() = 0; + + /** + * IMachineConfigurationXSD::GetTypeUUID - Returns the UUID of the associated configuration type. + * @return UUID of the configuration type. + */ + virtual std::string GetTypeUUID() = 0; + + /** + * IMachineConfigurationXSD::GetXSDVersion - Returns the version number of the XSD. + * @return Returns the XSD version. + */ + virtual LibMCEnv_uint32 GetXSDVersion() = 0; + + /** + * IMachineConfigurationXSD::GetXSDString - Returns the XSD content as string. + * @return XSD String. + */ + virtual std::string GetXSDString() = 0; + + /** + * IMachineConfigurationXSD::GetTimestamp - Returns the creation timestamp of the XSD version. + * @return UTC timestamp of XSD creation. + */ + virtual std::string GetTimestamp() = 0; + +}; + +typedef IBaseSharedPtr PIMachineConfigurationXSD; + + +/************************************************************************************************************************* + Class interface for MachineConfigurationXSDIterator +**************************************************************************************************************************/ + +class IMachineConfigurationXSDIterator : public virtual IIterator { +public: + /** + * IMachineConfigurationXSDIterator::GetCurrent - Returns the current MachineConfigurationXSD instance. + * @return Currently selected configuration XSD instance. + */ + virtual IMachineConfigurationXSD * GetCurrent() = 0; + +}; + +typedef IBaseSharedPtr PIMachineConfigurationXSDIterator; + + /************************************************************************************************************************* Class interface for MachineConfigurationVersion **************************************************************************************************************************/ @@ -6741,57 +6803,86 @@ typedef IBaseSharedPtr PIUserManagementHandler; class IMachineConfigurationVersion : public virtual IBase { public: /** - * IMachineConfigurationVersion::GetSchemaType - Returns the schema type. - * @return Schema Type String. + * IMachineConfigurationVersion::GetVersionUUID - Returns the UUID of the configuration version. + * @return UUID of the configuration version. */ - virtual std::string GetSchemaType() = 0; + virtual std::string GetVersionUUID() = 0; /** - * IMachineConfigurationVersion::GetTypeName - Returns the Name the type. - * @return Type Name. + * IMachineConfigurationVersion::GetXSDUUID - Returns the UUID of the XSD used by this configuration version. + * @return UUID of the configuration XSD. */ - virtual std::string GetTypeName() = 0; + virtual std::string GetXSDUUID() = 0; /** - * IMachineConfigurationVersion::GetTypeUUID - Returns the UUID the type. - * @return Type UUID. + * IMachineConfigurationVersion::GetNumericVersion - Returns the numeric version of the configuration version. + * @return Returns the configuration numeric version. */ - virtual std::string GetTypeUUID() = 0; + virtual LibMCEnv_uint32 GetNumericVersion() = 0; /** - * IMachineConfigurationVersion::GetXSDVersion - Returns the XSD Version Number of this configuration. - * @return Returns XSD version number. + * IMachineConfigurationVersion::GetParentUUID - Returns the UUID of the parent version. + * @return UUID of the configuration version that is the parent of this version. Returns 00000000-0000-0000-0000-000000000000 if this is the default version. */ - virtual LibMCEnv_uint32 GetXSDVersion() = 0; + virtual std::string GetParentUUID() = 0; /** - * IMachineConfigurationVersion::GetXSDString - Returns the XSD String that this configuration uses. - * @return Returns XSD string. + * IMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration XML content as string. + * @return XML String. */ - virtual std::string GetXSDString() = 0; + virtual std::string GetConfigurationXMLString() = 0; /** - * IMachineConfigurationVersion::GetConfigurationXMLString - Returns the configuration as XML String. - * @return Returns XML string. + * IMachineConfigurationVersion::GetUserUUID - Returns the User UUID. + * @return UUID of the User. */ - virtual std::string GetConfigurationXMLString() = 0; + virtual std::string GetUserUUID() = 0; /** - * IMachineConfigurationVersion::GetConfigurationXMLDocument - Returns the configuration as XML Document class. - * @return Returns XML document. + * IMachineConfigurationVersion::GetTimestamp - Returns the creation timestamp of the configuration version. + * @return UTC timestamp of creation. */ - virtual IXMLDocument * GetConfigurationXMLDocument() = 0; + virtual std::string GetTimestamp() = 0; /** - * IMachineConfigurationVersion::MakeActive - Makes the current configuration the active one. + * IMachineConfigurationVersion::CreateNewVersion - Creates a new configuration version from this one with the same XSD. + * @param[in] sXMLString - New XML Configuration String. MUST conform to current XSD. + * @param[in] sUserUUID - User UUID for logging the user who initiated the change. + * @return Returns the newly created MachineConfigurationVersion instance. */ - virtual void MakeActive() = 0; + virtual IMachineConfigurationVersion * CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID) = 0; + + /** + * IMachineConfigurationVersion::MigrateToNewXSD - Creates a new configuration version from this one but with a different XSD. + * @param[in] pNewXSD - New XSD to use. MUST be of the same type as the current. MUST have an increased version number. + * @param[in] sXMLString - New XML Configuration String. MUST conform to new XSD. + * @param[in] sUserUUID - User UUID for logging the user who initiated the change. + * @return Returns the newly created MachineConfigurationVersion instance. + */ + virtual IMachineConfigurationVersion * MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID) = 0; }; typedef IBaseSharedPtr PIMachineConfigurationVersion; +/************************************************************************************************************************* + Class interface for MachineConfigurationVersionIterator +**************************************************************************************************************************/ + +class IMachineConfigurationVersionIterator : public virtual IIterator { +public: + /** + * IMachineConfigurationVersionIterator::GetCurrent - Returns the current MachineConfigurationVersion instance. + * @return Currently selected configuration version instance. + */ + virtual IMachineConfigurationVersion * GetCurrent() = 0; + +}; + +typedef IBaseSharedPtr PIMachineConfigurationVersionIterator; + + /************************************************************************************************************************* Class interface for MachineConfigurationType **************************************************************************************************************************/ @@ -6799,63 +6890,138 @@ typedef IBaseSharedPtr PIMachineConfigurationVersi class IMachineConfigurationType : public virtual IBase { public: /** - * IMachineConfigurationType::GetSchemaType - Returns the schema type. - * @return Schema Type String. + * IMachineConfigurationType::GetUUID - Returns the UUID of the configuration type. + * @return UUID of the configuration type. + */ + virtual std::string GetUUID() = 0; + + /** + * IMachineConfigurationType::GetName - Returns the name of the configuration type. + * @return Name of the configuration type. + */ + virtual std::string GetName() = 0; + + /** + * IMachineConfigurationType::GetSchemaType - Returns the schema type string of the configuration type. + * @return Schema type of the configuration type. */ virtual std::string GetSchemaType() = 0; /** - * IMachineConfigurationType::GetTypeName - Returns the Name the type. - * @return Type Name. + * IMachineConfigurationType::GetTimestamp - Returns the creation timestamp of the type. + * @return UTC timestamp of Type creation. */ - virtual std::string GetTypeName() = 0; + virtual std::string GetTimestamp() = 0; /** - * IMachineConfigurationType::GetTypeUUID - Returns the UUID the type. - * @return Type UUID. + * IMachineConfigurationType::GetLatestXSD - Returns the latest XSD registered for this configuration type. + * @return Latest XSD of the configuration type. */ - virtual std::string GetTypeUUID() = 0; + virtual IMachineConfigurationXSD * GetLatestXSD() = 0; /** - * IMachineConfigurationType::GetLatestXSDVersion - Returns the latest Machine Configuration XSD Version. - * @return Returns the latest XSD version, or 0 if no XSD exists. + * IMachineConfigurationType::ListXSDVersions - Returns all XSDs associated with this configuration type. + * @return List of XSDs. */ - virtual LibMCEnv_uint32 GetLatestXSDVersion() = 0; + virtual IMachineConfigurationXSDIterator * ListXSDVersions() = 0; /** - * IMachineConfigurationType::RegisterConfigurationXSD - Registers a new configuration XSD. - * @param[in] sXSDString - XSD String of the version. MUST be incremental. - * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. - * @param[in] sDefaultConfigurationXML - Default configuration XML to use for this XSD. MUST conform to XSD in question. + * IMachineConfigurationType::GetLatestXSDNumericVersion - Returns the version number of the latest XSD for this type. + * @return Latest XSD version number, or 0 if none exist. */ - virtual void RegisterConfigurationXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) = 0; + virtual LibMCEnv_uint32 GetLatestXSDNumericVersion() = 0; /** - * IMachineConfigurationType::RegisterConfigurationXSDFromResource - Registers a new configuration XSD from machine resource files. - * @param[in] sXSDResourceName - Resource identifier of the XSD file of the version. MUST be incremental. + * IMachineConfigurationType::RegisterNewXSD - Registers a new XSD Version. Fails if version already exists or is not incrementing. + * @param[in] sXSDString - XSD String of the version. MUST be a valid schema of this type. * @param[in] nXSDVersion - New Version to add. MUST be larger than GetLatestXSDVersion. - * @param[in] sDefaultConfigurationResourceName - Resource identifier of the configuration XML to use for this XSD. MUST conform to XSD in question. + * @return Returns the new XSD of the configuration type. + */ + virtual IMachineConfigurationXSD * RegisterNewXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion) = 0; + + /** + * IMachineConfigurationType::FindXSDByNumericVersion - Finds a specific XSD of this type by its Numeric Version Number. + * @param[in] nXSDNumericVersion - Requested version number. + * @return XSD instance if exists. + */ + virtual IMachineConfigurationXSD * FindXSDByNumericVersion(const LibMCEnv_uint32 nXSDNumericVersion) = 0; + + /** + * IMachineConfigurationType::FindXSDByUUID - Finds a specific XSD of this type by its UUID. + * @param[in] sXSDUUID - UUID of the XSD. + * @return Matching XSD instance. + */ + virtual IMachineConfigurationXSD * FindXSDByUUID(const std::string & sXSDUUID) = 0; + + /** + * IMachineConfigurationType::CreateDefaultConfiguration - Creates the default configuration for a given XSD version. Fails if a configuration for this XSD already exists. + * @param[in] sXSDUUID - UUID of the XSD to base the default configuration on. + * @param[in] sDefaultXML - Configuration XML string conforming to the given XSD. + * @param[in] sTimeStampUTC - Creation timestamp in UTC. + * @return Returns the created default configuration version. + */ + virtual IMachineConfigurationVersion * CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC) = 0; + + /** + * IMachineConfigurationType::ListAllConfigurationVersions - Lists all configuration versions registered under this type. + * @return List of configuration versions. + */ + virtual IMachineConfigurationVersionIterator * ListAllConfigurationVersions() = 0; + + /** + * IMachineConfigurationType::ListConfigurationVersionsForXSD - Lists all configuration versions for specific XSD. + * @param[in] sXSDUUID - UUID of the XSD . + * @return List of configuration versions. + */ + virtual IMachineConfigurationVersionIterator * ListConfigurationVersionsForXSD(const std::string & sXSDUUID) = 0; + + /** + * IMachineConfigurationType::FindConfigurationVersionByUUID - Finds a specific configuration version by UUID. + * @param[in] sVersionUUID - UUID of the configuration version. + * @return Matching configuration version if found. + */ + virtual IMachineConfigurationVersion * FindConfigurationVersionByUUID(const std::string & sVersionUUID) = 0; + + /** + * IMachineConfigurationType::GetActiveConfigurationVersion - Returns the currently active configuration version for this type. + * @return Active version instance or null. */ - virtual void RegisterConfigurationXSDFromResource(const std::string & sXSDResourceName, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationResourceName) = 0; + virtual IMachineConfigurationVersion * GetActiveConfigurationVersion() = 0; /** - * IMachineConfigurationType::GetLatestConfiguration - Returns the latest Machine Configuration of this configuration type. Returns the default XML of the newest XSD if no configuration exists. - * @return Configuration Version instance. + * IMachineConfigurationType::GetLatestConfigurationVersion - Returns the most recently created version for this type. + * @return Latest configuration version or null. */ - virtual IMachineConfigurationVersion * GetLatestConfiguration() = 0; + virtual IMachineConfigurationVersion * GetLatestConfigurationVersion() = 0; /** - * IMachineConfigurationType::GetActiveConfiguration - Returns the active Machine Configuration of this configuration type. - * @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. - * @return Configuration Version instance. + * IMachineConfigurationType::SetActiveConfigurationVersion - Sets the active configuration version for this type. + * @param[in] sVersionUUID - UUID of the version to set as active. */ - virtual IMachineConfigurationVersion * GetActiveConfiguration(const bool bFallBackToDefault) = 0; + virtual void SetActiveConfigurationVersion(const std::string & sVersionUUID) = 0; }; typedef IBaseSharedPtr PIMachineConfigurationType; +/************************************************************************************************************************* + Class interface for MachineConfigurationTypeIterator +**************************************************************************************************************************/ + +class IMachineConfigurationTypeIterator : public virtual IIterator { +public: + /** + * IMachineConfigurationTypeIterator::GetCurrent - Returns the current MachineConfigurationType instance. + * @return Currently selected configuration type instance. + */ + virtual IMachineConfigurationType * GetCurrent() = 0; + +}; + +typedef IBaseSharedPtr PIMachineConfigurationTypeIterator; + + /************************************************************************************************************************* Class interface for MachineConfigurationHandler **************************************************************************************************************************/ @@ -6863,34 +7029,39 @@ typedef IBaseSharedPtr PIMachineConfigurationType; class IMachineConfigurationHandler : public virtual IBase { public: /** - * IMachineConfigurationHandler::RegisterMachineConfigurationType - Registers a new machine configuration type, or returns the unique existing one with the same schema type. - * @param[in] sSchemaType - Schema Type String. MUST not be empty. - * @param[in] sName - Type Name. MUST not be empty. If the configuration type already exists, the name will be checked for identity! - * @return Instance of machine configuration type. + * IMachineConfigurationHandler::RegisterMachineConfigurationType - Registers a new configuration type or returns existing one if already registered. + * @param[in] sSchemaType - Schema type string. MUST not be empty. + * @param[in] sName - Display name. MUST not be empty. Must match existing name if type exists. + * @return Instance of the configuration type. */ virtual IMachineConfigurationType * RegisterMachineConfigurationType(const std::string & sSchemaType, const std::string & sName) = 0; /** - * IMachineConfigurationHandler::HasMachineConfigurationType - Checks if a certain configuration schema type has been registered. - * @param[in] sSchemaType - Schema Type String. MUST not be empty. - * @return Returns true, if the system knows about a configuration schema type. + * IMachineConfigurationHandler::HasMachineConfigurationType - Checks if a schema type is already registered. + * @param[in] sSchemaType - Schema type string. + * @return True if known, false otherwise. */ virtual bool HasMachineConfigurationType(const std::string & sSchemaType) = 0; /** - * IMachineConfigurationHandler::GetLatestConfiguration - Returns the latest Machine Configuration for a specific configuration type. Returns the default XML of the newest XSD if no configuration exists. - * @param[in] sSchemaType - Schema Type String. Fails if configuration schema type is not known. - * @return Configuration Version instance. + * IMachineConfigurationHandler::ListRegisteredTypes - Returns all configuration types registered in the system. + * @return Iterator over configuration types. */ - virtual IMachineConfigurationVersion * GetLatestConfiguration(const std::string & sSchemaType) = 0; + virtual IMachineConfigurationTypeIterator * ListRegisteredTypes() = 0; /** - * IMachineConfigurationHandler::GetActiveConfiguration - Returns the active Machine Configuration for a specific configuration type. - * @param[in] sSchemaType - Schema Type String. Fails if configuration schema type is not known. - * @param[in] bFallBackToDefault - If true, the default configuration is returned, if no active configuration exists. Otherwise null is returned. - * @return Configuration Version instance. + * IMachineConfigurationHandler::FindConfigurationTypeByUUID - Returns configuration type by UUID. + * @param[in] sTypeUUID - UUID of the configuration type. + * @return Configuration type if found. */ - virtual IMachineConfigurationVersion * GetActiveConfiguration(const std::string & sSchemaType, const bool bFallBackToDefault) = 0; + virtual IMachineConfigurationType * FindConfigurationTypeByUUID(const std::string & sTypeUUID) = 0; + + /** + * IMachineConfigurationHandler::FindConfigurationTypeBySchema - Returns configuration type by Schema Type. + * @param[in] sSchemaType - Schema Type of the configuration type. + * @return Configuration type if found. + */ + virtual IMachineConfigurationType * FindConfigurationTypeBySchema(const std::string & sSchemaType) = 0; }; @@ -8130,6 +8301,12 @@ class IUIEnvironment : public virtual IBase { */ virtual IJSONObject * GetExternalEventResults() = 0; + /** + * IUIEnvironment::CreateMachineConfigurationHandler - creates a machine configuration handler, dealing with all persistent machine settings that the user will store in the local database. + * @return MachineConfigurationHandler instance. + */ + virtual IMachineConfigurationHandler * CreateMachineConfigurationHandler() = 0; + }; typedef IBaseSharedPtr PIUIEnvironment; diff --git a/Framework/InterfacesCore/libmcenv_interfacewrapper.cpp b/Framework/InterfacesCore/libmcenv_interfacewrapper.cpp index d6ac8bdb..8a29aa78 100644 --- a/Framework/InterfacesCore/libmcenv_interfacewrapper.cpp +++ b/Framework/InterfacesCore/libmcenv_interfacewrapper.cpp @@ -25878,43 +25878,515 @@ LibMCEnvResult libmcenv_usermanagementhandler_getactiveusers(LibMCEnv_UserManage } +/************************************************************************************************************************* + Class implementation for MachineConfigurationXSD +**************************************************************************************************************************/ +LibMCEnvResult libmcenv_machineconfigurationxsd_getuuid(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nXSDUUIDBufferSize, LibMCEnv_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; + + try { + if ( (!pXSDUUIDBuffer) && !(pXSDUUIDNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDUUID(""); + IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSD) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pXSDUUIDBuffer == nullptr); + if (isCacheCall) { + sXSDUUID = pIMachineConfigurationXSD->GetUUID(); + + pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sXSDUUID)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sXSDUUID); + pIMachineConfigurationXSD->_setCache (nullptr); + } + + if (pXSDUUIDNeededChars) + *pXSDUUIDNeededChars = (LibMCEnv_uint32) (sXSDUUID.size()+1); + if (pXSDUUIDBuffer) { + if (sXSDUUID.size() >= nXSDUUIDBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iXSDUUID = 0; iXSDUUID < sXSDUUID.size(); iXSDUUID++) + pXSDUUIDBuffer[iXSDUUID] = sXSDUUID[iXSDUUID]; + pXSDUUIDBuffer[sXSDUUID.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationxsd_gettypeuuid(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nTypeUUIDBufferSize, LibMCEnv_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; + + try { + if ( (!pTypeUUIDBuffer) && !(pTypeUUIDNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sTypeUUID(""); + IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSD) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pTypeUUIDBuffer == nullptr); + if (isCacheCall) { + sTypeUUID = pIMachineConfigurationXSD->GetTypeUUID(); + + pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sTypeUUID)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sTypeUUID); + pIMachineConfigurationXSD->_setCache (nullptr); + } + + if (pTypeUUIDNeededChars) + *pTypeUUIDNeededChars = (LibMCEnv_uint32) (sTypeUUID.size()+1); + if (pTypeUUIDBuffer) { + if (sTypeUUID.size() >= nTypeUUIDBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iTypeUUID = 0; iTypeUUID < sTypeUUID.size(); iTypeUUID++) + pTypeUUIDBuffer[iTypeUUID] = sTypeUUID[iTypeUUID]; + pTypeUUIDBuffer[sTypeUUID.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationxsd_getxsdversion(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, LibMCEnv_uint32 * pXSDVersion) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; + + try { + if (pXSDVersion == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSD) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + *pXSDVersion = pIMachineConfigurationXSD->GetXSDVersion(); + + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationxsd_getxsdstring(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nXSDStringBufferSize, LibMCEnv_uint32* pXSDStringNeededChars, char * pXSDStringBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; + + try { + if ( (!pXSDStringBuffer) && !(pXSDStringNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDString(""); + IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSD) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pXSDStringBuffer == nullptr); + if (isCacheCall) { + sXSDString = pIMachineConfigurationXSD->GetXSDString(); + + pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sXSDString)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sXSDString); + pIMachineConfigurationXSD->_setCache (nullptr); + } + + if (pXSDStringNeededChars) + *pXSDStringNeededChars = (LibMCEnv_uint32) (sXSDString.size()+1); + if (pXSDStringBuffer) { + if (sXSDString.size() >= nXSDStringBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iXSDString = 0; iXSDString < sXSDString.size(); iXSDString++) + pXSDStringBuffer[iXSDString] = sXSDString[iXSDString]; + pXSDStringBuffer[sXSDString.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationxsd_gettimestamp(LibMCEnv_MachineConfigurationXSD pMachineConfigurationXSD, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSD; + + try { + if ( (!pTimeStampUTCBuffer) && !(pTimeStampUTCNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sTimeStampUTC(""); + IMachineConfigurationXSD* pIMachineConfigurationXSD = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSD) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pTimeStampUTCBuffer == nullptr); + if (isCacheCall) { + sTimeStampUTC = pIMachineConfigurationXSD->GetTimestamp(); + + pIMachineConfigurationXSD->_setCache (new ParameterCache_1 (sTimeStampUTC)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationXSD->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sTimeStampUTC); + pIMachineConfigurationXSD->_setCache (nullptr); + } + + if (pTimeStampUTCNeededChars) + *pTimeStampUTCNeededChars = (LibMCEnv_uint32) (sTimeStampUTC.size()+1); + if (pTimeStampUTCBuffer) { + if (sTimeStampUTC.size() >= nTimeStampUTCBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iTimeStampUTC = 0; iTimeStampUTC < sTimeStampUTC.size(); iTimeStampUTC++) + pTimeStampUTCBuffer[iTimeStampUTC] = sTimeStampUTC[iTimeStampUTC]; + pTimeStampUTCBuffer[sTimeStampUTC.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + + +/************************************************************************************************************************* + Class implementation for MachineConfigurationXSDIterator +**************************************************************************************************************************/ +LibMCEnvResult libmcenv_machineconfigurationxsditerator_getcurrent(LibMCEnv_MachineConfigurationXSDIterator pMachineConfigurationXSDIterator, LibMCEnv_MachineConfigurationXSD * pInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationXSDIterator; + + try { + if (pInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IBase* pBaseInstance(nullptr); + IMachineConfigurationXSDIterator* pIMachineConfigurationXSDIterator = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationXSDIterator) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseInstance = pIMachineConfigurationXSDIterator->GetCurrent(); + + *pInstance = (IBase*)(pBaseInstance); + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + + /************************************************************************************************************************* Class implementation for MachineConfigurationVersion **************************************************************************************************************************/ -LibMCEnvResult libmcenv_machineconfigurationversion_getschematype(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer) +LibMCEnvResult libmcenv_machineconfigurationversion_getversionuuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nVersionUUIDBufferSize, LibMCEnv_uint32* pVersionUUIDNeededChars, char * pVersionUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if ( (!pVersionUUIDBuffer) && !(pVersionUUIDNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sVersionUUID(""); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pVersionUUIDBuffer == nullptr); + if (isCacheCall) { + sVersionUUID = pIMachineConfigurationVersion->GetVersionUUID(); + + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sVersionUUID)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sVersionUUID); + pIMachineConfigurationVersion->_setCache (nullptr); + } + + if (pVersionUUIDNeededChars) + *pVersionUUIDNeededChars = (LibMCEnv_uint32) (sVersionUUID.size()+1); + if (pVersionUUIDBuffer) { + if (sVersionUUID.size() >= nVersionUUIDBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iVersionUUID = 0; iVersionUUID < sVersionUUID.size(); iVersionUUID++) + pVersionUUIDBuffer[iVersionUUID] = sVersionUUID[iVersionUUID]; + pVersionUUIDBuffer[sVersionUUID.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_getxsduuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXSDUUIDBufferSize, LibMCEnv_uint32* pXSDUUIDNeededChars, char * pXSDUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if ( (!pXSDUUIDBuffer) && !(pXSDUUIDNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDUUID(""); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pXSDUUIDBuffer == nullptr); + if (isCacheCall) { + sXSDUUID = pIMachineConfigurationVersion->GetXSDUUID(); + + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXSDUUID)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sXSDUUID); + pIMachineConfigurationVersion->_setCache (nullptr); + } + + if (pXSDUUIDNeededChars) + *pXSDUUIDNeededChars = (LibMCEnv_uint32) (sXSDUUID.size()+1); + if (pXSDUUIDBuffer) { + if (sXSDUUID.size() >= nXSDUUIDBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iXSDUUID = 0; iXSDUUID < sXSDUUID.size(); iXSDUUID++) + pXSDUUIDBuffer[iXSDUUID] = sXSDUUID[iXSDUUID]; + pXSDUUIDBuffer[sXSDUUID.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_getnumericversion(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_uint32 * pConfigurationNumericVersion) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if (pConfigurationNumericVersion == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + *pConfigurationNumericVersion = pIMachineConfigurationVersion->GetNumericVersion(); + + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_getparentuuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nParentUUIDBufferSize, LibMCEnv_uint32* pParentUUIDNeededChars, char * pParentUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if ( (!pParentUUIDBuffer) && !(pParentUUIDNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sParentUUID(""); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pParentUUIDBuffer == nullptr); + if (isCacheCall) { + sParentUUID = pIMachineConfigurationVersion->GetParentUUID(); + + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sParentUUID)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sParentUUID); + pIMachineConfigurationVersion->_setCache (nullptr); + } + + if (pParentUUIDNeededChars) + *pParentUUIDNeededChars = (LibMCEnv_uint32) (sParentUUID.size()+1); + if (pParentUUIDBuffer) { + if (sParentUUID.size() >= nParentUUIDBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iParentUUID = 0; iParentUUID < sParentUUID.size(); iParentUUID++) + pParentUUIDBuffer[iParentUUID] = sParentUUID[iParentUUID]; + pParentUUIDBuffer[sParentUUID.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmlstring(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXMLStringBufferSize, LibMCEnv_uint32* pXMLStringNeededChars, char * pXMLStringBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if ( (!pXMLStringBuffer) && !(pXMLStringNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXMLString(""); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pXMLStringBuffer == nullptr); + if (isCacheCall) { + sXMLString = pIMachineConfigurationVersion->GetConfigurationXMLString(); + + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXMLString)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sXMLString); + pIMachineConfigurationVersion->_setCache (nullptr); + } + + if (pXMLStringNeededChars) + *pXMLStringNeededChars = (LibMCEnv_uint32) (sXMLString.size()+1); + if (pXMLStringBuffer) { + if (sXMLString.size() >= nXMLStringBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iXMLString = 0; iXMLString < sXMLString.size(); iXMLString++) + pXMLStringBuffer[iXMLString] = sXMLString[iXMLString]; + pXMLStringBuffer[sXMLString.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_getuseruuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nUserUUIDBufferSize, LibMCEnv_uint32* pUserUUIDNeededChars, char * pUserUUIDBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; try { - if ( (!pSchemaTypeBuffer) && !(pSchemaTypeNeededChars) ) + if ( (!pUserUUIDBuffer) && !(pUserUUIDNeededChars) ) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sSchemaType(""); + std::string sUserUUID(""); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pSchemaTypeBuffer == nullptr); + bool isCacheCall = (pUserUUIDBuffer == nullptr); if (isCacheCall) { - sSchemaType = pIMachineConfigurationVersion->GetSchemaType(); + sUserUUID = pIMachineConfigurationVersion->GetUserUUID(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sSchemaType)); + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sUserUUID)); } else { auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); if (cache == nullptr) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sSchemaType); + cache->retrieveData (sUserUUID); pIMachineConfigurationVersion->_setCache (nullptr); } - if (pSchemaTypeNeededChars) - *pSchemaTypeNeededChars = (LibMCEnv_uint32) (sSchemaType.size()+1); - if (pSchemaTypeBuffer) { - if (sSchemaType.size() >= nSchemaTypeBufferSize) + if (pUserUUIDNeededChars) + *pUserUUIDNeededChars = (LibMCEnv_uint32) (sUserUUID.size()+1); + if (pUserUUIDBuffer) { + if (sUserUUID.size() >= nUserUUIDBufferSize) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iSchemaType = 0; iSchemaType < sSchemaType.size(); iSchemaType++) - pSchemaTypeBuffer[iSchemaType] = sSchemaType[iSchemaType]; - pSchemaTypeBuffer[sSchemaType.size()] = 0; + for (size_t iUserUUID = 0; iUserUUID < sUserUUID.size(); iUserUUID++) + pUserUUIDBuffer[iUserUUID] = sUserUUID[iUserUUID]; + pUserUUIDBuffer[sUserUUID.size()] = 0; } return LIBMCENV_SUCCESS; } @@ -25929,32 +26401,237 @@ LibMCEnvResult libmcenv_machineconfigurationversion_getschematype(LibMCEnv_Machi } } -LibMCEnvResult libmcenv_machineconfigurationversion_gettypename(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer) +LibMCEnvResult libmcenv_machineconfigurationversion_gettimestamp(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer) { IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; try { - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if ( (!pTimeStampUTCBuffer) && !(pTimeStampUTCNeededChars) ) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sName(""); + std::string sTimeStampUTC(""); IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationVersion) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); + bool isCacheCall = (pTimeStampUTCBuffer == nullptr); if (isCacheCall) { - sName = pIMachineConfigurationVersion->GetTypeName(); + sTimeStampUTC = pIMachineConfigurationVersion->GetTimestamp(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sName)); + pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sTimeStampUTC)); } else { auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); if (cache == nullptr) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sName); + cache->retrieveData (sTimeStampUTC); pIMachineConfigurationVersion->_setCache (nullptr); } + if (pTimeStampUTCNeededChars) + *pTimeStampUTCNeededChars = (LibMCEnv_uint32) (sTimeStampUTC.size()+1); + if (pTimeStampUTCBuffer) { + if (sTimeStampUTC.size() >= nTimeStampUTCBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iTimeStampUTC = 0; iTimeStampUTC < sTimeStampUTC.size(); iTimeStampUTC++) + pTimeStampUTCBuffer[iTimeStampUTC] = sTimeStampUTC[iTimeStampUTC]; + pTimeStampUTCBuffer[sTimeStampUTC.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_createnewversion(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const char * pXMLString, const char * pUserUUID, LibMCEnv_MachineConfigurationVersion * pCurrentInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if (pXMLString == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pUserUUID == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pCurrentInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXMLString(pXMLString); + std::string sUserUUID(pUserUUID); + IBase* pBaseCurrentInstance(nullptr); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseCurrentInstance = pIMachineConfigurationVersion->CreateNewVersion(sXMLString, sUserUUID); + + *pCurrentInstance = (IBase*)(pBaseCurrentInstance); + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationversion_migratetonewxsd(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_MachineConfigurationXSD pNewXSD, const char * pXMLString, const char * pUserUUID, LibMCEnv_MachineConfigurationVersion * pCurrentInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + + try { + if (pXMLString == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pUserUUID == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pCurrentInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IBase* pIBaseClassNewXSD = (IBase *)pNewXSD; + IMachineConfigurationXSD* pINewXSD = dynamic_cast(pIBaseClassNewXSD); + if (!pINewXSD) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDCAST); + + std::string sXMLString(pXMLString); + std::string sUserUUID(pUserUUID); + IBase* pBaseCurrentInstance(nullptr); + IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersion) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseCurrentInstance = pIMachineConfigurationVersion->MigrateToNewXSD(pINewXSD, sXMLString, sUserUUID); + + *pCurrentInstance = (IBase*)(pBaseCurrentInstance); + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + + +/************************************************************************************************************************* + Class implementation for MachineConfigurationVersionIterator +**************************************************************************************************************************/ +LibMCEnvResult libmcenv_machineconfigurationversioniterator_getcurrent(LibMCEnv_MachineConfigurationVersionIterator pMachineConfigurationVersionIterator, LibMCEnv_MachineConfigurationVersion * pInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationVersionIterator; + + try { + if (pInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IBase* pBaseInstance(nullptr); + IMachineConfigurationVersionIterator* pIMachineConfigurationVersionIterator = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationVersionIterator) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseInstance = pIMachineConfigurationVersionIterator->GetCurrent(); + + *pInstance = (IBase*)(pBaseInstance); + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + + +/************************************************************************************************************************* + Class implementation for MachineConfigurationType +**************************************************************************************************************************/ +LibMCEnvResult libmcenv_machineconfigurationtype_getuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nTypeUUIDBufferSize, LibMCEnv_uint32* pTypeUUIDNeededChars, char * pTypeUUIDBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if ( (!pTypeUUIDBuffer) && !(pTypeUUIDNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sTypeUUID(""); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pTypeUUIDBuffer == nullptr); + if (isCacheCall) { + sTypeUUID = pIMachineConfigurationType->GetUUID(); + + pIMachineConfigurationType->_setCache (new ParameterCache_1 (sTypeUUID)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sTypeUUID); + pIMachineConfigurationType->_setCache (nullptr); + } + + if (pTypeUUIDNeededChars) + *pTypeUUIDNeededChars = (LibMCEnv_uint32) (sTypeUUID.size()+1); + if (pTypeUUIDBuffer) { + if (sTypeUUID.size() >= nTypeUUIDBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iTypeUUID = 0; iTypeUUID < sTypeUUID.size(); iTypeUUID++) + pTypeUUIDBuffer[iTypeUUID] = sTypeUUID[iTypeUUID]; + pTypeUUIDBuffer[sTypeUUID.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationtype_getname(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if ( (!pNameBuffer) && !(pNameNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sName(""); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pNameBuffer == nullptr); + if (isCacheCall) { + sName = pIMachineConfigurationType->GetName(); + + pIMachineConfigurationType->_setCache (new ParameterCache_1 (sName)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sName); + pIMachineConfigurationType->_setCache (nullptr); + } + if (pNameNeededChars) *pNameNeededChars = (LibMCEnv_uint32) (sName.size()+1); if (pNameBuffer) { @@ -25977,40 +26654,88 @@ LibMCEnvResult libmcenv_machineconfigurationversion_gettypename(LibMCEnv_Machine } } -LibMCEnvResult libmcenv_machineconfigurationversion_gettypeuuid(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nUUIDBufferSize, LibMCEnv_uint32* pUUIDNeededChars, char * pUUIDBuffer) +LibMCEnvResult libmcenv_machineconfigurationtype_getschematype(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + if ( (!pSchemaTypeBuffer) && !(pSchemaTypeNeededChars) ) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sUUID(""); - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) + std::string sSchemaType(""); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pUUIDBuffer == nullptr); + bool isCacheCall = (pSchemaTypeBuffer == nullptr); if (isCacheCall) { - sUUID = pIMachineConfigurationVersion->GetTypeUUID(); + sSchemaType = pIMachineConfigurationType->GetSchemaType(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sUUID)); + pIMachineConfigurationType->_setCache (new ParameterCache_1 (sSchemaType)); } else { - auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); + auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); if (cache == nullptr) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sUUID); - pIMachineConfigurationVersion->_setCache (nullptr); + cache->retrieveData (sSchemaType); + pIMachineConfigurationType->_setCache (nullptr); } - if (pUUIDNeededChars) - *pUUIDNeededChars = (LibMCEnv_uint32) (sUUID.size()+1); - if (pUUIDBuffer) { - if (sUUID.size() >= nUUIDBufferSize) + if (pSchemaTypeNeededChars) + *pSchemaTypeNeededChars = (LibMCEnv_uint32) (sSchemaType.size()+1); + if (pSchemaTypeBuffer) { + if (sSchemaType.size() >= nSchemaTypeBufferSize) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); + for (size_t iSchemaType = 0; iSchemaType < sSchemaType.size(); iSchemaType++) + pSchemaTypeBuffer[iSchemaType] = sSchemaType[iSchemaType]; + pSchemaTypeBuffer[sSchemaType.size()] = 0; + } + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationtype_gettimestamp(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nTimeStampUTCBufferSize, LibMCEnv_uint32* pTimeStampUTCNeededChars, char * pTimeStampUTCBuffer) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; + + try { + if ( (!pTimeStampUTCBuffer) && !(pTimeStampUTCNeededChars) ) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sTimeStampUTC(""); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + bool isCacheCall = (pTimeStampUTCBuffer == nullptr); + if (isCacheCall) { + sTimeStampUTC = pIMachineConfigurationType->GetTimestamp(); + + pIMachineConfigurationType->_setCache (new ParameterCache_1 (sTimeStampUTC)); + } + else { + auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); + if (cache == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + cache->retrieveData (sTimeStampUTC); + pIMachineConfigurationType->_setCache (nullptr); + } + + if (pTimeStampUTCNeededChars) + *pTimeStampUTCNeededChars = (LibMCEnv_uint32) (sTimeStampUTC.size()+1); + if (pTimeStampUTCBuffer) { + if (sTimeStampUTC.size() >= nTimeStampUTCBufferSize) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) - pUUIDBuffer[iUUID] = sUUID[iUUID]; - pUUIDBuffer[sUUID.size()] = 0; + for (size_t iTimeStampUTC = 0; iTimeStampUTC < sTimeStampUTC.size(); iTimeStampUTC++) + pTimeStampUTCBuffer[iTimeStampUTC] = sTimeStampUTC[iTimeStampUTC]; + pTimeStampUTCBuffer[sTimeStampUTC.size()] = 0; } return LIBMCENV_SUCCESS; } @@ -26025,19 +26750,21 @@ LibMCEnvResult libmcenv_machineconfigurationversion_gettypeuuid(LibMCEnv_Machine } } -LibMCEnvResult libmcenv_machineconfigurationversion_getxsdversion(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_uint32 * pXSDVersion) +LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationXSD * pXSDInstance) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDVersion == nullptr) + if (pXSDInstance == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) + IBase* pBaseXSDInstance(nullptr); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - *pXSDVersion = pIMachineConfigurationVersion->GetXSDVersion(); + pBaseXSDInstance = pIMachineConfigurationType->GetLatestXSD(); + *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26051,41 +26778,21 @@ LibMCEnvResult libmcenv_machineconfigurationversion_getxsdversion(LibMCEnv_Machi } } -LibMCEnvResult libmcenv_machineconfigurationversion_getxsdstring(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXSDStringBufferSize, LibMCEnv_uint32* pXSDStringNeededChars, char * pXSDStringBuffer) +LibMCEnvResult libmcenv_machineconfigurationtype_listxsdversions(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationXSDIterator * pXSDIterator) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if ( (!pXSDStringBuffer) && !(pXSDStringNeededChars) ) + if (pXSDIterator == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sXSDString(""); - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) + IBase* pBaseXSDIterator(nullptr); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pXSDStringBuffer == nullptr); - if (isCacheCall) { - sXSDString = pIMachineConfigurationVersion->GetXSDString(); + pBaseXSDIterator = pIMachineConfigurationType->ListXSDVersions(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXSDString)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); - if (cache == nullptr) - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sXSDString); - pIMachineConfigurationVersion->_setCache (nullptr); - } - - if (pXSDStringNeededChars) - *pXSDStringNeededChars = (LibMCEnv_uint32) (sXSDString.size()+1); - if (pXSDStringBuffer) { - if (sXSDString.size() >= nXSDStringBufferSize) - throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iXSDString = 0; iXSDString < sXSDString.size(); iXSDString++) - pXSDStringBuffer[iXSDString] = sXSDString[iXSDString]; - pXSDStringBuffer[sXSDString.size()] = 0; - } + *pXSDIterator = (IBase*)(pBaseXSDIterator); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26099,41 +26806,19 @@ LibMCEnvResult libmcenv_machineconfigurationversion_getxsdstring(LibMCEnv_Machin } } -LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmlstring(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, const LibMCEnv_uint32 nXMLStringBufferSize, LibMCEnv_uint32* pXMLStringNeededChars, char * pXMLStringBuffer) +LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsdnumericversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 * pXSDNumericVersion) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if ( (!pXMLStringBuffer) && !(pXMLStringNeededChars) ) + if (pXSDNumericVersion == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sXMLString(""); - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pXMLStringBuffer == nullptr); - if (isCacheCall) { - sXMLString = pIMachineConfigurationVersion->GetConfigurationXMLString(); + *pXSDNumericVersion = pIMachineConfigurationType->GetLatestXSDNumericVersion(); - pIMachineConfigurationVersion->_setCache (new ParameterCache_1 (sXMLString)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationVersion->_getCache ()); - if (cache == nullptr) - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sXMLString); - pIMachineConfigurationVersion->_setCache (nullptr); - } - - if (pXMLStringNeededChars) - *pXMLStringNeededChars = (LibMCEnv_uint32) (sXMLString.size()+1); - if (pXMLStringBuffer) { - if (sXMLString.size() >= nXMLStringBufferSize) - throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iXMLString = 0; iXMLString < sXMLString.size(); iXMLString++) - pXMLStringBuffer[iXMLString] = sXMLString[iXMLString]; - pXMLStringBuffer[sXMLString.size()] = 0; - } return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26147,21 +26832,24 @@ LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmlstring(Li } } -LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmldocument(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion, LibMCEnv_XMLDocument * pDocumentInstance) +LibMCEnvResult libmcenv_machineconfigurationtype_registernewxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCEnv_uint32 nXSDVersion, LibMCEnv_MachineConfigurationXSD * pXSDInstance) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pDocumentInstance == nullptr) + if (pXSDString == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - IBase* pBaseDocumentInstance(nullptr); - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) + if (pXSDInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDString(pXSDString); + IBase* pBaseXSDInstance(nullptr); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pBaseDocumentInstance = pIMachineConfigurationVersion->GetConfigurationXMLDocument(); + pBaseXSDInstance = pIMachineConfigurationType->RegisterNewXSD(sXSDString, nXSDVersion); - *pDocumentInstance = (IBase*)(pBaseDocumentInstance); + *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26175,17 +26863,21 @@ LibMCEnvResult libmcenv_machineconfigurationversion_getconfigurationxmldocument( } } -LibMCEnvResult libmcenv_machineconfigurationversion_makeactive(LibMCEnv_MachineConfigurationVersion pMachineConfigurationVersion) +LibMCEnvResult libmcenv_machineconfigurationtype_findxsdbynumericversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 nXSDNumericVersion, LibMCEnv_MachineConfigurationXSD * pXSDInstance) { - IBase* pIBaseClass = (IBase *)pMachineConfigurationVersion; + IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - IMachineConfigurationVersion* pIMachineConfigurationVersion = dynamic_cast(pIBaseClass); - if (!pIMachineConfigurationVersion) + if (pXSDInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IBase* pBaseXSDInstance(nullptr); + IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pIMachineConfigurationVersion->MakeActive(); + pBaseXSDInstance = pIMachineConfigurationType->FindXSDByNumericVersion(nXSDNumericVersion); + *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26199,45 +26891,24 @@ LibMCEnvResult libmcenv_machineconfigurationversion_makeactive(LibMCEnv_MachineC } } - -/************************************************************************************************************************* - Class implementation for MachineConfigurationType -**************************************************************************************************************************/ -LibMCEnvResult libmcenv_machineconfigurationtype_getschematype(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nSchemaTypeBufferSize, LibMCEnv_uint32* pSchemaTypeNeededChars, char * pSchemaTypeBuffer) +LibMCEnvResult libmcenv_machineconfigurationtype_findxsdbyuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCEnv_MachineConfigurationXSD * pXSDInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if ( (!pSchemaTypeBuffer) && !(pSchemaTypeNeededChars) ) + if (pXSDUUID == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sSchemaType(""); + if (pXSDInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDUUID(pXSDUUID); + IBase* pBaseXSDInstance(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pSchemaTypeBuffer == nullptr); - if (isCacheCall) { - sSchemaType = pIMachineConfigurationType->GetSchemaType(); + pBaseXSDInstance = pIMachineConfigurationType->FindXSDByUUID(sXSDUUID); - pIMachineConfigurationType->_setCache (new ParameterCache_1 (sSchemaType)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); - if (cache == nullptr) - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sSchemaType); - pIMachineConfigurationType->_setCache (nullptr); - } - - if (pSchemaTypeNeededChars) - *pSchemaTypeNeededChars = (LibMCEnv_uint32) (sSchemaType.size()+1); - if (pSchemaTypeBuffer) { - if (sSchemaType.size() >= nSchemaTypeBufferSize) - throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iSchemaType = 0; iSchemaType < sSchemaType.size(); iSchemaType++) - pSchemaTypeBuffer[iSchemaType] = sSchemaType[iSchemaType]; - pSchemaTypeBuffer[sSchemaType.size()] = 0; - } + *pXSDInstance = (IBase*)(pBaseXSDInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26251,41 +26922,30 @@ LibMCEnvResult libmcenv_machineconfigurationtype_getschematype(LibMCEnv_MachineC } } -LibMCEnvResult libmcenv_machineconfigurationtype_gettypename(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nNameBufferSize, LibMCEnv_uint32* pNameNeededChars, char * pNameBuffer) +LibMCEnvResult libmcenv_machineconfigurationtype_createdefaultconfiguration(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, const char * pDefaultXML, const char * pTimeStampUTC, LibMCEnv_MachineConfigurationVersion * pVersionInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if ( (!pNameBuffer) && !(pNameNeededChars) ) + if (pXSDUUID == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sName(""); + if (pDefaultXML == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pTimeStampUTC == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pVersionInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDUUID(pXSDUUID); + std::string sDefaultXML(pDefaultXML); + std::string sTimeStampUTC(pTimeStampUTC); + IBase* pBaseVersionInstance(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pNameBuffer == nullptr); - if (isCacheCall) { - sName = pIMachineConfigurationType->GetTypeName(); + pBaseVersionInstance = pIMachineConfigurationType->CreateDefaultConfiguration(sXSDUUID, sDefaultXML, sTimeStampUTC); - pIMachineConfigurationType->_setCache (new ParameterCache_1 (sName)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); - if (cache == nullptr) - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sName); - pIMachineConfigurationType->_setCache (nullptr); - } - - if (pNameNeededChars) - *pNameNeededChars = (LibMCEnv_uint32) (sName.size()+1); - if (pNameBuffer) { - if (sName.size() >= nNameBufferSize) - throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iName = 0; iName < sName.size(); iName++) - pNameBuffer[iName] = sName[iName]; - pNameBuffer[sName.size()] = 0; - } + *pVersionInstance = (IBase*)(pBaseVersionInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26299,41 +26959,21 @@ LibMCEnvResult libmcenv_machineconfigurationtype_gettypename(LibMCEnv_MachineCon } } -LibMCEnvResult libmcenv_machineconfigurationtype_gettypeuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const LibMCEnv_uint32 nUUIDBufferSize, LibMCEnv_uint32* pUUIDNeededChars, char * pUUIDBuffer) +LibMCEnvResult libmcenv_machineconfigurationtype_listallconfigurationversions(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersionIterator * pVersionIterator) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if ( (!pUUIDBuffer) && !(pUUIDNeededChars) ) + if (pVersionIterator == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sUUID(""); + IBase* pBaseVersionIterator(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - bool isCacheCall = (pUUIDBuffer == nullptr); - if (isCacheCall) { - sUUID = pIMachineConfigurationType->GetTypeUUID(); + pBaseVersionIterator = pIMachineConfigurationType->ListAllConfigurationVersions(); - pIMachineConfigurationType->_setCache (new ParameterCache_1 (sUUID)); - } - else { - auto cache = dynamic_cast*> (pIMachineConfigurationType->_getCache ()); - if (cache == nullptr) - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - cache->retrieveData (sUUID); - pIMachineConfigurationType->_setCache (nullptr); - } - - if (pUUIDNeededChars) - *pUUIDNeededChars = (LibMCEnv_uint32) (sUUID.size()+1); - if (pUUIDBuffer) { - if (sUUID.size() >= nUUIDBufferSize) - throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_BUFFERTOOSMALL); - for (size_t iUUID = 0; iUUID < sUUID.size(); iUUID++) - pUUIDBuffer[iUUID] = sUUID[iUUID]; - pUUIDBuffer[sUUID.size()] = 0; - } + *pVersionIterator = (IBase*)(pBaseVersionIterator); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26347,19 +26987,24 @@ LibMCEnvResult libmcenv_machineconfigurationtype_gettypeuuid(LibMCEnv_MachineCon } } -LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsdversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_uint32 * pXSDVersion) +LibMCEnvResult libmcenv_machineconfigurationtype_listconfigurationversionsforxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDUUID, LibMCEnv_MachineConfigurationVersionIterator * pVersionIterator) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDVersion == nullptr) + if (pXSDUUID == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + if (pVersionIterator == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sXSDUUID(pXSDUUID); + IBase* pBaseVersionIterator(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - *pXSDVersion = pIMachineConfigurationType->GetLatestXSDVersion(); + pBaseVersionIterator = pIMachineConfigurationType->ListConfigurationVersionsForXSD(sXSDUUID); + *pVersionIterator = (IBase*)(pBaseVersionIterator); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26373,23 +27018,24 @@ LibMCEnvResult libmcenv_machineconfigurationtype_getlatestxsdversion(LibMCEnv_Ma } } -LibMCEnvResult libmcenv_machineconfigurationtype_registerconfigurationxsd(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDString, LibMCEnv_uint32 nXSDVersion, const char * pDefaultConfigurationXML) +LibMCEnvResult libmcenv_machineconfigurationtype_findconfigurationversionbyuuid(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID, LibMCEnv_MachineConfigurationVersion * pVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDString == nullptr) + if (pVersionUUID == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - if (pDefaultConfigurationXML == nullptr) + if (pVersion == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sXSDString(pXSDString); - std::string sDefaultConfigurationXML(pDefaultConfigurationXML); + std::string sVersionUUID(pVersionUUID); + IBase* pBaseVersion(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pIMachineConfigurationType->RegisterConfigurationXSD(sXSDString, nXSDVersion, sDefaultConfigurationXML); + pBaseVersion = pIMachineConfigurationType->FindConfigurationVersionByUUID(sVersionUUID); + *pVersion = (IBase*)(pBaseVersion); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26403,23 +27049,21 @@ LibMCEnvResult libmcenv_machineconfigurationtype_registerconfigurationxsd(LibMCE } } -LibMCEnvResult libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pXSDResourceName, LibMCEnv_uint32 nXSDVersion, const char * pDefaultConfigurationResourceName) +LibMCEnvResult libmcenv_machineconfigurationtype_getactiveconfigurationversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pXSDResourceName == nullptr) - throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - if (pDefaultConfigurationResourceName == nullptr) + if (pVersion == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sXSDResourceName(pXSDResourceName); - std::string sDefaultConfigurationResourceName(pDefaultConfigurationResourceName); + IBase* pBaseVersion(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pIMachineConfigurationType->RegisterConfigurationXSDFromResource(sXSDResourceName, nXSDVersion, sDefaultConfigurationResourceName); + pBaseVersion = pIMachineConfigurationType->GetActiveConfigurationVersion(); + *pVersion = (IBase*)(pBaseVersion); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26433,21 +27077,21 @@ LibMCEnvResult libmcenv_machineconfigurationtype_registerconfigurationxsdfromres } } -LibMCEnvResult libmcenv_machineconfigurationtype_getlatestconfiguration(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance) +LibMCEnvResult libmcenv_machineconfigurationtype_getlatestconfigurationversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, LibMCEnv_MachineConfigurationVersion * pVersion) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pConfigurationInstance == nullptr) + if (pVersion == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - IBase* pBaseConfigurationInstance(nullptr); + IBase* pBaseVersion(nullptr); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pBaseConfigurationInstance = pIMachineConfigurationType->GetLatestConfiguration(); + pBaseVersion = pIMachineConfigurationType->GetLatestConfigurationVersion(); - *pConfigurationInstance = (IBase*)(pBaseConfigurationInstance); + *pVersion = (IBase*)(pBaseVersion); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26461,21 +27105,52 @@ LibMCEnvResult libmcenv_machineconfigurationtype_getlatestconfiguration(LibMCEnv } } -LibMCEnvResult libmcenv_machineconfigurationtype_getactiveconfiguration(LibMCEnv_MachineConfigurationType pMachineConfigurationType, bool bFallBackToDefault, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance) +LibMCEnvResult libmcenv_machineconfigurationtype_setactiveconfigurationversion(LibMCEnv_MachineConfigurationType pMachineConfigurationType, const char * pVersionUUID) { IBase* pIBaseClass = (IBase *)pMachineConfigurationType; try { - if (pConfigurationInstance == nullptr) + if (pVersionUUID == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - IBase* pBaseConfigurationInstance(nullptr); + std::string sVersionUUID(pVersionUUID); IMachineConfigurationType* pIMachineConfigurationType = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationType) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pBaseConfigurationInstance = pIMachineConfigurationType->GetActiveConfiguration(bFallBackToDefault); + pIMachineConfigurationType->SetActiveConfigurationVersion(sVersionUUID); + + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + + +/************************************************************************************************************************* + Class implementation for MachineConfigurationTypeIterator +**************************************************************************************************************************/ +LibMCEnvResult libmcenv_machineconfigurationtypeiterator_getcurrent(LibMCEnv_MachineConfigurationTypeIterator pMachineConfigurationTypeIterator, LibMCEnv_MachineConfigurationType * pInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationTypeIterator; + + try { + if (pInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IBase* pBaseInstance(nullptr); + IMachineConfigurationTypeIterator* pIMachineConfigurationTypeIterator = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationTypeIterator) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseInstance = pIMachineConfigurationTypeIterator->GetCurrent(); - *pConfigurationInstance = (IBase*)(pBaseConfigurationInstance); + *pInstance = (IBase*)(pBaseInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26556,24 +27231,52 @@ LibMCEnvResult libmcenv_machineconfigurationhandler_hasmachineconfigurationtype( } } -LibMCEnvResult libmcenv_machineconfigurationhandler_getlatestconfiguration(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance) +LibMCEnvResult libmcenv_machineconfigurationhandler_listregisteredtypes(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, LibMCEnv_MachineConfigurationTypeIterator * pTypeIterator) { IBase* pIBaseClass = (IBase *)pMachineConfigurationHandler; try { - if (pSchemaType == nullptr) + if (pTypeIterator == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - if (pConfigurationInstance == nullptr) + IBase* pBaseTypeIterator(nullptr); + IMachineConfigurationHandler* pIMachineConfigurationHandler = dynamic_cast(pIBaseClass); + if (!pIMachineConfigurationHandler) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseTypeIterator = pIMachineConfigurationHandler->ListRegisteredTypes(); + + *pTypeIterator = (IBase*)(pBaseTypeIterator); + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + +LibMCEnvResult libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pTypeUUID, LibMCEnv_MachineConfigurationType * pTypeInstance) +{ + IBase* pIBaseClass = (IBase *)pMachineConfigurationHandler; + + try { + if (pTypeUUID == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - std::string sSchemaType(pSchemaType); - IBase* pBaseConfigurationInstance(nullptr); + if (pTypeInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + std::string sTypeUUID(pTypeUUID); + IBase* pBaseTypeInstance(nullptr); IMachineConfigurationHandler* pIMachineConfigurationHandler = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationHandler) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pBaseConfigurationInstance = pIMachineConfigurationHandler->GetLatestConfiguration(sSchemaType); + pBaseTypeInstance = pIMachineConfigurationHandler->FindConfigurationTypeByUUID(sTypeUUID); - *pConfigurationInstance = (IBase*)(pBaseConfigurationInstance); + *pTypeInstance = (IBase*)(pBaseTypeInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -26587,24 +27290,24 @@ LibMCEnvResult libmcenv_machineconfigurationhandler_getlatestconfiguration(LibMC } } -LibMCEnvResult libmcenv_machineconfigurationhandler_getactiveconfiguration(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, bool bFallBackToDefault, LibMCEnv_MachineConfigurationVersion * pConfigurationInstance) +LibMCEnvResult libmcenv_machineconfigurationhandler_findconfigurationtypebyschema(LibMCEnv_MachineConfigurationHandler pMachineConfigurationHandler, const char * pSchemaType, LibMCEnv_MachineConfigurationType * pTypeInstance) { IBase* pIBaseClass = (IBase *)pMachineConfigurationHandler; try { if (pSchemaType == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); - if (pConfigurationInstance == nullptr) + if (pTypeInstance == nullptr) throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); std::string sSchemaType(pSchemaType); - IBase* pBaseConfigurationInstance(nullptr); + IBase* pBaseTypeInstance(nullptr); IMachineConfigurationHandler* pIMachineConfigurationHandler = dynamic_cast(pIBaseClass); if (!pIMachineConfigurationHandler) throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); - pBaseConfigurationInstance = pIMachineConfigurationHandler->GetActiveConfiguration(sSchemaType, bFallBackToDefault); + pBaseTypeInstance = pIMachineConfigurationHandler->FindConfigurationTypeBySchema(sSchemaType); - *pConfigurationInstance = (IBase*)(pBaseConfigurationInstance); + *pTypeInstance = (IBase*)(pBaseTypeInstance); return LIBMCENV_SUCCESS; } catch (ELibMCEnvInterfaceException & Exception) { @@ -32064,6 +32767,34 @@ LibMCEnvResult libmcenv_uienvironment_getexternaleventresults(LibMCEnv_UIEnviron } } +LibMCEnvResult libmcenv_uienvironment_createmachineconfigurationhandler(LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_MachineConfigurationHandler * pMachineConfigurationHandlerInstance) +{ + IBase* pIBaseClass = (IBase *)pUIEnvironment; + + try { + if (pMachineConfigurationHandlerInstance == nullptr) + throw ELibMCEnvInterfaceException (LIBMCENV_ERROR_INVALIDPARAM); + IBase* pBaseMachineConfigurationHandlerInstance(nullptr); + IUIEnvironment* pIUIEnvironment = dynamic_cast(pIBaseClass); + if (!pIUIEnvironment) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDCAST); + + pBaseMachineConfigurationHandlerInstance = pIUIEnvironment->CreateMachineConfigurationHandler(); + + *pMachineConfigurationHandlerInstance = (IBase*)(pBaseMachineConfigurationHandlerInstance); + return LIBMCENV_SUCCESS; + } + catch (ELibMCEnvInterfaceException & Exception) { + return handleLibMCEnvException(pIBaseClass, Exception); + } + catch (std::exception & StdException) { + return handleStdException(pIBaseClass, StdException); + } + catch (...) { + return handleUnhandledException(pIBaseClass); + } +} + /************************************************************************************************************************* @@ -33687,46 +34418,84 @@ LibMCEnvResult LibMCEnv::Impl::LibMCEnv_GetProcAddress (const char * pProcName, *ppProcAddress = (void*) &libmcenv_usermanagementhandler_setuserpasswordbyuuid; if (sProcName == "libmcenv_usermanagementhandler_getactiveusers") *ppProcAddress = (void*) &libmcenv_usermanagementhandler_getactiveusers; - if (sProcName == "libmcenv_machineconfigurationversion_getschematype") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getschematype; - if (sProcName == "libmcenv_machineconfigurationversion_gettypename") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_gettypename; - if (sProcName == "libmcenv_machineconfigurationversion_gettypeuuid") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_gettypeuuid; - if (sProcName == "libmcenv_machineconfigurationversion_getxsdversion") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getxsdversion; - if (sProcName == "libmcenv_machineconfigurationversion_getxsdstring") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getxsdstring; + if (sProcName == "libmcenv_machineconfigurationxsd_getuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationxsd_getuuid; + if (sProcName == "libmcenv_machineconfigurationxsd_gettypeuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationxsd_gettypeuuid; + if (sProcName == "libmcenv_machineconfigurationxsd_getxsdversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationxsd_getxsdversion; + if (sProcName == "libmcenv_machineconfigurationxsd_getxsdstring") + *ppProcAddress = (void*) &libmcenv_machineconfigurationxsd_getxsdstring; + if (sProcName == "libmcenv_machineconfigurationxsd_gettimestamp") + *ppProcAddress = (void*) &libmcenv_machineconfigurationxsd_gettimestamp; + if (sProcName == "libmcenv_machineconfigurationxsditerator_getcurrent") + *ppProcAddress = (void*) &libmcenv_machineconfigurationxsditerator_getcurrent; + if (sProcName == "libmcenv_machineconfigurationversion_getversionuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getversionuuid; + if (sProcName == "libmcenv_machineconfigurationversion_getxsduuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getxsduuid; + if (sProcName == "libmcenv_machineconfigurationversion_getnumericversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getnumericversion; + if (sProcName == "libmcenv_machineconfigurationversion_getparentuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getparentuuid; if (sProcName == "libmcenv_machineconfigurationversion_getconfigurationxmlstring") *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getconfigurationxmlstring; - if (sProcName == "libmcenv_machineconfigurationversion_getconfigurationxmldocument") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getconfigurationxmldocument; - if (sProcName == "libmcenv_machineconfigurationversion_makeactive") - *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_makeactive; + if (sProcName == "libmcenv_machineconfigurationversion_getuseruuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_getuseruuid; + if (sProcName == "libmcenv_machineconfigurationversion_gettimestamp") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_gettimestamp; + if (sProcName == "libmcenv_machineconfigurationversion_createnewversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_createnewversion; + if (sProcName == "libmcenv_machineconfigurationversion_migratetonewxsd") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversion_migratetonewxsd; + if (sProcName == "libmcenv_machineconfigurationversioniterator_getcurrent") + *ppProcAddress = (void*) &libmcenv_machineconfigurationversioniterator_getcurrent; + if (sProcName == "libmcenv_machineconfigurationtype_getuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getuuid; + if (sProcName == "libmcenv_machineconfigurationtype_getname") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getname; if (sProcName == "libmcenv_machineconfigurationtype_getschematype") *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getschematype; - if (sProcName == "libmcenv_machineconfigurationtype_gettypename") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_gettypename; - if (sProcName == "libmcenv_machineconfigurationtype_gettypeuuid") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_gettypeuuid; - if (sProcName == "libmcenv_machineconfigurationtype_getlatestxsdversion") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getlatestxsdversion; - if (sProcName == "libmcenv_machineconfigurationtype_registerconfigurationxsd") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_registerconfigurationxsd; - if (sProcName == "libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_registerconfigurationxsdfromresource; - if (sProcName == "libmcenv_machineconfigurationtype_getlatestconfiguration") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getlatestconfiguration; - if (sProcName == "libmcenv_machineconfigurationtype_getactiveconfiguration") - *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getactiveconfiguration; + if (sProcName == "libmcenv_machineconfigurationtype_gettimestamp") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_gettimestamp; + if (sProcName == "libmcenv_machineconfigurationtype_getlatestxsd") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getlatestxsd; + if (sProcName == "libmcenv_machineconfigurationtype_listxsdversions") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_listxsdversions; + if (sProcName == "libmcenv_machineconfigurationtype_getlatestxsdnumericversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getlatestxsdnumericversion; + if (sProcName == "libmcenv_machineconfigurationtype_registernewxsd") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_registernewxsd; + if (sProcName == "libmcenv_machineconfigurationtype_findxsdbynumericversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_findxsdbynumericversion; + if (sProcName == "libmcenv_machineconfigurationtype_findxsdbyuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_findxsdbyuuid; + if (sProcName == "libmcenv_machineconfigurationtype_createdefaultconfiguration") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_createdefaultconfiguration; + if (sProcName == "libmcenv_machineconfigurationtype_listallconfigurationversions") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_listallconfigurationversions; + if (sProcName == "libmcenv_machineconfigurationtype_listconfigurationversionsforxsd") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_listconfigurationversionsforxsd; + if (sProcName == "libmcenv_machineconfigurationtype_findconfigurationversionbyuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_findconfigurationversionbyuuid; + if (sProcName == "libmcenv_machineconfigurationtype_getactiveconfigurationversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getactiveconfigurationversion; + if (sProcName == "libmcenv_machineconfigurationtype_getlatestconfigurationversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_getlatestconfigurationversion; + if (sProcName == "libmcenv_machineconfigurationtype_setactiveconfigurationversion") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtype_setactiveconfigurationversion; + if (sProcName == "libmcenv_machineconfigurationtypeiterator_getcurrent") + *ppProcAddress = (void*) &libmcenv_machineconfigurationtypeiterator_getcurrent; if (sProcName == "libmcenv_machineconfigurationhandler_registermachineconfigurationtype") *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_registermachineconfigurationtype; if (sProcName == "libmcenv_machineconfigurationhandler_hasmachineconfigurationtype") *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_hasmachineconfigurationtype; - if (sProcName == "libmcenv_machineconfigurationhandler_getlatestconfiguration") - *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_getlatestconfiguration; - if (sProcName == "libmcenv_machineconfigurationhandler_getactiveconfiguration") - *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_getactiveconfiguration; + if (sProcName == "libmcenv_machineconfigurationhandler_listregisteredtypes") + *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_listregisteredtypes; + if (sProcName == "libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid") + *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_findconfigurationtypebyuuid; + if (sProcName == "libmcenv_machineconfigurationhandler_findconfigurationtypebyschema") + *ppProcAddress = (void*) &libmcenv_machineconfigurationhandler_findconfigurationtypebyschema; if (sProcName == "libmcenv_stateenvironment_getmachinestate") *ppProcAddress = (void*) &libmcenv_stateenvironment_getmachinestate; if (sProcName == "libmcenv_stateenvironment_getpreviousstate") @@ -34061,6 +34830,8 @@ LibMCEnvResult LibMCEnv::Impl::LibMCEnv_GetProcAddress (const char * pProcName, *ppProcAddress = (void*) &libmcenv_uienvironment_getexternaleventparameters; if (sProcName == "libmcenv_uienvironment_getexternaleventresults") *ppProcAddress = (void*) &libmcenv_uienvironment_getexternaleventresults; + if (sProcName == "libmcenv_uienvironment_createmachineconfigurationhandler") + *ppProcAddress = (void*) &libmcenv_uienvironment_createmachineconfigurationhandler; if (sProcName == "libmcenv_getversion") *ppProcAddress = (void*) &libmcenv_getversion; if (sProcName == "libmcenv_getlasterror") diff --git a/Framework/InterfacesCore/libmcenv_types.hpp b/Framework/InterfacesCore/libmcenv_types.hpp index 74169629..54d8562e 100644 --- a/Framework/InterfacesCore/libmcenv_types.hpp +++ b/Framework/InterfacesCore/libmcenv_types.hpp @@ -346,6 +346,7 @@ typedef void * LibMCEnv_pvoid; #define LIBMCENV_ERROR_UNDEFINEDINTERNALSIGNALPHASE 10249 /** Undefined internal signal phase. */ #define LIBMCENV_ERROR_INVALIDREACTIONTIMEOUT 10250 /** Invalid reaction timeout. */ #define LIBMCENV_ERROR_COULDNOTSETREACTIONTIMEOUT 10251 /** Could not set reaction timeout. */ +#define LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED 10252 /** Schema type already registered, but with a different name. */ /************************************************************************************************************************* Error strings for LibMCEnv @@ -604,6 +605,7 @@ inline const char * LIBMCENV_GETERRORSTRING (LibMCEnvResult nErrorCode) { case LIBMCENV_ERROR_UNDEFINEDINTERNALSIGNALPHASE: return "Undefined internal signal phase."; case LIBMCENV_ERROR_INVALIDREACTIONTIMEOUT: return "Invalid reaction timeout."; case LIBMCENV_ERROR_COULDNOTSETREACTIONTIMEOUT: return "Could not set reaction timeout."; + case LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED: return "Schema type already registered, but with a different name."; default: return "unknown error"; } } @@ -683,8 +685,12 @@ typedef LibMCEnvHandle LibMCEnv_LogEntryList; typedef LibMCEnvHandle LibMCEnv_JournalHandler; typedef LibMCEnvHandle LibMCEnv_UserDetailList; typedef LibMCEnvHandle LibMCEnv_UserManagementHandler; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationXSD; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationXSDIterator; typedef LibMCEnvHandle LibMCEnv_MachineConfigurationVersion; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationVersionIterator; typedef LibMCEnvHandle LibMCEnv_MachineConfigurationType; +typedef LibMCEnvHandle LibMCEnv_MachineConfigurationTypeIterator; typedef LibMCEnvHandle LibMCEnv_MachineConfigurationHandler; typedef LibMCEnvHandle LibMCEnv_StateEnvironment; typedef LibMCEnvHandle LibMCEnv_UIItem; diff --git a/Implementation/DataModel/amcdata_databasemigrator_machineconfiguration.cpp b/Implementation/DataModel/amcdata_databasemigrator_machineconfiguration.cpp index 5dbfa0a0..10a480a1 100644 --- a/Implementation/DataModel/amcdata_databasemigrator_machineconfiguration.cpp +++ b/Implementation/DataModel/amcdata_databasemigrator_machineconfiguration.cpp @@ -45,25 +45,26 @@ namespace AMCData { sConfigurationTypes += "`uuid` varchar ( 64 ) UNIQUE NOT NULL,"; sConfigurationTypes += "`name` varchar ( 256 ) NOT NULL,"; sConfigurationTypes += "`schematype` varchar ( 64 ) NOT NULL,"; - sConfigurationTypes += "`activeversionuuid` varchar ( 256 ) NOT NULL,"; + sConfigurationTypes += "`activeversionuuid` varchar ( 64 ) NOT NULL,"; sConfigurationTypes += "`timestamp` varchar ( 64 ) NOT NULL)"; pTransaction->executeStatement(sConfigurationTypes); std::string sConfigurationXSDs = "CREATE TABLE `machineconfiguration_xsds` ("; sConfigurationXSDs += "`uuid` varchar ( 64 ) UNIQUE NOT NULL,"; - sConfigurationXSDs += "`typeuuid` varchar ( 256 ) NOT NULL,"; + sConfigurationXSDs += "`typeuuid` varchar ( 64 ) NOT NULL,"; sConfigurationXSDs += "`schemaversionnumber` INTEGER NOT NULL,"; sConfigurationXSDs += "`configurationxsdstring` text NOT NULL,"; - sConfigurationXSDs += "`defaultconfigurationxml` text NOT NULL,"; + //sConfigurationXSDs += "`defaultconfigurationxml` text NOT NULL,"; sConfigurationXSDs += "`timestamp` varchar ( 64 ) NOT NULL)"; pTransaction->executeStatement(sConfigurationXSDs); std::string sVersions = "CREATE TABLE `machineconfiguration_versions` ("; sVersions += "`uuid` varchar ( 64 ) UNIQUE NOT NULL,"; - sVersions += "`xsduuid` varchar ( 256 ) NOT NULL,"; - sVersions += "`parentversionuuid` varchar ( 256 ) NOT NULL,"; + sVersions += "`xsduuid` varchar ( 64 ) NOT NULL,"; + sVersions += "`configurationversionnumber` INTEGER NOT NULL,"; + sVersions += "`parentversionuuid` varchar ( 64 ) NOT NULL,"; sVersions += "`configurationxmlstring` text NOT NULL,"; - sVersions += "`useruuid` varchar ( 256 ) NOT NULL,"; + sVersions += "`useruuid` varchar ( 64 ) NOT NULL,"; sVersions += "`timestamp` varchar ( 64 ) NOT NULL)"; pTransaction->executeStatement(sVersions); diff --git a/Implementation/LibMCData/libmcdata_datamodel.cpp b/Implementation/LibMCData/libmcdata_datamodel.cpp index b00b4f1f..4b4ec338 100644 --- a/Implementation/LibMCData/libmcdata_datamodel.cpp +++ b/Implementation/LibMCData/libmcdata_datamodel.cpp @@ -290,6 +290,11 @@ void CDataModel::TriggerLogCallback(const std::string& sLogMessage, const std::s m_pLogCallback(sLogMessage.c_str(), sSubSystem.c_str(), eLogLevel, sTimestamp.c_str (), m_pLogUserData); } +IMachineConfigurationTypeIterator* CDataModel::ListRegisteredConfigurationTypes() +{ + return CMachineConfigurationType::listRegisteredConfigurationTypes(m_pSQLHandler); +} + IMachineConfigurationType* CDataModel::FindConfigurationTypeBySchema(const std::string& sSchemaType) { return CMachineConfigurationType::makeBySchema (m_pSQLHandler, sSchemaType); diff --git a/Implementation/LibMCData/libmcdata_datamodel.hpp b/Implementation/LibMCData/libmcdata_datamodel.hpp index 50eae355..30823400 100644 --- a/Implementation/LibMCData/libmcdata_datamodel.hpp +++ b/Implementation/LibMCData/libmcdata_datamodel.hpp @@ -120,6 +120,8 @@ class CDataModel : public virtual IDataModel, public virtual CBase { void TriggerLogCallback(const std::string& sLogMessage, const std::string& sSubSystem, const LibMCData::eLogLevel eLogLevel, const std::string& sTimestamp) override; + IMachineConfigurationTypeIterator* ListRegisteredConfigurationTypes() override; + IMachineConfigurationType* FindConfigurationTypeBySchema(const std::string& sSchemaType) override; IMachineConfigurationType* FindConfigurationTypeByUUID(const std::string& sUUID) override; diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationtype.cpp b/Implementation/LibMCData/libmcdata_machineconfigurationtype.cpp index 32b4e7bb..ad29d97a 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationtype.cpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationtype.cpp @@ -36,6 +36,12 @@ Abstract: This is a stub class definition of CMachineConfigurationType // Include custom headers here. #include "common_utils.hpp" +#include "common_chrono.hpp" + +#include "libmcdata_machineconfigurationxsd.hpp" +#include "libmcdata_machineconfigurationversion.hpp" +#include "libmcdata_machineconfigurationversioniterator.hpp" +#include "libmcdata_machineconfigurationtypeiterator.hpp" using namespace LibMCData::Impl; @@ -43,12 +49,30 @@ using namespace LibMCData::Impl; Class definition of CMachineConfigurationType **************************************************************************************************************************/ +CMachineConfigurationType* CMachineConfigurationType::makeFrom(CMachineConfigurationType* pMachineConfigurationType) +{ + if (pMachineConfigurationType == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + return new CMachineConfigurationType( + pMachineConfigurationType->GetSQLHandler(), + pMachineConfigurationType->GetUUID(), + pMachineConfigurationType->GetName(), + pMachineConfigurationType->GetSchemaType(), + pMachineConfigurationType->GetTimestamp()); +} + CMachineConfigurationType* CMachineConfigurationType::makeBySchema(AMCData::PSQLHandler pSQLHandler, const std::string& sSchemaType) { if (pSQLHandler.get() == nullptr) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); - auto pStatement = pSQLHandler->prepareStatement("SELECT uuid, name, schematype, timestamp FROM machineconfiguration_types WHERE schematype = ?"); + if (sSchemaType.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Machine configuration Schema Type is empty."); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, name, schematype, timestamp FROM machineconfiguration_types WHERE schematype = ?"); + pStatement->setString(1, sSchemaType); if (pStatement->nextRow()) { std::string sDBUUID = pStatement->getColumnString(1); @@ -59,23 +83,85 @@ CMachineConfigurationType* CMachineConfigurationType::makeBySchema(AMCData::PSQL return new CMachineConfigurationType(pSQLHandler, sDBUUID, sDBName, sDBSchemaType, sDBTimestamp); } else { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE, sSchemaType); + return nullptr; } - } CMachineConfigurationType* CMachineConfigurationType::makeByUUID(AMCData::PSQLHandler pSQLHandler, const std::string& sUUID) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Machine configuration Type UUID is empty."); + + std::string sNormalizedUUID = AMCCommon::CUtils::normalizeUUIDString(sUUID); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, name, schematype, timestamp FROM machineconfiguration_types WHERE uuid = ?"); + + pStatement->setString(1, sNormalizedUUID); + if (!pStatement->nextRow()) + return nullptr; // Type not found + + std::string sDBUUID = pStatement->getColumnString(1); + std::string sDBName = pStatement->getColumnString(2); + std::string sDBSchemaType = pStatement->getColumnString(3); + std::string sDBTimestamp = pStatement->getColumnString(4); + + return new CMachineConfigurationType(pSQLHandler, sDBUUID, sDBName, sDBSchemaType, sDBTimestamp); } CMachineConfigurationType* CMachineConfigurationType::createNewConfigurationType(AMCData::PSQLHandler pSQLHandler, const std::string& sSchemaType, const std::string& sName) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + auto sNewCfgUUID = AMCCommon::CUtils::createUUID(); + AMCCommon::CChrono chrono; + auto sTimeStamp = chrono.getUTCTimeInISO8601(); + + auto pStatement = pSQLHandler->prepareStatement( + "INSERT INTO machineconfiguration_types (uuid, name, schematype, activeversionuuid, timestamp) " + "VALUES (?, ?, ?, ?, ?)"); + pStatement->setString(1, sNewCfgUUID); + pStatement->setString(2, sName); + pStatement->setString(3, sSchemaType); + pStatement->setString(4, "00000000-0000-0000-0000-000000000000"); + pStatement->setString(5, sTimeStamp); + + pStatement->execute(); + pStatement = nullptr; + + return makeBySchema(pSQLHandler, sSchemaType); } +IMachineConfigurationTypeIterator* CMachineConfigurationType::listRegisteredConfigurationTypes(AMCData::PSQLHandler pSQLHandler) +{ + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, name, schematype, timestamp FROM machineconfiguration_types " + "ORDER BY name ASC"); + + auto pIterator = std::make_unique(); + + while (pStatement->nextRow()) { + std::string sUUID = pStatement->getColumnString(1); + std::string sName = pStatement->getColumnString(2); + std::string sSchemaType = pStatement->getColumnString(3); + std::string sTimestamp = pStatement->getColumnString(4); + + auto pType = std::make_shared(pSQLHandler, sUUID, sName, sSchemaType, sTimestamp); + + pIterator->AddType(pType); + } + + return pIterator.release(); +} CMachineConfigurationType::CMachineConfigurationType(AMCData::PSQLHandler pSQLHandler, const std::string& sUUID, const std::string& sName, const std::string& sSchemaType, const std::string& sTimestamp) : m_pSQLHandler (pSQLHandler), @@ -86,14 +172,18 @@ CMachineConfigurationType::CMachineConfigurationType(AMCData::PSQLHandler pSQLHa { if (pSQLHandler.get() == nullptr) throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); - } - - CMachineConfigurationType::~CMachineConfigurationType() { +} + +AMCData::PSQLHandler CMachineConfigurationType::GetSQLHandler() +{ + if (m_pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + return m_pSQLHandler; } std::string CMachineConfigurationType::GetUUID() @@ -111,57 +201,134 @@ std::string CMachineConfigurationType::GetSchemaType() return m_sSchemaType; } -IMachineConfigurationXSD * CMachineConfigurationType::GetLatestXSD() +std::string CMachineConfigurationType::GetTimestamp() { - auto pStatement = m_pSQLHandler->prepareStatement("SELECT uuid, schemaversionnumber, defaultconfigurationxml FROM machineconfiguration_types WHERE typeuuid = ?"); - pStatement->setString(1, m_sUUID); + return m_sTimestamp; +} - if (pStatement->nextRow()) { +IMachineConfigurationXSD* CMachineConfigurationType::GetLatestXSD() +{ + return CMachineConfigurationXSD::getLatestXSDForType(m_pSQLHandler, m_sUUID); +} - } - else { - //throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE, sSchemaType); - } - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +IMachineConfigurationXSDIterator* CMachineConfigurationType::ListXSDVersions() +{ + return CMachineConfigurationXSD::listConfigurationXSDVersions(m_pSQLHandler, m_sUUID); +} + +LibMCData_uint32 CMachineConfigurationType::GetLatestXSDNumericVersion() +{ + return CMachineConfigurationXSD::getLatestXSDNumericVersionForType(m_pSQLHandler, m_sUUID); } -LibMCData_uint32 CMachineConfigurationType::GetLatestXSDVersion() +IMachineConfigurationXSD* CMachineConfigurationType::FindXSDByUUID(const std::string & sXSDUUID) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return CMachineConfigurationXSD::findXSDByUUID(m_pSQLHandler, sXSDUUID); } -IMachineConfigurationXSD * CMachineConfigurationType::FindXSDByUUID(const std::string & sXSDUUID) +IMachineConfigurationXSD* CMachineConfigurationType::FindXSDByNumericVersion(const LibMCData_uint32 nXSDNumericVersion) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return CMachineConfigurationXSD::findXSDByNumericVersion(m_pSQLHandler, nXSDNumericVersion); } -IMachineConfigurationXSD * CMachineConfigurationType::CreateNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) +IMachineConfigurationXSD* CMachineConfigurationType::RegisterNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return CMachineConfigurationXSD::createNewXSDForType(m_pSQLHandler, m_sUUID, sXSDString, nXSDVersion); } -IMachineConfigurationXSD * CMachineConfigurationType::GetXSDVersion(const LibMCData_uint32 nXSDVersion) +IMachineConfigurationVersion* CMachineConfigurationType::CreateDefaultConfiguration(const std::string& sXSDUUID, const std::string& sDefaultXML, const std::string& sTimeStampUTC) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return CMachineConfigurationVersion::createDefaultConfigurationForXSD(m_pSQLHandler, sXSDUUID, sDefaultXML, sTimeStampUTC); +} + +IMachineConfigurationVersionIterator* CMachineConfigurationType::ListAllConfigurationVersions() +{ + auto pReturnIterator = std::make_unique(); + + auto pXSDIterator = ListXSDVersions(); + while (pXSDIterator->MoveNext()) { + auto pXSDVersion = pXSDIterator->GetCurrent(); + if (pXSDVersion != nullptr) { + auto pVersionIterator = ListConfigurationVersionsForXSD(pXSDVersion->GetUUID()); + while (pVersionIterator->MoveNext()) { + auto pConfigurationVersion = dynamic_cast(pVersionIterator->GetCurrent()); + if (pConfigurationVersion != nullptr) + pReturnIterator->AddVersion(CMachineConfigurationVersion::makeSharedFrom(pConfigurationVersion)); + } + } + } + + return pReturnIterator.release(); } -IMachineConfigurationVersionIterator * CMachineConfigurationType::ListVersions() +IMachineConfigurationVersionIterator* CMachineConfigurationType::ListConfigurationVersionsForXSD(const std::string& sXSDUUID) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return CMachineConfigurationVersion::listConfigurationVersionsForXSD(m_pSQLHandler, sXSDUUID); } -IMachineConfigurationVersion * CMachineConfigurationType::FindVersionByUUID(const std::string & sVersionUUID) +IMachineConfigurationVersion* CMachineConfigurationType::FindConfigurationVersionByUUID(const std::string & sVersionUUID) { throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); } -IMachineConfigurationVersion * CMachineConfigurationType::GetActiveVersion(const std::string & sVersionUUID) +IMachineConfigurationVersion* CMachineConfigurationType::GetActiveConfigurationVersion() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (m_pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + auto pStatement = m_pSQLHandler->prepareStatement( + "SELECT activeversionuuid FROM machineconfiguration_types WHERE uuid = ?" + ); + pStatement->setString(1, m_sUUID); + + if (!pStatement->nextRow()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONTYPE, m_sUUID); + + std::string sActiveVersionUUID = pStatement->getColumnString(1); + sActiveVersionUUID = AMCCommon::CUtils::normalizeUUIDString(sActiveVersionUUID); + + if (sActiveVersionUUID.empty() || sActiveVersionUUID == "00000000-0000-0000-0000-000000000000") + return nullptr; + + // Create instance of MachineConfigurationVersion from UUID + return CMachineConfigurationVersion::findConfigurationVersionByUUID(m_pSQLHandler, sActiveVersionUUID); } -IMachineConfigurationVersion * CMachineConfigurationType::GetLatestVersion() +IMachineConfigurationVersion* CMachineConfigurationType::GetLatestConfigurationVersion() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + auto pLatestXSD = CMachineConfigurationXSD::getLatestXSDForType(m_pSQLHandler, m_sUUID); + + return CMachineConfigurationVersion::getLatestConfigurationVersionForXSD(m_pSQLHandler, pLatestXSD->GetUUID()); } +void CMachineConfigurationType::SetActiveConfigurationVersion(const std::string& sVersionUUID) +{ + if (m_pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedUUID = AMCCommon::CUtils::normalizeUUIDString(sVersionUUID); + + // Validate if the configuration version exists and matches this type + auto pVersion = CMachineConfigurationVersion::findConfigurationVersionByUUID(m_pSQLHandler, sNormalizedUUID); + if (pVersion == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONVERSIONBYUUID, "Configuration version with UUID = " + sVersionUUID + " is not found"); + + // Ensure this version belongs to the current configuration type + std::string sVersionXSDUUID = pVersion->GetXSDUUID(); + auto pXSD = CMachineConfigurationXSD::findXSDByUUID(m_pSQLHandler, sVersionXSDUUID); + if (pXSD == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID, "Configuration XSD with UUID = " + sVersionXSDUUID + " is not found"); + + std::string sXSDTypeUUID = pXSD->GetTypeUUID(); + if (sXSDTypeUUID != m_sUUID) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_MACHINECONFIGURATIONTYPEMISMATCH, "Configuration XSD for requested version has type " + pXSD->GetTypeUUID() + " but current type is " + m_sUUID); + + // Perform the update + auto pStatement = m_pSQLHandler->prepareStatement( + "UPDATE machineconfiguration_types SET activeversionuuid = ? WHERE uuid = ?" + ); + + pStatement->setString(1, sNormalizedUUID); + pStatement->setString(2, m_sUUID); + pStatement->execute(); +} \ No newline at end of file diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationtype.hpp b/Implementation/LibMCData/libmcdata_machineconfigurationtype.hpp index 32b9516b..911e20d1 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationtype.hpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationtype.hpp @@ -46,6 +46,7 @@ Abstract: This is the class declaration of CMachineConfigurationType // Include custom headers here. #include "amcdata_sqlhandler.hpp" +//#include "libmcdata_machineconfigurationtypeiterator.hpp" namespace LibMCData { namespace Impl { @@ -66,40 +67,55 @@ class CMachineConfigurationType : public virtual IMachineConfigurationType, publ public: + static CMachineConfigurationType* makeFrom(CMachineConfigurationType* pMachineConfigurationType); + static CMachineConfigurationType* makeBySchema (AMCData::PSQLHandler pSQLHandler, const std::string& sSchemaType); static CMachineConfigurationType* makeByUUID (AMCData::PSQLHandler pSQLHandler, const std::string& sUUID); static CMachineConfigurationType* createNewConfigurationType(AMCData::PSQLHandler pSQLHandler, const std::string& sSchemaType, const std::string & sName); + static IMachineConfigurationTypeIterator* listRegisteredConfigurationTypes(AMCData::PSQLHandler pSQLHandler); + CMachineConfigurationType(AMCData::PSQLHandler pSQLHandler, const std::string & sUUID, const std::string& sName, const std::string& sSchemaType, const std::string& sTimestamp); virtual ~CMachineConfigurationType(); + AMCData::PSQLHandler GetSQLHandler(); + std::string GetUUID() override; std::string GetName() override; std::string GetSchemaType() override; - IMachineConfigurationXSD * GetLatestXSD() override; + std::string GetTimestamp() override; + + IMachineConfigurationXSD* GetLatestXSD() override; + + IMachineConfigurationXSDIterator* ListXSDVersions() override; - LibMCData_uint32 GetLatestXSDVersion() override; + LibMCData_uint32 GetLatestXSDNumericVersion() override; - IMachineConfigurationXSD * FindXSDByUUID(const std::string & sXSDUUID) override; + IMachineConfigurationXSD* FindXSDByUUID(const std::string & sXSDUUID) override; - IMachineConfigurationXSD * CreateNewXSD(const std::string & sXSDString, const LibMCData_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) override; + IMachineConfigurationXSD* FindXSDByNumericVersion(const LibMCData_uint32 nXSDNumericVersion) override; - IMachineConfigurationXSD * GetXSDVersion(const LibMCData_uint32 nXSDVersion) override; + IMachineConfigurationXSD* RegisterNewXSD(const std::string& sXSDString, const LibMCData_uint32 nXSDVersion) override; - IMachineConfigurationVersionIterator * ListVersions() override; + IMachineConfigurationVersion* CreateDefaultConfiguration(const std::string& sXSDUUID, const std::string& sDefaultXML, const std::string& sTimeStampUTC) override; + + IMachineConfigurationVersionIterator* ListAllConfigurationVersions() override; + + IMachineConfigurationVersionIterator* ListConfigurationVersionsForXSD(const std::string& sXSDUUID) override; - IMachineConfigurationVersion * FindVersionByUUID(const std::string & sVersionUUID) override; + IMachineConfigurationVersion* FindConfigurationVersionByUUID(const std::string & sVersionUUID) override; - IMachineConfigurationVersion * GetActiveVersion(const std::string & sVersionUUID) override; + IMachineConfigurationVersion* GetActiveConfigurationVersion() override; - IMachineConfigurationVersion * GetLatestVersion() override; + IMachineConfigurationVersion* GetLatestConfigurationVersion() override; + void SetActiveConfigurationVersion(const std::string& sVersionUUID) override; }; } // namespace Impl diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationtypeiterator.cpp b/Implementation/LibMCData/libmcdata_machineconfigurationtypeiterator.cpp new file mode 100644 index 00000000..4f4e8078 --- /dev/null +++ b/Implementation/LibMCData/libmcdata_machineconfigurationtypeiterator.cpp @@ -0,0 +1,69 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is a stub class definition of CMachineConfigurationTypeIterator + +*/ + +#include "libmcdata_machineconfigurationtypeiterator.hpp" +#include "libmcdata_interfaceexception.hpp" + +// Include custom headers here. + + +using namespace LibMCData::Impl; + +/************************************************************************************************************************* + Class definition of CMachineConfigurationTypeIterator +**************************************************************************************************************************/ + +void CMachineConfigurationTypeIterator::AddType(std::shared_ptr pType) +{ + if (!pType) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + m_List.push_back(pType); +} + +IMachineConfigurationType* CMachineConfigurationTypeIterator::GetCurrent() +{ + if ((m_nCurrentIndex < 0) || (m_nCurrentIndex >= m_List.size())) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDITERATOR); + + auto pType = std::dynamic_pointer_cast (m_List[m_nCurrentIndex]); + if (pType.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + return CMachineConfigurationType::makeFrom(pType.get()); +} + +IMachineConfigurationVersionIterator* CMachineConfigurationTypeIterator::Clone() +{ + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +} diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationtypeiterator.hpp b/Implementation/LibMCData/libmcdata_machineconfigurationtypeiterator.hpp new file mode 100644 index 00000000..9832b477 --- /dev/null +++ b/Implementation/LibMCData/libmcdata_machineconfigurationtypeiterator.hpp @@ -0,0 +1,96 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is the class declaration of CMachineConfigurationTypeIterator + +*/ + + +#ifndef __LIBMCDATA_MACHINECONFIGURATIONTYPEITERATOR +#define __LIBMCDATA_MACHINECONFIGURATIONTYPEITERATOR + +#include "libmcdata_interfaces.hpp" + +// Parent classes +#include "libmcdata_iterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "libmcdata_machineconfigurationtype.hpp" + +namespace LibMCData { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CMachineConfigurationTypeIterator +**************************************************************************************************************************/ + +class CMachineConfigurationTypeIterator : public virtual IMachineConfigurationTypeIterator, public virtual CIterator { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + void AddType(std::shared_ptr pType); + + IMachineConfigurationType* GetCurrent() override; + + IMachineConfigurationVersionIterator* Clone() override; + +}; + +} // namespace Impl +} // namespace LibMCData + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIBMCDATA_MACHINECONFIGURATIONTYPEITERATOR diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationversion.cpp b/Implementation/LibMCData/libmcdata_machineconfigurationversion.cpp index b7b81aa0..dea47d7c 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationversion.cpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationversion.cpp @@ -35,7 +35,9 @@ Abstract: This is a stub class definition of CMachineConfigurationVersion #include "libmcdata_interfaceexception.hpp" // Include custom headers here. - +#include "common_utils.hpp" +#include "common_chrono.hpp" +#include "libmcdata_machineconfigurationversioniterator.hpp" using namespace LibMCData::Impl; @@ -43,52 +45,317 @@ using namespace LibMCData::Impl; Class definition of CMachineConfigurationVersion **************************************************************************************************************************/ -std::string CMachineConfigurationVersion::GetVersionUUID() +CMachineConfigurationVersion::CMachineConfigurationVersion(AMCData::PSQLHandler pSQLHandler, const std::string& sUUID, const std::string& sXSDUUID, LibMCData_uint32 nConfigurationVersionNumber, const std::string& sParentUUID, const std::string& sConfigurationXML, const std::string& sUserUUID, const std::string& sTimestampUTC) + : m_pSQLHandler(pSQLHandler) + , m_sUUID(AMCCommon::CUtils::normalizeUUIDString(sUUID)) + , m_sXSDUUID(AMCCommon::CUtils::normalizeUUIDString(sXSDUUID)) + , m_nConfigurationVersionNumber(nConfigurationVersionNumber) + , m_sParentUUID(AMCCommon::CUtils::normalizeUUIDString(sParentUUID)) + , m_sConfigurationXML(sConfigurationXML) + , m_sUserUUID(sUserUUID) + , m_sTimestampUTC(sTimestampUTC) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sXSDUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty machine configuration XSDUUID"); + + if (sParentUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty parent configuration UUID"); + + if (sConfigurationXML.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty configuration XML string"); + + if (sUserUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty active user UUID"); + + if (sTimestampUTC.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty creation timestamp"); } -std::string CMachineConfigurationVersion::GetXSDUUID() +CMachineConfigurationVersion::~CMachineConfigurationVersion() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + } -std::string CMachineConfigurationVersion::GetTypeUUID() +CMachineConfigurationVersion* CMachineConfigurationVersion::makeFrom(CMachineConfigurationVersion* pMachineConfigurationVersion) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pMachineConfigurationVersion == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + return new CMachineConfigurationVersion( + pMachineConfigurationVersion->GetSQLHandler(), + pMachineConfigurationVersion->GetVersionUUID(), + pMachineConfigurationVersion->GetXSDUUID(), + pMachineConfigurationVersion->GetNumericVersion(), + pMachineConfigurationVersion->GetParentUUID(), + pMachineConfigurationVersion->GetConfigurationXMLString(), + pMachineConfigurationVersion->GetUserUUID(), + pMachineConfigurationVersion->GetTimestamp()); } -std::string CMachineConfigurationVersion::GetParentUUID() +std::shared_ptr CMachineConfigurationVersion::makeSharedFrom(CMachineConfigurationVersion* pMachineConfigurationVersion) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pMachineConfigurationVersion == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + return std::make_shared( + pMachineConfigurationVersion->GetSQLHandler(), + pMachineConfigurationVersion->GetVersionUUID(), + pMachineConfigurationVersion->GetXSDUUID(), + pMachineConfigurationVersion->GetNumericVersion(), + pMachineConfigurationVersion->GetParentUUID(), + pMachineConfigurationVersion->GetConfigurationXMLString(), + pMachineConfigurationVersion->GetUserUUID(), + pMachineConfigurationVersion->GetTimestamp()); } -std::string CMachineConfigurationVersion::GetSchemaType() +CMachineConfigurationVersion* CMachineConfigurationVersion::createDefaultConfigurationForXSD( AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID, const std::string& sConfigurationXML, const std::string& sTimestampUTC) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sXSDUUID.empty() || sConfigurationXML.empty() || sTimestampUTC.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedXSDUUID = AMCCommon::CUtils::normalizeUUIDString(sXSDUUID); + + // Create UUID and timestamp + std::string sNewUUID = AMCCommon::CUtils::createUUID(); + + // Insert new configuration version with 0 version number + uint32_t nConfigurationVersionNumber = 0; + + // Insert new configuration version with null parent UUID + std::string sParentUUID = "00000000-0000-0000-0000-000000000000"; + + // Insert new configuration version with null user UUID + std::string sUserUUID = "00000000-0000-0000-0000-000000000000"; + + auto pInsert = pSQLHandler->prepareStatement( + "INSERT INTO machineconfiguration_versions " + "(uuid, xsduuid, configurationversionnumber, parentversionuuid, configurationxmlstring, useruuid, timestamp) " + "VALUES (?, ?, ?, ?, ?, ?, ?)" + ); + + pInsert->setString(1, sNewUUID); + pInsert->setString(2, sNormalizedXSDUUID); + pInsert->setInt(3, nConfigurationVersionNumber); + pInsert->setString(4, sParentUUID); + pInsert->setString(5, sConfigurationXML); + pInsert->setString(6, sUserUUID); + pInsert->setString(7, sTimestampUTC); + + pInsert->execute(); + + // Construct object and return + return new CMachineConfigurationVersion(pSQLHandler, sNewUUID, sNormalizedXSDUUID, nConfigurationVersionNumber, sParentUUID, sConfigurationXML, sUserUUID, sTimestampUTC); } -LibMCData_uint32 CMachineConfigurationVersion::GetXSDVersion() +LibMCData_uint32 CMachineConfigurationVersion::getLatestConfigurationNumericVersionForXSD(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + LibMCData_uint32 nLatestVersion = 0; + + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedXSDUUID = AMCCommon::CUtils::normalizeUUIDString(sXSDUUID); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT MAX(configurationversionnumber) FROM machineconfiguration_versions WHERE xsduuid = ?" + ); + pStatement->setString(1, sNormalizedXSDUUID); + + if (pStatement->nextRow()) + nLatestVersion = static_cast(pStatement->getColumnInt(1)); + + return nLatestVersion; } -std::string CMachineConfigurationVersion::GetXSDString() +CMachineConfigurationVersion* CMachineConfigurationVersion::getLatestConfigurationVersionForXSD(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedXSDUUID = AMCCommon::CUtils::normalizeUUIDString(sXSDUUID); + + // Query the latest version entry for given XSD + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, xsduuid, configurationversionnumber, parentversionuuid, " + "configurationxmlstring, useruuid, timestamp " + "FROM machineconfiguration_versions " + "WHERE xsduuid = ? " + "ORDER BY configurationversionnumber DESC LIMIT 1" + ); + pStatement->setString(1, AMCCommon::CUtils::normalizeUUIDString(sNormalizedXSDUUID)); + + if (!pStatement->nextRow()) + return nullptr; // No versions exist + + std::string sUUID = pStatement->getColumnString(1); + std::string sXSDUUID_DB = pStatement->getColumnString(2); + LibMCData_uint32 nVersionNumber = static_cast(pStatement->getColumnInt(3)); + std::string sParentUUID = pStatement->getColumnString(4); + std::string sXML = pStatement->getColumnString(5); + std::string sUserUUID = pStatement->getColumnString(6); + std::string sTimestamp = pStatement->getColumnString(7); + + return new CMachineConfigurationVersion(pSQLHandler, sUUID, sXSDUUID_DB, nVersionNumber, sParentUUID, sXML, sUserUUID, sTimestamp); +} + +CMachineConfigurationVersion* CMachineConfigurationVersion::findConfigurationVersionByUUID(AMCData::PSQLHandler pSQLHandler, const std::string& sVersionUUID) +{ + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedVersionUUID = AMCCommon::CUtils::normalizeUUIDString(sVersionUUID); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, xsduuid, configurationversionnumber, parentversionuuid, " + "configurationxmlstring, useruuid, timestamp " + "FROM machineconfiguration_versions " + "WHERE uuid = ?" + ); + pStatement->setString(1, sNormalizedVersionUUID); + + if (!pStatement->nextRow()) + return nullptr; // No such configuration version found + + std::string sUUID = pStatement->getColumnString(1); + std::string sXSDUUID = pStatement->getColumnString(2); + LibMCData_uint32 nVersionNumber = static_cast(pStatement->getColumnInt(3)); + std::string sParentUUID = pStatement->getColumnString(4); + std::string sXML = pStatement->getColumnString(5); + std::string sUserUUID = pStatement->getColumnString(6); + std::string sTimestamp = pStatement->getColumnString(7); + + return new CMachineConfigurationVersion(pSQLHandler, sUUID, sXSDUUID, nVersionNumber, sParentUUID, sXML, sUserUUID, sTimestamp); +} + +IMachineConfigurationVersionIterator* CMachineConfigurationVersion::listConfigurationVersionsForXSD( + AMCData::PSQLHandler pSQLHandler, + const std::string& sXSDUUID) +{ + if (!pSQLHandler) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sXSDUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + auto pTransaction = pSQLHandler->beginTransaction(); + + std::string sQuery = + "SELECT uuid, configurationversionnumber, parentversionuuid, configurationxmlstring, useruuid, timestamp " + "FROM machineconfiguration_versions " + "WHERE xsduuid = ? " + "ORDER BY configurationversionnumber ASC;"; + + auto pStatement = pTransaction->prepareStatement(sQuery); + pStatement->setString(1, sXSDUUID); + + auto pIterator = std::make_unique(); + + while (pStatement->nextRow()) { + std::string sUUID = pStatement->getColumnString(1); + LibMCData_uint32 nVersionNumber = pStatement->getColumnInt(2); + std::string sParentUUID = pStatement->getColumnString(3); + std::string sXML = pStatement->getColumnString(4); + std::string sUserUUID = pStatement->getColumnString(5); + std::string sTimestamp = pStatement->getColumnString(6); + + auto pVersion = std::make_shared( + pSQLHandler, sUUID, sXSDUUID, nVersionNumber, sParentUUID, sXML, sUserUUID, sTimestamp); + + pIterator->AddVersion(pVersion); + } + + pTransaction->commit(); + + return pIterator.release(); +} + +AMCData::PSQLHandler CMachineConfigurationVersion::GetSQLHandler() +{ + return m_pSQLHandler; +} + +std::string CMachineConfigurationVersion::GetVersionUUID() +{ + return m_sUUID; +} + +std::string CMachineConfigurationVersion::GetXSDUUID() +{ + return m_sXSDUUID; +} + +LibMCData_uint32 CMachineConfigurationVersion::GetNumericVersion() +{ + return m_nConfigurationVersionNumber; +} + +std::string CMachineConfigurationVersion::GetParentUUID() +{ + return m_sParentUUID; } std::string CMachineConfigurationVersion::GetConfigurationXMLString() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return m_sConfigurationXML; } -IMachineConfigurationVersion * CMachineConfigurationVersion::CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) +std::string CMachineConfigurationVersion::GetUserUUID() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return m_sUserUUID; +} + +std::string CMachineConfigurationVersion::GetTimestamp() +{ + return m_sTimestampUTC; +} + +IMachineConfigurationVersion* CMachineConfigurationVersion::CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID) +{ + if (m_pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sXMLString.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty configuration XML string"); + + if (sUserUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty user UUID"); + + std::string sNormalizedUserUUID = AMCCommon::CUtils::normalizeUUIDString(sUserUUID); + + // Create new version with incremented version number + LibMCData_uint32 nNewVersionNumber = m_nConfigurationVersionNumber + 1; + + // Create new UUID + std::string sNewUUID = AMCCommon::CUtils::createUUID(); + + // Insert new configuration version + auto pInsert = m_pSQLHandler->prepareStatement( + "INSERT INTO machineconfiguration_versions " + "(uuid, xsduuid, configurationversionnumber, parentversionuuid, configurationxmlstring, useruuid, timestamp) " + "VALUES (?, ?, ?, ?, ?, ?, ?)" + ); + pInsert->setString(1, sNewUUID); + pInsert->setString(2, m_sXSDUUID); + pInsert->setInt(3, nNewVersionNumber); + pInsert->setString(4, m_sUUID); // Parent is the current version + pInsert->setString(5, sXMLString); + pInsert->setString(6, sNormalizedUserUUID); + + AMCCommon::CChrono chrono; + auto sTimeStampUTC = chrono.getUTCTimeInISO8601(); + + pInsert->setString(7, sTimeStampUTC); + pInsert->execute(); + return new CMachineConfigurationVersion(m_pSQLHandler, sNewUUID, m_sXSDUUID, nNewVersionNumber, m_sUUID, sXMLString, sNormalizedUserUUID, sTimeStampUTC); } -IMachineConfigurationVersion * CMachineConfigurationVersion::MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) +IMachineConfigurationVersion* CMachineConfigurationVersion::MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID) { throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); } diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationversion.hpp b/Implementation/LibMCData/libmcdata_machineconfigurationversion.hpp index 4945efd3..c91b67cb 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationversion.hpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationversion.hpp @@ -45,7 +45,7 @@ Abstract: This is the class declaration of CMachineConfigurationVersion #endif // Include custom headers here. - +#include "amcdata_sqlhandler.hpp" namespace LibMCData { namespace Impl { @@ -62,6 +62,16 @@ class CMachineConfigurationVersion : public virtual IMachineConfigurationVersion * Put private members here. */ + AMCData::PSQLHandler m_pSQLHandler; + + std::string m_sUUID; + std::string m_sXSDUUID; + LibMCData_uint32 m_nConfigurationVersionNumber; + std::string m_sParentUUID; + std::string m_sConfigurationXML; + std::string m_sUserUUID; + std::string m_sTimestampUTC; + protected: /** @@ -79,25 +89,43 @@ class CMachineConfigurationVersion : public virtual IMachineConfigurationVersion * Public member functions to implement. */ + CMachineConfigurationVersion(AMCData::PSQLHandler pSQLHandler, const std::string& sUUID, const std::string& sXSDUUID, LibMCData_uint32 nConfigurationVersionNumber, const std::string& sParentUUID, const std::string& sConfigurationXML, const std::string& sUserUUID, const std::string& sTimestampUTC); + + virtual ~CMachineConfigurationVersion(); + + static CMachineConfigurationVersion* makeFrom(CMachineConfigurationVersion* pMachineConfigurationVersion); + + static std::shared_ptr makeSharedFrom(CMachineConfigurationVersion* pMachineConfigurationVersion); + + static CMachineConfigurationVersion* createDefaultConfigurationForXSD( AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID, const std::string& sConfigurationXML, const std::string& sTimestampUTC); + + static LibMCData_uint32 getLatestConfigurationNumericVersionForXSD(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID); + + static CMachineConfigurationVersion* getLatestConfigurationVersionForXSD(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID); + + static CMachineConfigurationVersion* findConfigurationVersionByUUID(AMCData::PSQLHandler pSQLHandler, const std::string& sVersionUUID); + + static IMachineConfigurationVersionIterator* listConfigurationVersionsForXSD(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID); + + AMCData::PSQLHandler GetSQLHandler(); + std::string GetVersionUUID() override; std::string GetXSDUUID() override; - std::string GetTypeUUID() override; + LibMCData_uint32 GetNumericVersion() override; std::string GetParentUUID() override; - std::string GetSchemaType() override; - - LibMCData_uint32 GetXSDVersion() override; + std::string GetConfigurationXMLString() override; - std::string GetXSDString() override; + std::string GetUserUUID() override; - std::string GetConfigurationXMLString() override; + std::string GetTimestamp() override; - IMachineConfigurationVersion * CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) override; + IMachineConfigurationVersion* CreateNewVersion(const std::string & sXMLString, const std::string & sUserUUID) override; - IMachineConfigurationVersion * MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID, const std::string & sTimeStampUTC) override; + IMachineConfigurationVersion* MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string & sXMLString, const std::string & sUserUUID) override; }; diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.cpp b/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.cpp index bc78da11..c34c9b37 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.cpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.cpp @@ -42,9 +42,27 @@ using namespace LibMCData::Impl; /************************************************************************************************************************* Class definition of CMachineConfigurationVersionIterator **************************************************************************************************************************/ +void CMachineConfigurationVersionIterator::AddVersion(std::shared_ptr pVersion) +{ + if (!pVersion) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + m_List.push_back(pVersion); +} -IMachineConfigurationVersion * CMachineConfigurationVersionIterator::GetCurrentVersion() +IMachineConfigurationVersion* CMachineConfigurationVersionIterator::GetCurrent() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if ((m_nCurrentIndex < 0) || (m_nCurrentIndex >= m_List.size())) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDITERATOR); + + auto pConfiguration = std::dynamic_pointer_cast (m_List[m_nCurrentIndex]); + if (pConfiguration.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + return CMachineConfigurationVersion::makeFrom(pConfiguration.get()); } +IMachineConfigurationVersionIterator* CMachineConfigurationVersionIterator::Clone() +{ + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +} \ No newline at end of file diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.hpp b/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.hpp index 5d6650c0..2faaadf4 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.hpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationversioniterator.hpp @@ -45,6 +45,7 @@ Abstract: This is the class declaration of CMachineConfigurationVersionIterator #endif // Include custom headers here. +#include "libmcdata_machineconfigurationversion.hpp" namespace LibMCData { @@ -79,8 +80,11 @@ class CMachineConfigurationVersionIterator : public virtual IMachineConfiguratio * Public member functions to implement. */ - IMachineConfigurationVersion * GetCurrentVersion() override; + void AddVersion(std::shared_ptr pVersion); + IMachineConfigurationVersion* GetCurrent() override; + + IMachineConfigurationVersionIterator* Clone() override; }; } // namespace Impl diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationxsd.cpp b/Implementation/LibMCData/libmcdata_machineconfigurationxsd.cpp index e82603dd..3e2ef9aa 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationxsd.cpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationxsd.cpp @@ -35,7 +35,9 @@ Abstract: This is a stub class definition of CMachineConfigurationXSD #include "libmcdata_interfaceexception.hpp" // Include custom headers here. - +#include "common_utils.hpp" +#include "common_chrono.hpp" +#include "libmcdata_machineconfigurationxsditerator.hpp" using namespace LibMCData::Impl; @@ -43,33 +45,263 @@ using namespace LibMCData::Impl; Class definition of CMachineConfigurationXSD **************************************************************************************************************************/ -std::string CMachineConfigurationXSD::GetUUID() +CMachineConfigurationXSD::CMachineConfigurationXSD( AMCData::PSQLHandler pSQLHandler, const std::string& sUUID, const std::string& sTypeUUID, const LibMCData_uint32 nXSDVersion, const std::string& sXSDString, const std::string& sTimestamp) + : m_pSQLHandler(pSQLHandler) + , m_sUUID(AMCCommon::CUtils::normalizeUUIDString(sUUID)) + , m_sTypeUUID(AMCCommon::CUtils::normalizeUUIDString(sTypeUUID)) + , m_nXSDVersion(nXSDVersion) + , m_sXSDString(sXSDString) + , m_sTimestamp(sTimestamp) +{ + if (m_pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (m_sUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty machine configuration XSD UUID."); + + if (m_sTypeUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty machine configuration type UUID."); + + if (m_sXSDString.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty machine configuration XSD String"); +} + +CMachineConfigurationXSD::~CMachineConfigurationXSD() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); } -std::string CMachineConfigurationXSD::GetTypeUUID() +CMachineConfigurationXSD* CMachineConfigurationXSD::makeFrom(CMachineConfigurationXSD* pMachineConfigurationVersion) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pMachineConfigurationVersion == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + return new CMachineConfigurationXSD( + pMachineConfigurationVersion->GetSQLHandler(), + pMachineConfigurationVersion->GetUUID(), + pMachineConfigurationVersion->GetTypeUUID(), + pMachineConfigurationVersion->GetXSDVersion(), + pMachineConfigurationVersion->GetXSDString(), + pMachineConfigurationVersion->GetTimestamp()); } -std::string CMachineConfigurationXSD::GetSchemaType() +CMachineConfigurationXSD* CMachineConfigurationXSD::createNewXSDForType(AMCData::PSQLHandler pSQLHandler, const std::string& sTypeUUID, const std::string& sXSDString, const LibMCData_uint32 nXSDNumericVersion) { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sTypeUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty machine configuration type UUID."); + + if (sXSDString.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM, "Empty machine configuration XSD String"); + + std::string sNormalizedTypeUUID = AMCCommon::CUtils::normalizeUUIDString(sTypeUUID); + + // Ensure the configuration type exists + { + auto pCheckTypeUUIDStatement = pSQLHandler->prepareStatement("SELECT uuid FROM machineconfiguration_types WHERE uuid = ?"); + pCheckTypeUUIDStatement->setString(1, sNormalizedTypeUUID); + if (!pCheckTypeUUIDStatement->nextRow()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDMACHINECONFIGURATIONTYPEUUID); + } + + // Ensure the new version is strictly greater than the latest one + LibMCData_uint32 nLatestVersion = getLatestXSDNumericVersionForType(pSQLHandler, sNormalizedTypeUUID); + if (nXSDNumericVersion <= nLatestVersion) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_MACHINECONFIGURATIONXSDVERSIONNOTINCREMENTING); + + // Generate new UUID and timestamp + std::string sUUID = AMCCommon::CUtils::createUUID(); + + std::string sTimestamp = AMCCommon::CChrono().getUTCTimeInISO8601(); + + // Insert new XSD record into the database + auto pInsertStmt = pSQLHandler->prepareStatement( + "INSERT INTO machineconfiguration_xsds (uuid, typeuuid, schemaversionnumber, configurationxsdstring, timestamp) " + "VALUES (?, ?, ?, ?, ?)" + ); + + pInsertStmt->setString(1, sUUID); + pInsertStmt->setString(2, sNormalizedTypeUUID); + pInsertStmt->setInt(3, nXSDNumericVersion); + pInsertStmt->setString(4, sXSDString); + pInsertStmt->setString(5, sTimestamp); + pInsertStmt->execute(); + + // Return new XSD instance + return new CMachineConfigurationXSD(pSQLHandler, sUUID, sNormalizedTypeUUID, nXSDNumericVersion, sXSDString, sTimestamp); +} + +CMachineConfigurationXSD* CMachineConfigurationXSD::getLatestXSDForType(AMCData::PSQLHandler pSQLHandler, const std::string& sTypeUUID) +{ + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedTypeUUID = AMCCommon::CUtils::normalizeUUIDString(sTypeUUID); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, schemaversionnumber, configurationxsdstring, timestamp " + "FROM machineconfiguration_xsds WHERE typeuuid = ? " + "ORDER BY schemaversionnumber DESC LIMIT 1" + ); + pStatement->setString(1, sNormalizedTypeUUID); + + if (pStatement->nextRow()) { + std::string sUUID = pStatement->getColumnString(1); + LibMCData_uint32 nVersion = static_cast(pStatement->getColumnInt(2)); + std::string sXSDString = pStatement->getColumnString(3); + std::string sTimestamp = pStatement->getColumnString(4); + + return new CMachineConfigurationXSD(pSQLHandler, sUUID, sNormalizedTypeUUID, nVersion, sXSDString, sTimestamp); + } + + return nullptr; +} + +LibMCData_uint32 CMachineConfigurationXSD::getLatestXSDNumericVersionForType(AMCData::PSQLHandler pSQLHandler, const std::string& sTypeUUID) +{ + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedTypeUUID = AMCCommon::CUtils::normalizeUUIDString(sTypeUUID); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT MAX(schemaversionnumber) FROM machineconfiguration_xsds WHERE typeuuid = ?" + ); + pStatement->setString(1, sNormalizedTypeUUID); + + if (pStatement->nextRow()) { + if (pStatement->columnIsNull(1)) + return 0; + + return static_cast(pStatement->getColumnInt(1)); + } + + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTGETLATESTMACHINECONFIGURATIONXSDVERSION); +} + +CMachineConfigurationXSD* CMachineConfigurationXSD::findXSDByUUID(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID) +{ + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedXSDUUID = AMCCommon::CUtils::normalizeUUIDString(sXSDUUID); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, typeuuid, schemaversionnumber, configurationxsdstring, timestamp " + "FROM machineconfiguration_xsds WHERE uuid = ?" + ); + pStatement->setString(1, sNormalizedXSDUUID); + + if (!pStatement->nextRow()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_COULDNOTFINDMACHINECONFIGURATIONXSDBYUUID, "XSD not forund for UUID = " + sNormalizedXSDUUID); + + std::string sUUID = pStatement->getColumnString(1); + std::string sTypeUUID = pStatement->getColumnString(2); + LibMCData_uint32 nVersion = static_cast(pStatement->getColumnInt(3)); + std::string sXSDString = pStatement->getColumnString(4); + std::string sTimestamp = pStatement->getColumnString(5); + + return new CMachineConfigurationXSD(pSQLHandler, sUUID, sTypeUUID, nVersion, sXSDString, sTimestamp); +} + + +CMachineConfigurationXSD* CMachineConfigurationXSD::findXSDByNumericVersion(AMCData::PSQLHandler pSQLHandler, LibMCData_uint32 nXSDNumericVersion) +{ + if (pSQLHandler.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + auto pStatement = pSQLHandler->prepareStatement( + "SELECT uuid, typeuuid, schemaversionnumber, configurationxsdstring, timestamp " + "FROM machineconfiguration_xsds WHERE schemaversionnumber = ?" + ); + pStatement->setInt(1, nXSDNumericVersion); + + if (!pStatement->nextRow()) + return nullptr; // XSD not found + + std::string sUUID = pStatement->getColumnString(1); + std::string sTypeUUID = pStatement->getColumnString(2); + LibMCData_uint32 nVersion = static_cast(pStatement->getColumnInt(3)); + std::string sXSDString = pStatement->getColumnString(4); + std::string sTimestamp = pStatement->getColumnString(5); + + return new CMachineConfigurationXSD(pSQLHandler, sUUID, sTypeUUID, nVersion, sXSDString, sTimestamp); +} + +IMachineConfigurationXSDIterator* CMachineConfigurationXSD::listConfigurationXSDVersions(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID) +{ + if (!pSQLHandler) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + if (sXSDUUID.empty()) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + std::string sNormalizedXSDUUID = AMCCommon::CUtils::normalizeUUIDString(sXSDUUID); + + // Begin a transaction to ensure a consistent view of the data + auto pTransaction = pSQLHandler->beginTransaction(); + + // Prepare the SQL query to retrieve all XSD versions matching the given type UUID + std::string sQuery = + "SELECT uuid, schemaversionnumber, configurationxsdstring, timestamp " + "FROM machineconfiguration_xsds " + "WHERE typeuuid = ? " + "ORDER BY schemaversionnumber ASC;"; + + auto pStatement = pTransaction->prepareStatement(sQuery); + pStatement->setString(1, sNormalizedXSDUUID); + + // Create the iterator that will store the XSD version objects + auto pIterator = std::make_unique(); + + // Fetch each row and construct corresponding XSD objects + while (pStatement->nextRow()) { + std::string sUUID = pStatement->getColumnString(1); + LibMCData_uint32 nSchemaVersion = static_cast(pStatement->getColumnInt(2)); + std::string sXSDString = pStatement->getColumnString(3); + std::string sTimestamp = pStatement->getColumnString(4); + + // Create a new CMachineConfigurationXSD instance + auto pXSD = std::make_shared(pSQLHandler, sUUID, sNormalizedXSDUUID, nSchemaVersion, sXSDString, sTimestamp); + + // Add the object to the iterator + pIterator->AddXSDVersion(pXSD); + } + + // Commit the transaction after all rows have been processed + pTransaction->commit(); + + // Return the populated iterator + return pIterator.release(); +} + +AMCData::PSQLHandler CMachineConfigurationXSD::GetSQLHandler() +{ + return m_pSQLHandler; +} + +std::string CMachineConfigurationXSD::GetUUID() +{ + return m_sUUID; +} + +std::string CMachineConfigurationXSD::GetTypeUUID() +{ + return m_sTypeUUID; } LibMCData_uint32 CMachineConfigurationXSD::GetXSDVersion() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return m_nXSDVersion; } std::string CMachineConfigurationXSD::GetXSDString() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return m_sXSDString; } -IMachineConfigurationVersionIterator * CMachineConfigurationXSD::ListVersions() +std::string CMachineConfigurationXSD::GetTimestamp() { - throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); + return m_sTimestamp; } - diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationxsd.hpp b/Implementation/LibMCData/libmcdata_machineconfigurationxsd.hpp index 6ceb4be6..cb6fff53 100644 --- a/Implementation/LibMCData/libmcdata_machineconfigurationxsd.hpp +++ b/Implementation/LibMCData/libmcdata_machineconfigurationxsd.hpp @@ -45,6 +45,7 @@ Abstract: This is the class declaration of CMachineConfigurationXSD #endif // Include custom headers here. +#include "amcdata_sqlhandler.hpp" namespace LibMCData { @@ -62,35 +63,59 @@ class CMachineConfigurationXSD : public virtual IMachineConfigurationXSD, public * Put private members here. */ + AMCData::PSQLHandler m_pSQLHandler; + + std::string m_sUUID; + std::string m_sTypeUUID; + LibMCData_uint32 m_nXSDVersion; + std::string m_sXSDString; + std::string m_sTimestamp; + protected: /** * Put protected members here. */ - + public: /** * Put additional public members here. They will not be visible in the external API. */ + CMachineConfigurationXSD::CMachineConfigurationXSD(AMCData::PSQLHandler pSQLHandler, const std::string& sUUID, const std::string& sTypeUUID, const LibMCData_uint32 nXSDVersion, const std::string& sXSDString, const std::string& sTimestamp); + + virtual ~CMachineConfigurationXSD(); /** * Public member functions to implement. */ + static CMachineConfigurationXSD* makeFrom(CMachineConfigurationXSD* pMachineConfigurationVersion); + + static CMachineConfigurationXSD* createNewXSDForType(AMCData::PSQLHandler pSQLHandler, const std::string& sTypeUUID, const std::string& sXSDString, const LibMCData_uint32 nXSDNumericVersion); + + static CMachineConfigurationXSD* getLatestXSDForType(AMCData::PSQLHandler pSQLHandler, const std::string& sTypeUUID); + + static LibMCData_uint32 getLatestXSDNumericVersionForType(AMCData::PSQLHandler pSQLHandler, const std::string& sTypeUUID); + + static CMachineConfigurationXSD* findXSDByUUID(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID); + + static CMachineConfigurationXSD* findXSDByNumericVersion(AMCData::PSQLHandler pSQLHandler, LibMCData_uint32 nXSDNumericVersion); + + static IMachineConfigurationXSDIterator* listConfigurationXSDVersions(AMCData::PSQLHandler pSQLHandler, const std::string& sXSDUUID); + + AMCData::PSQLHandler GetSQLHandler(); + std::string GetUUID() override; std::string GetTypeUUID() override; - std::string GetSchemaType() override; - LibMCData_uint32 GetXSDVersion() override; std::string GetXSDString() override; - IMachineConfigurationVersionIterator * ListVersions() override; - + std::string GetTimestamp() override; }; } // namespace Impl diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationxsditerator.cpp b/Implementation/LibMCData/libmcdata_machineconfigurationxsditerator.cpp new file mode 100644 index 00000000..74b21dff --- /dev/null +++ b/Implementation/LibMCData/libmcdata_machineconfigurationxsditerator.cpp @@ -0,0 +1,69 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is a stub class definition of CMachineConfigurationXSDIterator + +*/ + +#include "libmcdata_machineconfigurationxsditerator.hpp" +#include "libmcdata_interfaceexception.hpp" + +// Include custom headers here. + + +using namespace LibMCData::Impl; + +/************************************************************************************************************************* + Class definition of CMachineConfigurationXSDIterator +**************************************************************************************************************************/ + +void CMachineConfigurationXSDIterator::AddXSDVersion(std::shared_ptr pVersion) +{ + if (!pVersion) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDPARAM); + + m_List.push_back(pVersion); +} + +IMachineConfigurationXSD* CMachineConfigurationXSDIterator::GetCurrent() +{ + if ((m_nCurrentIndex < 0) || (m_nCurrentIndex >= m_List.size())) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDITERATOR); + + auto pConfiguration = std::dynamic_pointer_cast (m_List[m_nCurrentIndex]); + if (pConfiguration.get() == nullptr) + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_INVALIDCAST); + + return CMachineConfigurationXSD::makeFrom(pConfiguration.get()); +} + +IMachineConfigurationXSDIterator* CMachineConfigurationXSDIterator::Clone() +{ + throw ELibMCDataInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +} diff --git a/Implementation/LibMCData/libmcdata_machineconfigurationxsditerator.hpp b/Implementation/LibMCData/libmcdata_machineconfigurationxsditerator.hpp new file mode 100644 index 00000000..244438e3 --- /dev/null +++ b/Implementation/LibMCData/libmcdata_machineconfigurationxsditerator.hpp @@ -0,0 +1,96 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is the class declaration of CMachineConfigurationXSDIterator + +*/ + + +#ifndef __LIBMCDATA_MACHINECONFIGURATIONXSDITERATOR +#define __LIBMCDATA_MACHINECONFIGURATIONXSDITERATOR + +#include "libmcdata_interfaces.hpp" + +// Parent classes +#include "libmcdata_iterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "libmcdata_machineconfigurationxsd.hpp" + +namespace LibMCData { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CMachineConfigurationXSDIterator +**************************************************************************************************************************/ + +class CMachineConfigurationXSDIterator : public virtual IMachineConfigurationXSDIterator, public virtual CIterator { +private: + + /** + * Put private members here. + */ + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + void AddXSDVersion(std::shared_ptr pVersion); + + IMachineConfigurationXSD* GetCurrent() override; + + IMachineConfigurationXSDIterator* Clone() override; + +}; + +} // namespace Impl +} // namespace LibMCData + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIBMCDATA_MACHINECONFIGURATIONXSDITERATOR diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.cpp index f5c8748a..32de92bf 100644 --- a/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.cpp +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.cpp @@ -36,7 +36,8 @@ Abstract: This is a stub class definition of CMachineConfigurationHandler #include "libmcenv_interfaceexception.hpp" // Include custom headers here. - +#include "libmcenv_machineconfigurationtypeiterator.hpp" +#include "common_utils.hpp" using namespace LibMCEnv::Impl; @@ -60,27 +61,61 @@ IMachineConfigurationType * CMachineConfigurationHandler::RegisterMachineConfigu auto pConfigurationType = m_pDataModel->FindConfigurationTypeBySchema(sSchemaType); if (pConfigurationType.get() != nullptr) { // Check if the name is equal + if (pConfigurationType->GetName() == sName) { + // Already registered + return new CMachineConfigurationType(pConfigurationType); + } + else { + // Schema type already registered, but with a different name + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_MACHINECONFIGURATIONSCHEMATYPEALREADYREGISTERED, "Schema type = " + sSchemaType + "is already registered, but with a different name = " + pConfigurationType->GetName()); + } } else { pConfigurationType = m_pDataModel->CreateConfigurationType(sSchemaType, sName); } - return new CMachineConfigurationType(pConfigurationType); - + return new CMachineConfigurationType(pConfigurationType); } bool CMachineConfigurationHandler::HasMachineConfigurationType(const std::string & sSchemaType) { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + if (sSchemaType.empty()) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM, "Schema type is empty."); + + auto pConfigurationType = m_pDataModel->FindConfigurationTypeBySchema(sSchemaType); + + return (pConfigurationType.get() != nullptr); } -IMachineConfigurationVersion * CMachineConfigurationHandler::GetLatestConfiguration(const std::string & sSchemaType) +IMachineConfigurationTypeIterator* CMachineConfigurationHandler::ListRegisteredTypes() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + auto pIterator = m_pDataModel->ListRegisteredConfigurationTypes(); + + if (pIterator.get() == nullptr) + return nullptr; + + return new CMachineConfigurationTypeIterator(pIterator); } -IMachineConfigurationVersion * CMachineConfigurationHandler::GetActiveConfiguration(const std::string & sSchemaType, const bool bFallBackToDefault) +IMachineConfigurationType* CMachineConfigurationHandler::FindConfigurationTypeByUUID(const std::string& sTypeUUID) { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + if (sTypeUUID.empty()) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM, "Configuration Type UUID is empty."); + + std::string sNormalizedUUID = AMCCommon::CUtils::normalizeUUIDString(sTypeUUID); + + auto pConfigurationType = m_pDataModel->FindConfigurationTypeByUUID(sNormalizedUUID); + if (pConfigurationType.get() == nullptr) + return nullptr; + + return new CMachineConfigurationType(pConfigurationType); } +IMachineConfigurationType* CMachineConfigurationHandler::FindConfigurationTypeBySchema(const std::string& sSchemaType) +{ + auto pConfigurationType = m_pDataModel->FindConfigurationTypeBySchema(sSchemaType); + if (pConfigurationType.get() == nullptr) + return nullptr; + + return new CMachineConfigurationType(pConfigurationType); +} \ No newline at end of file diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.hpp index 799e1dd7..45f01d94 100644 --- a/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.hpp +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationhandler.hpp @@ -64,16 +64,17 @@ class CMachineConfigurationHandler : public virtual IMachineConfigurationHandler CMachineConfigurationHandler (LibMCData::PDataModel pDataModel); - ~CMachineConfigurationHandler (); + virtual ~CMachineConfigurationHandler(); IMachineConfigurationType * RegisterMachineConfigurationType(const std::string & sSchemaType, const std::string & sName) override; bool HasMachineConfigurationType(const std::string & sSchemaType) override; - IMachineConfigurationVersion * GetLatestConfiguration(const std::string & sSchemaType) override; + IMachineConfigurationTypeIterator* ListRegisteredTypes() override; - IMachineConfigurationVersion * GetActiveConfiguration(const std::string & sSchemaType, const bool bFallBackToDefault) override; + IMachineConfigurationType* FindConfigurationTypeByUUID(const std::string& sTypeUUID) override; + IMachineConfigurationType* FindConfigurationTypeBySchema(const std::string& sSchemaType) override; }; } // namespace Impl diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.cpp index 2692fd20..05e07dc4 100644 --- a/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.cpp +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.cpp @@ -35,7 +35,10 @@ Abstract: This is a stub class definition of CMachineConfigurationType #include "libmcenv_interfaceexception.hpp" // Include custom headers here. - +#include "libmcenv_machineconfigurationxsd.hpp" +#include "libmcenv_machineconfigurationxsditerator.hpp" +#include "libmcenv_machineconfigurationversion.hpp" +#include "libmcenv_machineconfigurationversioniterator.hpp" using namespace LibMCEnv::Impl; @@ -51,7 +54,16 @@ CMachineConfigurationType::CMachineConfigurationType(LibMCData::PMachineConfigur CMachineConfigurationType::~CMachineConfigurationType() { +} +std::string CMachineConfigurationType::GetUUID() +{ + return m_pMachineConfigurationType->GetUUID(); +} + +std::string CMachineConfigurationType::GetName() +{ + return m_pMachineConfigurationType->GetName(); } std::string CMachineConfigurationType::GetSchemaType() @@ -59,38 +71,122 @@ std::string CMachineConfigurationType::GetSchemaType() return m_pMachineConfigurationType->GetSchemaType(); } -std::string CMachineConfigurationType::GetTypeName() +std::string CMachineConfigurationType::GetTimestamp() { - return m_pMachineConfigurationType->GetName(); + return m_pMachineConfigurationType->GetTimestamp(); } -std::string CMachineConfigurationType::GetTypeUUID() +IMachineConfigurationXSD* CMachineConfigurationType::GetLatestXSD() { - return m_pMachineConfigurationType->GetUUID(); + auto pConfigurationXSD = m_pMachineConfigurationType->GetLatestXSD(); + + if (pConfigurationXSD.get() == nullptr) + return nullptr; + + return new CMachineConfigurationXSD(pConfigurationXSD); +} + +IMachineConfigurationXSDIterator* CMachineConfigurationType::ListXSDVersions() +{ + auto pIterator = m_pMachineConfigurationType->ListXSDVersions(); + + if (pIterator.get() == nullptr) + return nullptr; + + return new CMachineConfigurationXSDIterator(pIterator); } -LibMCEnv_uint32 CMachineConfigurationType::GetLatestXSDVersion() +LibMCEnv_uint32 CMachineConfigurationType::GetLatestXSDNumericVersion() { - return m_pMachineConfigurationType->GetLatestXSDVersion(); + return m_pMachineConfigurationType->GetLatestXSDNumericVersion(); } -void CMachineConfigurationType::RegisterConfigurationXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) +IMachineConfigurationXSD* CMachineConfigurationType::RegisterNewXSD(const std::string& sXSDString, const LibMCEnv_uint32 nXSDVersion) { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + auto pConfigurationXSD = m_pMachineConfigurationType->RegisterNewXSD(sXSDString, nXSDVersion); + + if (pConfigurationXSD.get() == nullptr) + return nullptr; + + return new CMachineConfigurationXSD(pConfigurationXSD); } -void CMachineConfigurationType::RegisterConfigurationXSDFromResource(const std::string & sXSDResourceName, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationResourceName) +IMachineConfigurationVersion* CMachineConfigurationType::CreateDefaultConfiguration(const std::string & sXSDUUID, const std::string & sDefaultXML, const std::string & sTimeStampUTC) { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + auto pDefaultConfiguration = m_pMachineConfigurationType->CreateDefaultConfiguration(sXSDUUID, sDefaultXML, sTimeStampUTC); + + if (pDefaultConfiguration.get() == nullptr) + return nullptr; + + return new CMachineConfigurationVersion(pDefaultConfiguration); } -IMachineConfigurationVersion * CMachineConfigurationType::GetLatestConfiguration() +IMachineConfigurationXSD* CMachineConfigurationType::FindXSDByNumericVersion(const LibMCEnv_uint32 nXSDVersion) { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + auto pXSD = m_pMachineConfigurationType->FindXSDByNumericVersion(nXSDVersion); + + if (pXSD.get() == nullptr) + return nullptr; + + return new CMachineConfigurationXSD(pXSD); } -IMachineConfigurationVersion * CMachineConfigurationType::GetActiveConfiguration(const bool bFallBackToDefault) +IMachineConfigurationXSD* CMachineConfigurationType::FindXSDByUUID(const std::string& sXSDUUID) +{ + auto pXSD = m_pMachineConfigurationType->FindXSDByUUID(sXSDUUID); + + if (pXSD.get() == nullptr) + return nullptr; + + return new CMachineConfigurationXSD(pXSD); +} + +IMachineConfigurationVersionIterator* CMachineConfigurationType::ListAllConfigurationVersions() +{ + auto pIterator = m_pMachineConfigurationType->ListAllConfigurationVersions(); + + if (pIterator.get() == nullptr) + return nullptr; + + return new CMachineConfigurationVersionIterator(pIterator); +} + +IMachineConfigurationVersionIterator* CMachineConfigurationType::ListConfigurationVersionsForXSD(const std::string& sXSDUUID) +{ + auto pIterator = m_pMachineConfigurationType->ListConfigurationVersionsForXSD(sXSDUUID); + + if (pIterator.get() == nullptr) + return nullptr; + + return new CMachineConfigurationVersionIterator(pIterator); +} + +IMachineConfigurationVersion* CMachineConfigurationType::FindConfigurationVersionByUUID(const std::string& sVersionUUID) { throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); } +IMachineConfigurationVersion* CMachineConfigurationType::GetActiveConfigurationVersion() +{ + auto pMachineConfigurationVersion = m_pMachineConfigurationType->GetActiveConfigurationVersion(); + + if (pMachineConfigurationVersion.get() == nullptr) + return nullptr; + + return new CMachineConfigurationVersion(pMachineConfigurationVersion); +} + +IMachineConfigurationVersion* CMachineConfigurationType::GetLatestConfigurationVersion() +{ + auto pLatestConfiguration = m_pMachineConfigurationType->GetLatestConfigurationVersion(); + + if (pLatestConfiguration == nullptr) + return nullptr; + + return new CMachineConfigurationVersion(pLatestConfiguration); +} + +void CMachineConfigurationType::SetActiveConfigurationVersion(const std::string& sVersionUUID) +{ + m_pMachineConfigurationType->SetActiveConfigurationVersion(sVersionUUID); +} \ No newline at end of file diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.hpp index c885b60c..92ef6de6 100644 --- a/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.hpp +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationtype.hpp @@ -66,22 +66,39 @@ class CMachineConfigurationType : public virtual IMachineConfigurationType, publ virtual ~CMachineConfigurationType(); + std::string GetUUID() override; + + std::string GetName() override; + std::string GetSchemaType() override; - std::string GetTypeName() override; + std::string GetTimestamp() override; + + IMachineConfigurationXSD* GetLatestXSD() override; + + IMachineConfigurationXSDIterator* ListXSDVersions() override; + + LibMCEnv_uint32 GetLatestXSDNumericVersion() override; + + IMachineConfigurationXSD* RegisterNewXSD(const std::string& sXSDString, const LibMCEnv_uint32 nXSDVersion) override; - std::string GetTypeUUID() override; + IMachineConfigurationVersion* CreateDefaultConfiguration(const std::string& sXSDUUID, const std::string& sDefaultXML, const std::string& sTimeStampUTC) override; - LibMCEnv_uint32 GetLatestXSDVersion() override; + IMachineConfigurationXSD* FindXSDByNumericVersion(const LibMCEnv_uint32 nXSDVersion) override; - void RegisterConfigurationXSD(const std::string & sXSDString, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationXML) override; + IMachineConfigurationXSD* FindXSDByUUID(const std::string& sXSDUUID) override; - void RegisterConfigurationXSDFromResource(const std::string & sXSDResourceName, const LibMCEnv_uint32 nXSDVersion, const std::string & sDefaultConfigurationResourceName) override; + IMachineConfigurationVersionIterator* ListAllConfigurationVersions() override; + + IMachineConfigurationVersionIterator* ListConfigurationVersionsForXSD(const std::string& sXSDUUID) override; - IMachineConfigurationVersion * GetLatestConfiguration() override; + IMachineConfigurationVersion* FindConfigurationVersionByUUID(const std::string& sVersionUUID) override; - IMachineConfigurationVersion * GetActiveConfiguration(const bool bFallBackToDefault) override; + IMachineConfigurationVersion* GetActiveConfigurationVersion() override; + IMachineConfigurationVersion* GetLatestConfigurationVersion() override; + + void SetActiveConfigurationVersion(const std::string& sVersionUUID) override; }; } // namespace Impl diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationtypeiterator.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationtypeiterator.cpp new file mode 100644 index 00000000..2d04851a --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationtypeiterator.cpp @@ -0,0 +1,75 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is a stub class definition of CMachineConfigurationTypeIterator + +*/ + +#include "libmcenv_machineconfigurationtypeiterator.hpp" +#include "libmcenv_interfaceexception.hpp" + +// Include custom headers here. + + +using namespace LibMCEnv::Impl; + +/************************************************************************************************************************* + Class definition of CMachineConfigurationTypeIterator +**************************************************************************************************************************/ + +CMachineConfigurationTypeIterator::CMachineConfigurationTypeIterator(LibMCData::PMachineConfigurationTypeIterator pMachineConfigurationTypeIterator) + : m_pMachineConfigurationTypeIterator(pMachineConfigurationTypeIterator) +{ + if (pMachineConfigurationTypeIterator.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM); +} + +CMachineConfigurationTypeIterator::~CMachineConfigurationTypeIterator() +{ +} + +bool CMachineConfigurationTypeIterator::MoveNext() +{ + return m_pMachineConfigurationTypeIterator->MoveNext(); +} + +IMachineConfigurationType* CMachineConfigurationTypeIterator::GetCurrent() +{ + auto pCurrentConfigurationType = m_pMachineConfigurationTypeIterator->GetCurrent(); + + if (pCurrentConfigurationType.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCDATA_ERROR_INVALIDITERATOR); + + return new CMachineConfigurationType(pCurrentConfigurationType); +} + +IMachineConfigurationTypeIterator* CMachineConfigurationTypeIterator::Clone() +{ + throw ELibMCEnvInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +} \ No newline at end of file diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationtypeiterator.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationtypeiterator.hpp new file mode 100644 index 00000000..f1b55c32 --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationtypeiterator.hpp @@ -0,0 +1,102 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is the class declaration of CMachineConfigurationTypeIterator + +*/ + + +#ifndef __LIBMCENV_MACHINECONFIGURATIONTYPEITERATOR +#define __LIBMCENV_MACHINECONFIGURATIONTYPEITERATOR + +#include "libmcenv_interfaces.hpp" + +// Parent classes +#include "libmcenv_iterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "libmcenv_machineconfigurationtype.hpp" + +namespace LibMCEnv { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CMachineConfigurationTypeIterator +**************************************************************************************************************************/ + +class CMachineConfigurationTypeIterator : public virtual IMachineConfigurationTypeIterator, public virtual CIterator { +private: + + /** + * Put private members here. + */ + + LibMCData::PMachineConfigurationTypeIterator m_pMachineConfigurationTypeIterator; + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + CMachineConfigurationTypeIterator::CMachineConfigurationTypeIterator(LibMCData::PMachineConfigurationTypeIterator pMachineConfigurationTypeIterator); + + virtual ~CMachineConfigurationTypeIterator(); + + bool MoveNext() override; + + IMachineConfigurationType* GetCurrent() override; + + IMachineConfigurationTypeIterator* Clone() override; + +}; + +} // namespace Impl +} // namespace LibMCEnv + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIBMCENV_MACHINECONFIGURATIONTYPEITERATOR diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.cpp index ff16793f..37511431 100644 --- a/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.cpp +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.cpp @@ -43,43 +43,63 @@ using namespace LibMCEnv::Impl; Class definition of CMachineConfigurationVersion **************************************************************************************************************************/ -std::string CMachineConfigurationVersion::GetSchemaType() +CMachineConfigurationVersion::CMachineConfigurationVersion(LibMCData::PMachineConfigurationVersion pMachineConfigurationVersion) + : m_pMachineConfigurationVersion(pMachineConfigurationVersion) { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + if (pMachineConfigurationVersion.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM); } -std::string CMachineConfigurationVersion::GetTypeName() +CMachineConfigurationVersion::~CMachineConfigurationVersion() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); } -std::string CMachineConfigurationVersion::GetTypeUUID() +std::string CMachineConfigurationVersion::GetVersionUUID() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + return m_pMachineConfigurationVersion->GetVersionUUID(); } -LibMCEnv_uint32 CMachineConfigurationVersion::GetXSDVersion() +std::string CMachineConfigurationVersion::GetXSDUUID() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + return m_pMachineConfigurationVersion->GetXSDUUID(); } -std::string CMachineConfigurationVersion::GetXSDString() +LibMCEnv_uint32 CMachineConfigurationVersion::GetNumericVersion() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + return m_pMachineConfigurationVersion->GetNumericVersion(); +} + +std::string CMachineConfigurationVersion::GetParentUUID() +{ + return m_pMachineConfigurationVersion->GetParentUUID(); } std::string CMachineConfigurationVersion::GetConfigurationXMLString() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + return m_pMachineConfigurationVersion->GetConfigurationXMLString(); } -IXMLDocument * CMachineConfigurationVersion::GetConfigurationXMLDocument() +std::string CMachineConfigurationVersion::GetUserUUID() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + return m_pMachineConfigurationVersion->GetUserUUID(); } -void CMachineConfigurationVersion::MakeActive() +std::string CMachineConfigurationVersion::GetTimestamp() { - throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); + return m_pMachineConfigurationVersion->GetTimestamp(); } +IMachineConfigurationVersion* CMachineConfigurationVersion::CreateNewVersion(const std::string& sXMLString, const std::string& sUserUUID) +{ + auto pNewConfigurationVersion = m_pMachineConfigurationVersion->CreateNewVersion(sXMLString, sUserUUID); + + if (pNewConfigurationVersion.get() == nullptr) + return nullptr; + + return new CMachineConfigurationVersion(pNewConfigurationVersion); +} + +IMachineConfigurationVersion* CMachineConfigurationVersion::MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string& sXMLString, const std::string& sUserUUID) +{ + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_NOTIMPLEMENTED); +} \ No newline at end of file diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.hpp index e69256c1..bfbc11a8 100644 --- a/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.hpp +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationversion.hpp @@ -45,7 +45,7 @@ Abstract: This is the class declaration of CMachineConfigurationVersion #endif // Include custom headers here. - +#include "libmcdata_dynamic.hpp" namespace LibMCEnv { namespace Impl { @@ -62,6 +62,8 @@ class CMachineConfigurationVersion : public virtual IMachineConfigurationVersion * Put private members here. */ + LibMCData::PMachineConfigurationVersion m_pMachineConfigurationVersion; + protected: /** @@ -79,21 +81,27 @@ class CMachineConfigurationVersion : public virtual IMachineConfigurationVersion * Public member functions to implement. */ - std::string GetSchemaType() override; + CMachineConfigurationVersion(LibMCData::PMachineConfigurationVersion pMachineConfigurationVersion); + + virtual ~CMachineConfigurationVersion(); + + virtual std::string GetVersionUUID() override; + + virtual std::string GetXSDUUID() override; - std::string GetTypeName() override; + virtual LibMCEnv_uint32 GetNumericVersion() override; - std::string GetTypeUUID() override; + virtual std::string GetParentUUID() override; - LibMCEnv_uint32 GetXSDVersion() override; + virtual std::string GetConfigurationXMLString() override; - std::string GetXSDString() override; + virtual std::string GetUserUUID() override; - std::string GetConfigurationXMLString() override; + virtual std::string GetTimestamp() override; - IXMLDocument * GetConfigurationXMLDocument() override; + virtual IMachineConfigurationVersion* CreateNewVersion(const std::string& sXMLString, const std::string& sUserUUID) override; - void MakeActive() override; + virtual IMachineConfigurationVersion* MigrateToNewXSD(IMachineConfigurationXSD* pNewXSD, const std::string& sXMLString, const std::string& sUserUUID) override; }; diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationversioniterator.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationversioniterator.cpp new file mode 100644 index 00000000..adbcfcf3 --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationversioniterator.cpp @@ -0,0 +1,76 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is a stub class definition of CMachineConfigurationVersionIterator + +*/ + +#include "libmcenv_machineconfigurationversioniterator.hpp" +#include "libmcenv_interfaceexception.hpp" + +// Include custom headers here. + + +using namespace LibMCEnv::Impl; + +/************************************************************************************************************************* + Class definition of CMachineConfigurationVersionIterator +**************************************************************************************************************************/ + +CMachineConfigurationVersionIterator::CMachineConfigurationVersionIterator(LibMCData::PMachineConfigurationVersionIterator pMachineConfigurationVersionIterator) + : m_pMachineConfigurationVersionIterator(pMachineConfigurationVersionIterator) +{ + if (pMachineConfigurationVersionIterator.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM); +} + +CMachineConfigurationVersionIterator::~CMachineConfigurationVersionIterator() +{ +} + +bool CMachineConfigurationVersionIterator::MoveNext() +{ + return m_pMachineConfigurationVersionIterator->MoveNext(); +} + +IMachineConfigurationVersion * CMachineConfigurationVersionIterator::GetCurrent() +{ + auto pCurrentConfigurationVersion = m_pMachineConfigurationVersionIterator->GetCurrent(); + + if (pCurrentConfigurationVersion.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCDATA_ERROR_INVALIDITERATOR); + + return new CMachineConfigurationVersion(pCurrentConfigurationVersion); +} + +IMachineConfigurationVersionIterator* CMachineConfigurationVersionIterator::Clone() +{ + throw ELibMCEnvInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +} + diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationversioniterator.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationversioniterator.hpp new file mode 100644 index 00000000..60596855 --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationversioniterator.hpp @@ -0,0 +1,103 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is the class declaration of CMachineConfigurationVersionIterator + +*/ + + +#ifndef __LIBMCENV_MACHINECONFIGURATIONVERSIONITERATOR +#define __LIBMCENV_MACHINECONFIGURATIONVERSIONITERATOR + +#include "libmcenv_interfaces.hpp" + +// Parent classes +#include "libmcenv_iterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "libmcenv_machineconfigurationversion.hpp" + + +namespace LibMCEnv { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CMachineConfigurationVersionIterator +**************************************************************************************************************************/ + +class CMachineConfigurationVersionIterator : public virtual IMachineConfigurationVersionIterator, public virtual CIterator { +private: + + /** + * Put private members here. + */ + + LibMCData::PMachineConfigurationVersionIterator m_pMachineConfigurationVersionIterator; + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + CMachineConfigurationVersionIterator::CMachineConfigurationVersionIterator(LibMCData::PMachineConfigurationVersionIterator pMachineConfigurationVersionIterator); + + virtual ~CMachineConfigurationVersionIterator(); + + bool MoveNext() override; + + IMachineConfigurationVersion * GetCurrent() override; + + IMachineConfigurationVersionIterator* Clone() override; + +}; + +} // namespace Impl +} // namespace LibMCEnv + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIBMCENV_MACHINECONFIGURATIONVERSIONITERATOR diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationxsd.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsd.cpp new file mode 100644 index 00000000..78ef181c --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsd.cpp @@ -0,0 +1,81 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is a stub class definition of CMachineConfigurationXSD + +*/ + +#include "libmcenv_machineconfigurationxsd.hpp" +#include "libmcenv_interfaceexception.hpp" + +// Include custom headers here. +#include "libmcenv_machineconfigurationversioniterator.hpp" + +using namespace LibMCEnv::Impl; + +/************************************************************************************************************************* + Class definition of CMachineConfigurationXSD +**************************************************************************************************************************/ + + +CMachineConfigurationXSD::CMachineConfigurationXSD(LibMCData::PMachineConfigurationXSD pMachineConfigurationXSD) + : m_pMachineConfigurationXSD(pMachineConfigurationXSD) +{ + if (pMachineConfigurationXSD.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM); +} + +CMachineConfigurationXSD::~CMachineConfigurationXSD() +{ +} + +std::string CMachineConfigurationXSD::GetUUID() +{ + return m_pMachineConfigurationXSD->GetUUID(); +} + +std::string CMachineConfigurationXSD::GetTypeUUID() +{ + return m_pMachineConfigurationXSD->GetTypeUUID(); +} + +LibMCEnv_uint32 CMachineConfigurationXSD::GetXSDVersion() +{ + return m_pMachineConfigurationXSD->GetXSDVersion(); +} + +std::string CMachineConfigurationXSD::GetXSDString() +{ + return m_pMachineConfigurationXSD->GetXSDString(); +} + +std::string CMachineConfigurationXSD::GetTimestamp() +{ + return m_pMachineConfigurationXSD->GetTimestamp(); +} diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationxsd.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsd.hpp new file mode 100644 index 00000000..5ee7dd9e --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsd.hpp @@ -0,0 +1,105 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is the class declaration of CMachineConfigurationXSD + +*/ + + +#ifndef __LIBMCENV_MACHINECONFIGURATIONXSD +#define __LIBMCENV_MACHINECONFIGURATIONXSD + +#include "libmcenv_interfaces.hpp" + +// Parent classes +#include "libmcenv_base.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "libmcdata_dynamic.hpp" + +namespace LibMCEnv { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CMachineConfigurationXSD +**************************************************************************************************************************/ + +class CMachineConfigurationXSD : public virtual IMachineConfigurationXSD, public virtual CBase { +private: + + /** + * Put private members here. + */ + + LibMCData::PMachineConfigurationXSD m_pMachineConfigurationXSD; + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + CMachineConfigurationXSD(LibMCData::PMachineConfigurationXSD pMachineConfigurationXSD); + + virtual ~CMachineConfigurationXSD(); + + std::string GetUUID() override; + + std::string GetTypeUUID() override; + + LibMCEnv_uint32 GetXSDVersion() override; + + std::string GetXSDString() override; + + std::string GetTimestamp() override; +}; + +} // namespace Impl +} // namespace LibMCEnv + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIBMCENV_MACHINECONFIGURATIONXSD diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationxsditerator.cpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsditerator.cpp new file mode 100644 index 00000000..a9bafe09 --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsditerator.cpp @@ -0,0 +1,77 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is a stub class definition of CMachineConfigurationXSDIterator + +*/ + +#include "libmcenv_machineconfigurationxsditerator.hpp" +#include "libmcenv_interfaceexception.hpp" + +// Include custom headers here. + + +using namespace LibMCEnv::Impl; + +/************************************************************************************************************************* + Class definition of CMachineConfigurationXSDIterator +**************************************************************************************************************************/ + +CMachineConfigurationXSDIterator::CMachineConfigurationXSDIterator(LibMCData::PMachineConfigurationXSDIterator pMachineConfigurationXSDIterator) + : m_pMachineConfigurationXSDIterator(pMachineConfigurationXSDIterator) +{ + if (pMachineConfigurationXSDIterator.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCENV_ERROR_INVALIDPARAM); +} + +CMachineConfigurationXSDIterator::~CMachineConfigurationXSDIterator() +{ +} + +bool CMachineConfigurationXSDIterator::MoveNext() +{ + return m_pMachineConfigurationXSDIterator->MoveNext(); +} + +IMachineConfigurationXSD* CMachineConfigurationXSDIterator::GetCurrent() +{ + auto pCurrentConfigurationXSD = m_pMachineConfigurationXSDIterator->GetCurrent(); + + if (pCurrentConfigurationXSD.get() == nullptr) + throw ELibMCEnvInterfaceException(LIBMCDATA_ERROR_INVALIDITERATOR); + + return new CMachineConfigurationXSD(pCurrentConfigurationXSD); +} + +IMachineConfigurationXSDIterator* CMachineConfigurationXSDIterator::Clone() +{ + throw ELibMCEnvInterfaceException(LIBMCDATA_ERROR_NOTIMPLEMENTED); +} + + diff --git a/Implementation/LibMCEnv/libmcenv_machineconfigurationxsditerator.hpp b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsditerator.hpp new file mode 100644 index 00000000..febb9008 --- /dev/null +++ b/Implementation/LibMCEnv/libmcenv_machineconfigurationxsditerator.hpp @@ -0,0 +1,103 @@ +/*++ + +Copyright (C) 2020 Autodesk Inc. + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the Autodesk Inc. nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL AUTODESK INC. BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +Abstract: This is the class declaration of CMachineConfigurationXSDIterator + +*/ + + +#ifndef __LIBMCENV_MACHINECONFIGURATIONXSDITERATOR +#define __LIBMCENV_MACHINECONFIGURATIONXSDITERATOR + +#include "libmcenv_interfaces.hpp" + +// Parent classes +#include "libmcenv_iterator.hpp" +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4250) +#endif + +// Include custom headers here. +#include "libmcenv_machineconfigurationxsd.hpp" + + +namespace LibMCEnv { +namespace Impl { + + +/************************************************************************************************************************* + Class declaration of CMachineConfigurationXSDIterator +**************************************************************************************************************************/ + +class CMachineConfigurationXSDIterator : public virtual IMachineConfigurationXSDIterator, public virtual CIterator { +private: + + /** + * Put private members here. + */ + + LibMCData::PMachineConfigurationXSDIterator m_pMachineConfigurationXSDIterator; + +protected: + + /** + * Put protected members here. + */ + +public: + + /** + * Put additional public members here. They will not be visible in the external API. + */ + + + /** + * Public member functions to implement. + */ + + CMachineConfigurationXSDIterator::CMachineConfigurationXSDIterator(LibMCData::PMachineConfigurationXSDIterator pMachineConfigurationXSDIterator); + + virtual ~CMachineConfigurationXSDIterator(); + + bool MoveNext() override; + + IMachineConfigurationXSD* GetCurrent() override; + + IMachineConfigurationXSDIterator* Clone() override; + +}; + +} // namespace Impl +} // namespace LibMCEnv + +#ifdef _MSC_VER +#pragma warning(pop) +#endif +#endif // __LIBMCENV_MACHINECONFIGURATIONXSDITERATOR diff --git a/Implementation/LibMCEnv/libmcenv_uienvironment.cpp b/Implementation/LibMCEnv/libmcenv_uienvironment.cpp index 05801d4f..b9cb6ae2 100644 --- a/Implementation/LibMCEnv/libmcenv_uienvironment.cpp +++ b/Implementation/LibMCEnv/libmcenv_uienvironment.cpp @@ -49,6 +49,7 @@ Abstract: This is a stub class definition of CUIEnvironment #include "libmcenv_tempstreamwriter.hpp" #include "libmcenv_zipstreamwriter.hpp" #include "libmcenv_imageloader.hpp" +#include "libmcenv_machineconfigurationhandler.hpp" #include "amc_systemstate.hpp" #include "amc_accesscontrol.hpp" @@ -1085,3 +1086,8 @@ IJSONObject* CUIEnvironment::ParseJSONData(const LibMCEnv_uint64 nJSONDataBuffer { return new CJSONObject(pJSONDataBuffer, nJSONDataBufferSize); } + +IMachineConfigurationHandler* CUIEnvironment::CreateMachineConfigurationHandler() +{ + return new CMachineConfigurationHandler(m_pUISystemState->getDataModel()); +} \ No newline at end of file diff --git a/Implementation/LibMCEnv/libmcenv_uienvironment.hpp b/Implementation/LibMCEnv/libmcenv_uienvironment.hpp index 4849eb62..10f409de 100644 --- a/Implementation/LibMCEnv/libmcenv_uienvironment.hpp +++ b/Implementation/LibMCEnv/libmcenv_uienvironment.hpp @@ -272,7 +272,7 @@ class CUIEnvironment : public virtual IUIEnvironment, public virtual CBase { IJSONObject* GetExternalEventResults() override; - + IMachineConfigurationHandler* CreateMachineConfigurationHandler() override; }; } // namespace Impl