Search in sources :

Example 1 with FirmwareModuleType

use of org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.FirmwareModuleType in project open-smart-grid-platform by OSGP.

the class FirmwareManagementEndpoint method mapFirmwareModuleTypes.

private FirmwareUpdateMessageDataContainer mapFirmwareModuleTypes(final String firmwareIndentification, final List<FirmwareModuleType> firmwareModuleTypes) {
    String moduleVersionComm = null;
    String moduleVersionFunc = null;
    String moduleVersionMa = null;
    String moduleVersionMbus = null;
    String moduleVersionSec = null;
    String moduleVersionMBusDriverActive = null;
    String moduleVersionSimple = null;
    for (final FirmwareModuleType firmwareModuleType : firmwareModuleTypes) {
        final String firmwareModuleTypeString = firmwareModuleType.toString();
        if (FirmwareModuleType.COMMUNICATION.equals(firmwareModuleType)) {
            moduleVersionComm = firmwareModuleTypeString;
        } else if (FirmwareModuleType.FUNCTIONAL.equals(firmwareModuleType)) {
            moduleVersionFunc = firmwareModuleTypeString;
        } else if (FirmwareModuleType.MODULE_ACTIVE.equals(firmwareModuleType)) {
            moduleVersionMa = firmwareModuleTypeString;
        } else if (FirmwareModuleType.M_BUS.equals(firmwareModuleType)) {
            moduleVersionMbus = firmwareModuleTypeString;
        } else if (FirmwareModuleType.SECURITY.equals(firmwareModuleType)) {
            moduleVersionSec = firmwareModuleTypeString;
        } else if (FirmwareModuleType.M_BUS_DRIVER_ACTIVE.equals(firmwareModuleType)) {
            moduleVersionMBusDriverActive = firmwareModuleTypeString;
        } else if (FirmwareModuleType.SIMPLE_VERSION_INFO.equals(firmwareModuleType)) {
            moduleVersionSimple = firmwareModuleTypeString;
        }
    }
    final FirmwareModuleData firmwareModuleData = new FirmwareModuleData(moduleVersionComm, moduleVersionFunc, moduleVersionMa, moduleVersionMbus, moduleVersionSec, moduleVersionMBusDriverActive, moduleVersionSimple);
    return new FirmwareUpdateMessageDataContainer(firmwareModuleData, firmwareIndentification);
}
Also used : FirmwareModuleData(org.opensmartgridplatform.domain.core.valueobjects.FirmwareModuleData) FirmwareUpdateMessageDataContainer(org.opensmartgridplatform.domain.core.valueobjects.FirmwareUpdateMessageDataContainer) FirmwareModuleType(org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.FirmwareModuleType)

Aggregations

FirmwareModuleType (org.opensmartgridplatform.adapter.ws.schema.core.firmwaremanagement.FirmwareModuleType)1 FirmwareModuleData (org.opensmartgridplatform.domain.core.valueobjects.FirmwareModuleData)1 FirmwareUpdateMessageDataContainer (org.opensmartgridplatform.domain.core.valueobjects.FirmwareUpdateMessageDataContainer)1