diff --git a/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/PlatformSmartmeteringKeys.java b/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/PlatformSmartmeteringKeys.java index c9a8ced8f15..dffde4a247b 100644 --- a/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/PlatformSmartmeteringKeys.java +++ b/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/PlatformSmartmeteringKeys.java @@ -179,4 +179,7 @@ public class PlatformSmartmeteringKeys public static final String PUSH_OBJECT_OBIS_CODES = "PushObjectObisCodes"; public static final String PUSH_OBJECT_ATTRIBUTE_IDS = "PushObjectAttributeIds"; public static final String PUSH_OBJECT_DATA_INDEXES = "PushObjectDataIndexes"; + + public static final String OBJECT_TYPE = "ObjectType"; + public static final String INT_VALUE = "IntValue"; } diff --git a/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/glue/steps/ws/smartmetering/smartmeteringadhoc/SetSpecificAttributeValue.java b/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/glue/steps/ws/smartmetering/smartmeteringadhoc/SetSpecificAttributeValue.java new file mode 100644 index 00000000000..939b6796cf3 --- /dev/null +++ b/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/glue/steps/ws/smartmetering/smartmeteringadhoc/SetSpecificAttributeValue.java @@ -0,0 +1,63 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.cucumber.platform.smartmetering.glue.steps.ws.smartmetering.smartmeteringadhoc; + +import static org.assertj.core.api.Assertions.assertThat; + +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; +import java.util.Map; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueAsyncRequest; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueAsyncResponse; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueRequest; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueResponse; +import org.opensmartgridplatform.cucumber.core.ScenarioContext; +import org.opensmartgridplatform.cucumber.platform.PlatformKeys; +import org.opensmartgridplatform.cucumber.platform.smartmetering.PlatformSmartmeteringKeys; +import org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.adhoc.SetSpecificAttributeValueRequestFactory; +import org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.adhoc.SmartMeteringAdHocRequestClient; +import org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.adhoc.SmartMeteringAdHocResponseClient; +import org.springframework.beans.factory.annotation.Autowired; + +public class SetSpecificAttributeValue { + + @Autowired + private SmartMeteringAdHocRequestClient< + SetSpecificAttributeValueAsyncResponse, SetSpecificAttributeValueRequest> + requestClient; + + @Autowired + private SmartMeteringAdHocResponseClient< + SetSpecificAttributeValueResponse, SetSpecificAttributeValueAsyncRequest> + responseClient; + + @When("^the Set Specific Attribute Value request is received$") + public void whenTheSetSpecificAttributeValueRequestIsReceived(final Map settings) + throws Throwable { + + final SetSpecificAttributeValueRequest request = + SetSpecificAttributeValueRequestFactory.fromParameterMap(settings); + final SetSpecificAttributeValueAsyncResponse asyncResponse = + this.requestClient.doRequest(request); + + assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull(); + ScenarioContext.current() + .put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid()); + } + + @Then("^the Set Specific Attribute Value response should be returned$") + public void thenTheValueShouldBeSetOnTheDevice(final Map settings) + throws Throwable { + + final SetSpecificAttributeValueAsyncRequest asyncRequest = + SetSpecificAttributeValueRequestFactory.fromScenarioContext(); + final SetSpecificAttributeValueResponse response = + this.responseClient.getResponse(asyncRequest); + + assertThat(response.getResult().name()) + .as("Result is not as expected.") + .isEqualTo(settings.get(PlatformSmartmeteringKeys.RESULT)); + } +} diff --git a/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/support/ws/smartmetering/adhoc/SetSpecificAttributeValueRequestFactory.java b/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/support/ws/smartmetering/adhoc/SetSpecificAttributeValueRequestFactory.java new file mode 100644 index 00000000000..5eba6bb7f74 --- /dev/null +++ b/integration-tests/cucumber-tests-platform-smartmetering/src/test/java/org/opensmartgridplatform/cucumber/platform/smartmetering/support/ws/smartmetering/adhoc/SetSpecificAttributeValueRequestFactory.java @@ -0,0 +1,41 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.adhoc; + +import java.math.BigInteger; +import java.util.Map; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.AllowedObjectType; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueAsyncRequest; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueRequest; +import org.opensmartgridplatform.cucumber.platform.smartmetering.PlatformSmartmeteringKeys; +import org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.RequestFactoryHelper; + +public class SetSpecificAttributeValueRequestFactory { + + private SetSpecificAttributeValueRequestFactory() { + // Private constructor for utility class + } + + public static SetSpecificAttributeValueRequest fromParameterMap( + final Map parameters) { + final SetSpecificAttributeValueRequest request = new SetSpecificAttributeValueRequest(); + request.setDeviceIdentification( + parameters.get(PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION)); + request.setObjectType( + AllowedObjectType.valueOf(parameters.get(PlatformSmartmeteringKeys.OBJECT_TYPE))); + request.setAttribute(new BigInteger(parameters.get(PlatformSmartmeteringKeys.ATTRIBUTE))); + request.setIntValue(new BigInteger(parameters.get(PlatformSmartmeteringKeys.INT_VALUE))); + return request; + } + + public static SetSpecificAttributeValueAsyncRequest fromScenarioContext() { + final SetSpecificAttributeValueAsyncRequest asyncRequest = + new SetSpecificAttributeValueAsyncRequest(); + asyncRequest.setCorrelationUid(RequestFactoryHelper.getCorrelationUidFromScenarioContext()); + asyncRequest.setDeviceIdentification( + RequestFactoryHelper.getDeviceIdentificationFromScenarioContext()); + return asyncRequest; + } +} diff --git a/integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/ad-hoc/SetSpecificAttributeValue.feature b/integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/ad-hoc/SetSpecificAttributeValue.feature new file mode 100644 index 00000000000..50f595bfaa0 --- /dev/null +++ b/integration-tests/cucumber-tests-platform-smartmetering/src/test/resources/features/osgp-adapter-ws-smartmetering/ad-hoc/SetSpecificAttributeValue.feature @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Contributors to the GXF project +# +# SPDX-License-Identifier: Apache-2.0 + +@SmartMetering @Platform @SmartMeteringAdHoc +Feature: SmartMetering AdHoc + As a grid operator + I want to be able to set a specific attribute value in a device + So I can change the configuration of a device + + Scenario Outline: Set watchdog timer for a device + Given a dlms device + | DeviceIdentification | | + | DeviceType | SMART_METER_E | + | Protocol | | + | ProtocolVersion | | + When the Set Specific Attribute Value request is received + | DeviceIdentification | | + | ObjectType | WATCHDOG_TIMER | + | Attribute | 2 | + | IntValue | 42 | + Then the Set Specific Attribute Value response should be returned + | DeviceIdentification | | + | Result | | + + Examples: + | deviceIdentification | protocol | version | response | + | TEST1024000000001 | DSMR | 4.2.2 | OK | + @NightlyBuildOnly + Examples: + | deviceIdentification | protocol | version | response | + | TEST1024000000001 | DSMR | 2.2 | NOT_OK | + | TEST1031000000001 | SMR | 4.3 | OK | + | TEST1027000000001 | SMR | 5.0.0 | OK | + | TEST1028000000001 | SMR | 5.1 | OK | + | TEST1029000000001 | SMR | 5.2 | OK | + | TEST1030000000001 | SMR | 5.5 | OK | diff --git a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/ActionMapperService.java b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/ActionMapperService.java index 2f5e7722ba3..38050274e91 100644 --- a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/ActionMapperService.java +++ b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/ActionMapperService.java @@ -67,6 +67,7 @@ import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetPushSetupSmsRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetPushSetupUdpRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetRandomisationSettingsRequestData; +import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetSpecificAttributeValueRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetThdConfigurationRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecialDaysRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecificAttributeValueRequestData; @@ -118,6 +119,7 @@ import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetPushSetupSmsRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetPushSetupUdpRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetRandomisationSettingsRequestDataDto; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetSpecificAttributeValueRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetThdConfigurationRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SpecialDaysRequestDataDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SpecificAttributeValueRequestDto; @@ -172,6 +174,8 @@ public class ActionMapperService { CLASS_MAP.put(UpdateFirmwareRequestData.class, UpdateFirmwareRequestDto.class); CLASS_MAP.put(SetKeysRequestData.class, SetKeysRequestDto.class); CLASS_MAP.put(SpecificAttributeValueRequestData.class, SpecificAttributeValueRequestDto.class); + CLASS_MAP.put( + SetSpecificAttributeValueRequestData.class, SetSpecificAttributeValueRequestDto.class); CLASS_MAP.put( GetAssociationLnObjectsRequestData.class, GetAssociationLnObjectsRequestDto.class); CLASS_MAP.put(CoupleMbusDeviceRequestData.class, GetAssociationLnObjectsRequestDto.class); @@ -270,6 +274,7 @@ private void postConstruct() { CLASS_TO_MAPPER_MAP.put(UpdateFirmwareRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(SetKeysRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(SpecificAttributeValueRequestData.class, this.commonMapper); + CLASS_TO_MAPPER_MAP.put(SetSpecificAttributeValueRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(GetAssociationLnObjectsRequestData.class, this.commonMapper); CLASS_TO_MAPPER_MAP.put(SetClockConfigurationRequestData.class, this.configurationMapper); CLASS_TO_MAPPER_MAP.put(GetThdFingerprintRequestData.class, this.monitoringMapper); diff --git a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/AdhocService.java b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/AdhocService.java index 3c09f495fb5..fb82108b36b 100644 --- a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/AdhocService.java +++ b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/application/services/AdhocService.java @@ -13,6 +13,7 @@ import org.opensmartgridplatform.domain.core.entities.SmartMeter; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AssociationLnListType; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ScanMbusChannelsResponseData; +import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetSpecificAttributeValueRequest; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecificAttributeValueRequest; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SynchronizeTimeRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.TestAlarmSchedulerRequestData; @@ -22,6 +23,7 @@ import org.opensmartgridplatform.dto.valueobjects.smartmetering.ObisCodeValuesDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.ScanMbusChannelsRequestDataDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.ScanMbusChannelsResponseDto; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetSpecificAttributeValueRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SpecificAttributeValueRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SynchronizeTimeRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.TestAlarmSchedulerRequestDto; @@ -248,6 +250,47 @@ public void handleGetSpecificAttributeValueResponse( this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType()); } + public void setSpecificAttributeValue( + final MessageMetadata messageMetadata, final SetSpecificAttributeValueRequest request) + throws FunctionalException { + + log.debug( + "setSpecificAttributeValue for organisationIdentification: {} for deviceIdentification: {}", + messageMetadata.getOrganisationIdentification(), + messageMetadata.getDeviceIdentification()); + + final SmartMeter smartMeter = + this.domainHelperService.findSmartMeter(messageMetadata.getDeviceIdentification()); + + final SetSpecificAttributeValueRequestDto requestDto = + new SetSpecificAttributeValueRequestDto( + request.getObjectType(), request.getAttribute(), request.getIntValue()); + + this.osgpCoreRequestMessageSender.send( + requestDto, + messageMetadata + .builder() + .withNetworkAddress(smartMeter.getNetworkAddress()) + .withNetworkSegmentIds(smartMeter.getBtsId(), smartMeter.getCellId()) + .build()); + } + + public void handleSetSpecificAttributeValueResponse( + final MessageMetadata messageMetadata, + final ResponseMessageResultType deviceResult, + final OsgpException exception, + final String resultData) { + + log.debug( + "handleSetSpecificAttributeValueResponse for MessageType: {}", + messageMetadata.getMessageType()); + + final ResponseMessage responseMessage = + this.createResponseMessageWithDataObject( + deviceResult, exception, messageMetadata, resultData); + this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType()); + } + public void scanMbusChannels(final MessageMetadata messageMetadata) throws FunctionalException { log.debug( diff --git a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/infra/jms/core/messageprocessors/SetSpecificAttributeValueResponseMessageProcessor.java b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/infra/jms/core/messageprocessors/SetSpecificAttributeValueResponseMessageProcessor.java new file mode 100644 index 00000000000..d8eb434bb62 --- /dev/null +++ b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/infra/jms/core/messageprocessors/SetSpecificAttributeValueResponseMessageProcessor.java @@ -0,0 +1,58 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.core.messageprocessors; + +import org.opensmartgridplatform.adapter.domain.smartmetering.application.services.AdhocService; +import org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.core.OsgpCoreResponseMessageProcessor; +import org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.ws.WebServiceResponseMessageSender; +import org.opensmartgridplatform.shared.exceptionhandling.ComponentType; +import org.opensmartgridplatform.shared.exceptionhandling.OsgpException; +import org.opensmartgridplatform.shared.infra.jms.MessageMetadata; +import org.opensmartgridplatform.shared.infra.jms.MessageProcessorMap; +import org.opensmartgridplatform.shared.infra.jms.MessageType; +import org.opensmartgridplatform.shared.infra.jms.ResponseMessage; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +@Component +public class SetSpecificAttributeValueResponseMessageProcessor + extends OsgpCoreResponseMessageProcessor { + + private final AdhocService adhocService; + + @Autowired + public SetSpecificAttributeValueResponseMessageProcessor( + final WebServiceResponseMessageSender responseMessageSender, + @Qualifier("domainSmartMeteringInboundOsgpCoreResponsesMessageProcessorMap") + final MessageProcessorMap messageProcessorMap, + @Qualifier("domainSmartMeteringAdhocService") final AdhocService adhocService) { + super( + responseMessageSender, + messageProcessorMap, + MessageType.SET_SPECIFIC_ATTRIBUTE_VALUE, + ComponentType.DOMAIN_SMART_METERING); + this.adhocService = adhocService; + } + + @Override + protected boolean hasRegularResponseObject(final ResponseMessage responseMessage) { + // Only the Result (OK/NOK/Exception) is returned, no need to check the (contents of the + // dataObject). + return true; + } + + @Override + protected void handleMessage( + final MessageMetadata deviceMessageMetadata, + final ResponseMessage responseMessage, + final OsgpException osgpException) { + this.adhocService.handleSetSpecificAttributeValueResponse( + deviceMessageMetadata, + responseMessage.getResult(), + osgpException, + (String) responseMessage.getDataObject()); + } +} diff --git a/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/infra/jms/ws/messageprocessors/SetSpecificAttributeValueRequestMessageProcessor.java b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/infra/jms/ws/messageprocessors/SetSpecificAttributeValueRequestMessageProcessor.java new file mode 100644 index 00000000000..34d924326bb --- /dev/null +++ b/osgp/platform/osgp-adapter-domain-smartmetering/src/main/java/org/opensmartgridplatform/adapter/domain/smartmetering/infra/jms/ws/messageprocessors/SetSpecificAttributeValueRequestMessageProcessor.java @@ -0,0 +1,40 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.ws.messageprocessors; + +import org.opensmartgridplatform.adapter.domain.smartmetering.application.services.AdhocService; +import org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.BaseRequestMessageProcessor; +import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetSpecificAttributeValueRequest; +import org.opensmartgridplatform.shared.exceptionhandling.FunctionalException; +import org.opensmartgridplatform.shared.infra.jms.MessageMetadata; +import org.opensmartgridplatform.shared.infra.jms.MessageProcessorMap; +import org.opensmartgridplatform.shared.infra.jms.MessageType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.stereotype.Component; + +@Component +public class SetSpecificAttributeValueRequestMessageProcessor extends BaseRequestMessageProcessor { + + private final AdhocService adhocService; + + @Autowired + protected SetSpecificAttributeValueRequestMessageProcessor( + @Qualifier("domainSmartMeteringInboundWebServiceRequestsMessageProcessorMap") + final MessageProcessorMap messageProcessorMap, + @Qualifier("domainSmartMeteringAdhocService") final AdhocService adhocService) { + super(messageProcessorMap, MessageType.SET_SPECIFIC_ATTRIBUTE_VALUE); + this.adhocService = adhocService; + } + + @Override + protected void handleMessage(final MessageMetadata deviceMessageMetadata, final Object dataObject) + throws FunctionalException { + + final SetSpecificAttributeValueRequest request = (SetSpecificAttributeValueRequest) dataObject; + + this.adhocService.setSpecificAttributeValue(deviceMessageMetadata, request); + } +} diff --git a/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/application/services/ActionMapperService.java b/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/application/services/ActionMapperService.java index d503ad63a70..cfab960971e 100644 --- a/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/application/services/ActionMapperService.java +++ b/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/application/services/ActionMapperService.java @@ -52,6 +52,7 @@ import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetPushSetupUdpRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetRandomisationSettingsRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetSpecialDaysRequest; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetSpecificAttributeValueRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetThdConfigurationRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SynchronizeTimeRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.UpdateFirmwareRequest; @@ -103,6 +104,7 @@ import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetPushSetupSmsRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetPushSetupUdpRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetRandomisationSettingsRequestData; +import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetSpecificAttributeValueRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetThdConfigurationRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecialDaysRequestData; import org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SpecificAttributeValueRequestData; @@ -234,6 +236,10 @@ public class ActionMapperService { org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc .GetSpecificAttributeValueRequestData.class, SpecificAttributeValueRequestData.class); + CLASS_MAP.put( + org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc + .SetSpecificAttributeValueRequestData.class, + SetSpecificAttributeValueRequestData.class); CLASS_MAP.put( org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration .SetClockConfigurationRequestData.class, @@ -286,6 +292,8 @@ public class ActionMapperService { CLASS_MAP.put(SetKeysRequest.class, SetKeysRequestData.class); CLASS_MAP.put(GetAssociationLnObjectsRequest.class, GetAssociationLnObjectsRequestData.class); CLASS_MAP.put(GetSpecificAttributeValueRequest.class, SpecificAttributeValueRequestData.class); + CLASS_MAP.put( + SetSpecificAttributeValueRequest.class, SetSpecificAttributeValueRequestData.class); CLASS_MAP.put(SetClockConfigurationRequest.class, SetClockConfigurationRequestData.class); CLASS_MAP.put(GetConfigurationObjectRequest.class, GetConfigurationObjectRequestData.class); CLASS_MAP.put(GetPowerQualityProfileRequest.class, GetPowerQualityProfileRequestData.class); @@ -375,6 +383,11 @@ private void mapAdHocRequestData() { .GetSpecificAttributeValueRequestData.class, this.adhocMapper); CLASS_TO_MAPPER_MAP.put(GetSpecificAttributeValueRequest.class, this.adhocMapper); + CLASS_TO_MAPPER_MAP.put( + org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc + .SetSpecificAttributeValueRequestData.class, + this.adhocMapper); + CLASS_TO_MAPPER_MAP.put(SetSpecificAttributeValueRequest.class, this.adhocMapper); CLASS_TO_MAPPER_MAP.put( org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.ScanMbusChannelsRequestData .class, diff --git a/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/endpoints/SmartMeteringAdhocEndpoint.java b/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/endpoints/SmartMeteringAdhocEndpoint.java index 2c03168d295..4664c1e9e03 100644 --- a/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/endpoints/SmartMeteringAdhocEndpoint.java +++ b/osgp/platform/osgp-adapter-ws-smartmetering/src/main/java/org/opensmartgridplatform/adapter/ws/smartmetering/endpoints/SmartMeteringAdhocEndpoint.java @@ -28,6 +28,10 @@ import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.ScanMbusChannelsAsyncResponse; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.ScanMbusChannelsRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.ScanMbusChannelsResponse; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueAsyncRequest; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueAsyncResponse; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueRequest; +import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SetSpecificAttributeValueResponse; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SynchronizeTimeAsyncRequest; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SynchronizeTimeAsyncResponse; import org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.SynchronizeTimeRequest; @@ -322,6 +326,69 @@ public GetSpecificAttributeValueResponse getSpecificAttributeValueResponse( return response; } + @PayloadRoot( + localPart = "SetSpecificAttributeValueRequest", + namespace = SMARTMETER_ADHOC_NAMESPACE) + @ResponsePayload + public SetSpecificAttributeValueAsyncResponse setSpecificAttributeValue( + @OrganisationIdentification final String organisationIdentification, + @RequestPayload final SetSpecificAttributeValueRequest request, + @MessagePriority final String messagePriority, + @ScheduleTime final String scheduleTime, + @ResponseUrl final String responseUrl, + @BypassRetry final String bypassRetry) + throws OsgpException { + + final org.opensmartgridplatform.domain.core.valueobjects.smartmetering + .SetSpecificAttributeValueRequest + setSpecificAttributeValueRequest = + this.adhocMapper.map( + request, + org.opensmartgridplatform.domain.core.valueobjects.smartmetering + .SetSpecificAttributeValueRequest.class); + + final RequestMessageMetadata requestMessageMetadata = + RequestMessageMetadata.newBuilder() + .withOrganisationIdentification(organisationIdentification) + .withDeviceIdentification(request.getDeviceIdentification()) + .withDeviceFunction(DeviceFunction.SET_SPECIFIC_ATTRIBUTE_VALUE) + .withMessageType(MessageType.SET_SPECIFIC_ATTRIBUTE_VALUE) + .withMessagePriority(messagePriority) + .withScheduleTime(scheduleTime) + .withBypassRetry(bypassRetry) + .build(); + + final AsyncResponse asyncResponse = + this.requestService.enqueueAndSendRequest( + requestMessageMetadata, setSpecificAttributeValueRequest); + + this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl); + + return this.adhocMapper.map(asyncResponse, SetSpecificAttributeValueAsyncResponse.class); + } + + @PayloadRoot( + localPart = "SetSpecificAttributeValueAsyncRequest", + namespace = SMARTMETER_ADHOC_NAMESPACE) + @ResponsePayload + public SetSpecificAttributeValueResponse setSpecificAttributeValueResponse( + @RequestPayload final SetSpecificAttributeValueAsyncRequest request) throws OsgpException { + + SetSpecificAttributeValueResponse response = null; + try { + response = new SetSpecificAttributeValueResponse(); + final ResponseData responseData = + this.responseDataService.get( + request.getCorrelationUid(), ComponentType.WS_SMART_METERING); + + response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue())); + } catch (final Exception e) { + this.handleException(e); + } + + return response; + } + @PayloadRoot(localPart = "GetAssociationLnObjectsRequest", namespace = SMARTMETER_ADHOC_NAMESPACE) @ResponsePayload public GetAssociationLnObjectsAsyncResponse getAssociationLnObjects( diff --git a/osgp/platform/osgp-core/src/main/resources/db/migration/V20250211131912345__Add_device_function_SET_SPECIFIC_ATTRIBUTE_VALUE.sql b/osgp/platform/osgp-core/src/main/resources/db/migration/V20250211131912345__Add_device_function_SET_SPECIFIC_ATTRIBUTE_VALUE.sql new file mode 100644 index 00000000000..0e483bc84e6 --- /dev/null +++ b/osgp/platform/osgp-core/src/main/resources/db/migration/V20250211131912345__Add_device_function_SET_SPECIFIC_ATTRIBUTE_VALUE.sql @@ -0,0 +1,10 @@ +DO +$$ +BEGIN + + IF NOT EXISTS (SELECT 1 FROM device_function_mapping WHERE "function" = 'SET_SPECIFIC_ATTRIBUTE_VALUE') THEN + insert into device_function_mapping (function_group, "function") values ('OWNER', 'SET_SPECIFIC_ATTRIBUTE_VALUE'); + END IF; + +END; +$$ diff --git a/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/DeviceFunction.java b/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/DeviceFunction.java index 5af45e755ae..987e3939223 100644 --- a/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/DeviceFunction.java +++ b/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/DeviceFunction.java @@ -91,6 +91,7 @@ public enum DeviceFunction { SET_RANDOMISATION_SETTINGS, SET_REBOOT, SET_SPECIAL_DAYS, + SET_SPECIFIC_ATTRIBUTE_VALUE, SET_TARIFF_SCHEDULE, SET_THD_CONFIGURATION, SET_TRANSITION, diff --git a/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/smartmetering/SetSpecificAttributeValueRequest.java b/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/smartmetering/SetSpecificAttributeValueRequest.java new file mode 100644 index 00000000000..1c4c9bfc234 --- /dev/null +++ b/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/smartmetering/SetSpecificAttributeValueRequest.java @@ -0,0 +1,57 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.domain.core.valueobjects.smartmetering; + +public class SetSpecificAttributeValueRequest extends SetSpecificAttributeValueRequestData { + + private static final long serialVersionUID = 1; + + private final String deviceIdentification; + + public SetSpecificAttributeValueRequest( + final String objectType, + final int attribute, + final int intValue, + final String deviceIdentification) { + super(objectType, attribute, intValue); + this.deviceIdentification = deviceIdentification; + } + + public String getDeviceIdentification() { + return this.deviceIdentification; + } + + @Override + public int hashCode() { + final int prime = 31; + int result = super.hashCode(); + result = + prime * result + + ((this.deviceIdentification == null) ? 0 : this.deviceIdentification.hashCode()); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (!super.equals(obj)) { + return false; + } + if (this.getClass() != obj.getClass()) { + return false; + } + final SetSpecificAttributeValueRequest other = (SetSpecificAttributeValueRequest) obj; + if (this.deviceIdentification == null) { + if (other.deviceIdentification != null) { + return false; + } + } else if (!this.deviceIdentification.equals(other.deviceIdentification)) { + return false; + } + return true; + } +} diff --git a/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/smartmetering/SetSpecificAttributeValueRequestData.java b/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/smartmetering/SetSpecificAttributeValueRequestData.java new file mode 100644 index 00000000000..75abcc10429 --- /dev/null +++ b/osgp/platform/osgp-domain-core/src/main/java/org/opensmartgridplatform/domain/core/valueobjects/smartmetering/SetSpecificAttributeValueRequestData.java @@ -0,0 +1,86 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.domain.core.valueobjects.smartmetering; + +import java.io.Serializable; +import org.opensmartgridplatform.domain.core.valueobjects.DeviceFunction; +import org.opensmartgridplatform.shared.exceptionhandling.FunctionalException; + +public class SetSpecificAttributeValueRequestData implements Serializable, ActionRequest { + + private static final long serialVersionUID = -7326169764207317011L; + + private final String objectType; + private final int attribute; + private final int intValue; + + public SetSpecificAttributeValueRequestData( + final String objectType, final int attribute, final int intValue) { + super(); + this.objectType = objectType; + this.attribute = attribute; + this.intValue = intValue; + } + + public String getObjectType() { + return this.objectType; + } + + public int getAttribute() { + return this.attribute; + } + + public int getIntValue() { + return this.intValue; + } + + @Override + public void validate() throws FunctionalException { + // not needed here + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = (prime * result) + this.attribute; + result = (prime * result) + this.intValue; + result = (prime * result) + this.objectType.hashCode(); + return result; + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) { + return true; + } + if (obj == null) { + return false; + } + if (this.getClass() != obj.getClass()) { + return false; + } + final SetSpecificAttributeValueRequestData other = (SetSpecificAttributeValueRequestData) obj; + if (this.attribute != other.attribute) { + return false; + } + if (this.intValue != other.intValue) { + return false; + } + if (this.objectType == null) { + if (other.objectType != null) { + return false; + } + } else if (!this.objectType.equals(other.objectType)) { + return false; + } + return true; + } + + @Override + public DeviceFunction getDeviceFunction() { + return DeviceFunction.SET_SPECIFIC_ATTRIBUTE_VALUE; + } +} diff --git a/osgp/protocol-adapter-dlms/osgp-dlms/src/main/java/org/opensmartgridplatform/dlms/objectconfig/DlmsObjectType.java b/osgp/protocol-adapter-dlms/osgp-dlms/src/main/java/org/opensmartgridplatform/dlms/objectconfig/DlmsObjectType.java index e979af01f77..23137b43855 100644 --- a/osgp/protocol-adapter-dlms/osgp-dlms/src/main/java/org/opensmartgridplatform/dlms/objectconfig/DlmsObjectType.java +++ b/osgp/protocol-adapter-dlms/osgp-dlms/src/main/java/org/opensmartgridplatform/dlms/objectconfig/DlmsObjectType.java @@ -109,6 +109,7 @@ public enum DlmsObjectType { PHASE_OUTAGE_TEST, LAST_GASP_TEST, ADMINISTRATIVE_IN_OUT, + WATCHDOG_TIMER, CONFIGURATION_OBJECT, RANDOMISATION_SETTINGS, ACTIVITY_CALENDAR, diff --git a/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-dsmr422.json b/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-dsmr422.json index 6e93b03e734..bd5cbfa95ba 100644 --- a/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-dsmr422.json +++ b/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-dsmr422.json @@ -2524,6 +2524,24 @@ } ] }, + { + "tag": "WATCHDOG_TIMER", + "description": "Connection watchdog timer P3", + "class-id": 1, + "version": 0, + "obis": "0.1.94.31.2.255", + "group": "ABSTRACT", + "meterTypes": ["SP","PP"], + "attributes": [ + { + "id": 2, + "description": "value", + "datatype": "long-unsigned", + "valuetype": "SET_BY_CLIENT", + "access": "RW" + } + ] + }, { "tag": "CONFIGURATION_OBJECT", "description": "Configuration object", diff --git a/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-smr500.json b/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-smr500.json index ee4b3c2f568..d22ddd5b5c0 100644 --- a/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-smr500.json +++ b/osgp/protocol-adapter-dlms/osgp-dlms/src/main/resources/dlmsprofiles/dlmsprofile-smr500.json @@ -3303,6 +3303,24 @@ } ] }, + { + "tag": "WATCHDOG_TIMER", + "description": "Connection watchdog timer P3", + "class-id": 1, + "version": 0, + "obis": "0.1.94.31.2.255", + "group": "ABSTRACT", + "meterTypes": ["SP","PP"], + "attributes": [ + { + "id": 2, + "description": "value", + "datatype": "long-unsigned", + "valuetype": "SET_BY_CLIENT", + "access": "RW" + } + ] + }, { "tag": "CONFIGURATION_OBJECT", "description": "Configuration object", diff --git a/osgp/protocol-adapter-dlms/osgp-dlms/src/test/java/org/opensmartgridplatform/dlms/services/Protocol.java b/osgp/protocol-adapter-dlms/osgp-dlms/src/test/java/org/opensmartgridplatform/dlms/services/Protocol.java index e1f352f82d2..415631a406f 100644 --- a/osgp/protocol-adapter-dlms/osgp-dlms/src/test/java/org/opensmartgridplatform/dlms/services/Protocol.java +++ b/osgp/protocol-adapter-dlms/osgp-dlms/src/test/java/org/opensmartgridplatform/dlms/services/Protocol.java @@ -12,12 +12,12 @@ @Getter public enum Protocol { DSMR_2_2("DSMR", "2.2", 52, 2, 4, 6, 14, 0, 0, 0, 0, false, false), - DSMR_4_2_2("DSMR", "4.2.2", 93, 11, 27, 6, 14, 6, 13, 5, 6, true, false), - SMR_4_3("SMR", "4.3", 94, 11, 27, 6, 14, 6, 13, 6, 7, true, false), - SMR_5_0_0("SMR", "5.0.0", 115, 11, 27, 6, 14, 6, 15, 9, 14, true, true), - SMR_5_1("SMR", "5.1", 119, 11, 27, 6, 14, 6, 15, 9, 14, true, true), - SMR_5_2("SMR", "5.2", 158, 11, 27, 6, 14, 6, 15, 10, 15, true, true), - SMR_5_5("SMR", "5.5", 162, 11, 27, 6, 14, 6, 15, 10, 15, true, true); + DSMR_4_2_2("DSMR", "4.2.2", 94, 11, 27, 6, 14, 6, 13, 5, 6, true, false), + SMR_4_3("SMR", "4.3", 95, 11, 27, 6, 14, 6, 13, 6, 7, true, false), + SMR_5_0_0("SMR", "5.0.0", 116, 11, 27, 6, 14, 6, 15, 9, 14, true, true), + SMR_5_1("SMR", "5.1", 120, 11, 27, 6, 14, 6, 15, 9, 14, true, true), + SMR_5_2("SMR", "5.2", 159, 11, 27, 6, 14, 6, 15, 10, 15, true, true), + SMR_5_5("SMR", "5.5", 163, 11, 27, 6, 14, 6, 15, 10, 15, true, true); private final String name; private final String version; diff --git a/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/application/services/AdhocService.java b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/application/services/AdhocService.java index d9fb3fd2be8..c66c3c28e22 100644 --- a/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/application/services/AdhocService.java +++ b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/application/services/AdhocService.java @@ -5,6 +5,7 @@ package org.opensmartgridplatform.adapter.protocol.dlms.application.services; import java.io.Serializable; +import lombok.extern.slf4j.Slf4j; import org.openmuc.jdlms.AccessResultCode; import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.alarm.TestAlarmSchedulerCommandExecutor; import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.datetime.SynchronizeTimeCommandExecutor; @@ -12,34 +13,49 @@ import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.misc.GetAllAttributeValuesCommandExecutor; import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.misc.GetAssociationLnObjectsCommandExecutor; import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.misc.GetSpecificAttributeValueCommandExecutor; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.misc.SetSpecificAttributeValueCommandExecutor; import org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice; import org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionManager; import org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ProtocolAdapterException; import org.opensmartgridplatform.dto.valueobjects.smartmetering.AssociationLnListTypeDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.ScanMbusChannelsResponseDto; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetSpecificAttributeValueRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SpecificAttributeValueRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.SynchronizeTimeRequestDto; import org.opensmartgridplatform.dto.valueobjects.smartmetering.TestAlarmSchedulerRequestDto; import org.opensmartgridplatform.shared.exceptionhandling.FunctionalException; import org.opensmartgridplatform.shared.exceptionhandling.OsgpException; import org.opensmartgridplatform.shared.infra.jms.MessageMetadata; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +@Slf4j @Service(value = "dlmsAdhocService") public class AdhocService { - @Autowired private TestAlarmSchedulerCommandExecutor testAlarmSchedulerCommandExecutor; - @Autowired private SynchronizeTimeCommandExecutor synchronizeTimeCommandExecutor; - - @Autowired private GetAllAttributeValuesCommandExecutor getAllAttributeValuesCommandExecutor; - - @Autowired - private GetSpecificAttributeValueCommandExecutor getSpecificAttributeValueCommandExecutor; - - @Autowired private GetAssociationLnObjectsCommandExecutor getAssociationLnObjectsCommandExecutor; - - @Autowired private ScanMbusChannelsCommandExecutor scanMbusChannelsCommandExecutor; + private final TestAlarmSchedulerCommandExecutor testAlarmSchedulerCommandExecutor; + private final SynchronizeTimeCommandExecutor synchronizeTimeCommandExecutor; + private final GetAllAttributeValuesCommandExecutor getAllAttributeValuesCommandExecutor; + private final SetSpecificAttributeValueCommandExecutor setSpecificAttributeValueCommandExecutor; + private final GetSpecificAttributeValueCommandExecutor getSpecificAttributeValueCommandExecutor; + private final GetAssociationLnObjectsCommandExecutor getAssociationLnObjectsCommandExecutor; + private final ScanMbusChannelsCommandExecutor scanMbusChannelsCommandExecutor; + + public AdhocService( + final TestAlarmSchedulerCommandExecutor testAlarmSchedulerCommandExecutor, + final SynchronizeTimeCommandExecutor synchronizeTimeCommandExecutor, + final GetAllAttributeValuesCommandExecutor getAllAttributeValuesCommandExecutor, + final SetSpecificAttributeValueCommandExecutor setSpecificAttributeValueCommandExecutor, + final GetSpecificAttributeValueCommandExecutor getSpecificAttributeValueCommandExecutor, + final GetAssociationLnObjectsCommandExecutor getAssociationLnObjectsCommandExecutor, + final ScanMbusChannelsCommandExecutor scanMbusChannelsCommandExecutor) { + this.testAlarmSchedulerCommandExecutor = testAlarmSchedulerCommandExecutor; + this.synchronizeTimeCommandExecutor = synchronizeTimeCommandExecutor; + this.getAllAttributeValuesCommandExecutor = getAllAttributeValuesCommandExecutor; + this.setSpecificAttributeValueCommandExecutor = setSpecificAttributeValueCommandExecutor; + this.getSpecificAttributeValueCommandExecutor = getSpecificAttributeValueCommandExecutor; + this.getAssociationLnObjectsCommandExecutor = getAssociationLnObjectsCommandExecutor; + this.scanMbusChannelsCommandExecutor = scanMbusChannelsCommandExecutor; + } // === REQUEST Synchronize Time DATA === @@ -86,6 +102,21 @@ public Serializable getSpecificAttributeValue( conn, device, specificAttributeValueRequestDataDto, messageMetadata); } + public void setSpecificAttributeValue( + final DlmsConnectionManager conn, + final DlmsDevice device, + final SetSpecificAttributeValueRequestDto setSpecificAttributeValueRequestDataDto, + final MessageMetadata messageMetadata) + throws FunctionalException, ProtocolAdapterException { + try { + this.setSpecificAttributeValueCommandExecutor.execute( + conn, device, setSpecificAttributeValueRequestDataDto, messageMetadata); + } catch (final ProtocolAdapterException e) { + log.error("Unexpected exception while setting value.", e); + throw e; + } + } + public ScanMbusChannelsResponseDto scanMbusChannels( final DlmsConnectionManager conn, final DlmsDevice device, diff --git a/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/domain/commands/misc/SetSpecificAttributeValueCommandExecutor.java b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/domain/commands/misc/SetSpecificAttributeValueCommandExecutor.java new file mode 100644 index 00000000000..cf61ae914db --- /dev/null +++ b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/domain/commands/misc/SetSpecificAttributeValueCommandExecutor.java @@ -0,0 +1,115 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.misc; + +import java.io.IOException; +import lombok.extern.slf4j.Slf4j; +import org.openmuc.jdlms.AttributeAddress; +import org.openmuc.jdlms.ObisCode; +import org.openmuc.jdlms.SetParameter; +import org.openmuc.jdlms.datatypes.DataObject; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.AbstractCommandExecutor; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.utils.JdlmsObjectToStringUtil; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionManager; +import org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ConnectionException; +import org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ProtocolAdapterException; +import org.opensmartgridplatform.dlms.exceptions.ObjectConfigException; +import org.opensmartgridplatform.dlms.objectconfig.Attribute; +import org.opensmartgridplatform.dlms.objectconfig.CosemObject; +import org.opensmartgridplatform.dlms.objectconfig.DlmsDataType; +import org.opensmartgridplatform.dlms.objectconfig.DlmsObjectType; +import org.opensmartgridplatform.dlms.services.ObjectConfigService; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionResponseDto; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetSpecificAttributeValueRequestDto; +import org.opensmartgridplatform.shared.exceptionhandling.FunctionalException; +import org.opensmartgridplatform.shared.infra.jms.MessageMetadata; +import org.springframework.stereotype.Component; + +@Component +@Slf4j +public class SetSpecificAttributeValueCommandExecutor + extends AbstractCommandExecutor { + + private final ObjectConfigService objectConfigService; + + public SetSpecificAttributeValueCommandExecutor(final ObjectConfigService objectConfigService) { + super(SetSpecificAttributeValueRequestDto.class); + this.objectConfigService = objectConfigService; + } + + @Override + public ActionResponseDto asBundleResponse(final Void executionResult) + throws ProtocolAdapterException { + return new ActionResponseDto("Set specific attribute was successful"); + } + + @Override + public Void execute( + final DlmsConnectionManager conn, + final DlmsDevice device, + final SetSpecificAttributeValueRequestDto requestData, + final MessageMetadata messageMetadata) + throws FunctionalException, ProtocolAdapterException { + + final DlmsObjectType objectType = DlmsObjectType.valueOf(requestData.getObjectType()); + final CosemObject cosemObject; + try { + cosemObject = + this.objectConfigService.getCosemObject( + device.getProtocolName(), device.getProtocolVersion(), objectType); + } catch (final ObjectConfigException e) { + throw new ProtocolAdapterException(AbstractCommandExecutor.ERROR_IN_OBJECT_CONFIG, e); + } + + final Attribute attribute = cosemObject.getAttribute(requestData.getAttribute()); + + final DlmsDataType dataType = attribute.getDatatype(); + + final DataObject data = + switch (dataType) { + case UNSIGNED -> DataObject.newUInteger8Data(requestData.getIntValue().shortValue()); + case LONG_UNSIGNED -> DataObject.newUInteger16Data(requestData.getIntValue()); + case DOUBLE_LONG_UNSIGNED -> DataObject.newUInteger32Data(requestData.getIntValue()); + case LONG64_UNSIGNED -> DataObject.newUInteger64Data(requestData.getIntValue()); + case INTEGER -> DataObject.newInteger8Data(requestData.getIntValue().byteValue()); + case LONG -> DataObject.newInteger16Data(requestData.getIntValue().shortValue()); + case DOUBLE_LONG -> DataObject.newInteger32Data(requestData.getIntValue()); + case LONG64 -> DataObject.newInteger64Data(requestData.getIntValue()); + default -> + throw new ProtocolAdapterException( + "Datatype " + dataType.name() + " not supported for integer value"); + }; + + final AttributeAddress attributeAddress = + new AttributeAddress( + cosemObject.getClassId(), + new ObisCode(cosemObject.getObis()), + requestData.getAttribute()); + final SetParameter setParameter = new SetParameter(attributeAddress, data); + + conn.getDlmsMessageListener() + .setDescription( + "Setting value in " + + requestData.getObjectType() + + ", set attribute: " + + JdlmsObjectToStringUtil.describeAttributes(attributeAddress)); + + log.debug( + "Set specific attribute value, class id: {}, obis code: {}, attribute id: {}, value: {}", + cosemObject.getClassId(), + cosemObject.getObis(), + requestData.getAttribute(), + requestData.getIntValue()); + + try { + conn.getConnection().set(setParameter); + } catch (final IOException e) { + throw new ConnectionException(e); + } + + return null; + } +} diff --git a/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/infra/messaging/processors/SetSpecificAttributeValueRequestMessageProcessor.java b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/infra/messaging/processors/SetSpecificAttributeValueRequestMessageProcessor.java new file mode 100644 index 00000000000..926ae247c51 --- /dev/null +++ b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/main/java/org/opensmartgridplatform/adapter/protocol/dlms/infra/messaging/processors/SetSpecificAttributeValueRequestMessageProcessor.java @@ -0,0 +1,47 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.processors; + +import java.io.Serializable; +import org.opensmartgridplatform.adapter.protocol.dlms.application.services.AdhocService; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionManager; +import org.opensmartgridplatform.adapter.protocol.dlms.exceptions.ProtocolAdapterException; +import org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DeviceRequestMessageProcessor; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetSpecificAttributeValueRequestDto; +import org.opensmartgridplatform.shared.exceptionhandling.FunctionalException; +import org.opensmartgridplatform.shared.infra.jms.MessageMetadata; +import org.opensmartgridplatform.shared.infra.jms.MessageType; +import org.springframework.stereotype.Component; + +@Component +public class SetSpecificAttributeValueRequestMessageProcessor + extends DeviceRequestMessageProcessor { + + private final AdhocService adhocService; + + protected SetSpecificAttributeValueRequestMessageProcessor(final AdhocService adhocService) { + super(MessageType.SET_SPECIFIC_ATTRIBUTE_VALUE); + this.adhocService = adhocService; + } + + @Override + protected Serializable handleMessage( + final DlmsConnectionManager conn, + final DlmsDevice device, + final Serializable requestObject, + final MessageMetadata messageMetadata) + throws ProtocolAdapterException, FunctionalException { + + this.assertRequestObjectType(SetSpecificAttributeValueRequestDto.class, requestObject); + + final SetSpecificAttributeValueRequestDto request = + (SetSpecificAttributeValueRequestDto) requestObject; + + this.adhocService.setSpecificAttributeValue(conn, device, request, messageMetadata); + + return null; + } +} diff --git a/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/test/java/org/opensmartgridplatform/adapter/protocol/dlms/domain/commands/misc/SetSpecificAttributeValueCommandExecutorTest.java b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/test/java/org/opensmartgridplatform/adapter/protocol/dlms/domain/commands/misc/SetSpecificAttributeValueCommandExecutorTest.java new file mode 100644 index 00000000000..8854ea56641 --- /dev/null +++ b/osgp/protocol-adapter-dlms/osgp-protocol-adapter-dlms/src/test/java/org/opensmartgridplatform/adapter/protocol/dlms/domain/commands/misc/SetSpecificAttributeValueCommandExecutorTest.java @@ -0,0 +1,112 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.adapter.protocol.dlms.domain.commands.misc; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.IOException; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.openmuc.jdlms.AccessResultCode; +import org.openmuc.jdlms.AttributeAddress; +import org.openmuc.jdlms.DlmsConnection; +import org.openmuc.jdlms.SetParameter; +import org.openmuc.jdlms.datatypes.DataObject; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.DlmsDevice; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.entities.Protocol; +import org.opensmartgridplatform.adapter.protocol.dlms.domain.factories.DlmsConnectionManager; +import org.opensmartgridplatform.adapter.protocol.dlms.infra.messaging.DlmsMessageListener; +import org.opensmartgridplatform.dlms.exceptions.ObjectConfigException; +import org.opensmartgridplatform.dlms.services.ObjectConfigService; +import org.opensmartgridplatform.dto.valueobjects.smartmetering.SetSpecificAttributeValueRequestDto; +import org.opensmartgridplatform.shared.infra.jms.MessageMetadata; + +@ExtendWith(MockitoExtension.class) +class SetSpecificAttributeValueCommandExecutorTest { + + private SetSpecificAttributeValueCommandExecutor executor; + + @Mock private DlmsMessageListener dlmsMessageListener; + + @Mock private DlmsConnectionManager connectionManager; + + @Mock private DlmsConnection dlmsConnection; + + @Captor private ArgumentCaptor setParameterArgumentCaptor; + + private static final String WATCHDOG_OBJECT_TYPE = "WATCHDOG_TIMER"; + private static final String WATCHDOG_TIMER_OBIS = "0.1.94.31.2.255"; + private static final int CLASS_ID = 1; + private static final int ATTRIBUTE_ID = 2; + private static final int VALUE = 25; + + @BeforeEach + void setUp() throws IOException, ObjectConfigException { + final ObjectConfigService objectConfigService = new ObjectConfigService(); + this.executor = new SetSpecificAttributeValueCommandExecutor(objectConfigService); + } + + @ParameterizedTest + @EnumSource( + value = Protocol.class, + names = {"DSMR_2_2", "OTHER_PROTOCOL"}, + mode = EnumSource.Mode.EXCLUDE) + void testExecute(final Protocol protocol) throws Exception { + + final DlmsDevice testDevice = new DlmsDevice(); + testDevice.setProtocol(protocol); + testDevice.setWithListMax(1); + + final SetSpecificAttributeValueRequestDto requestData = + new SetSpecificAttributeValueRequestDto(WATCHDOG_OBJECT_TYPE, ATTRIBUTE_ID, VALUE); + + final AttributeAddress attributeAddress = + new AttributeAddress(CLASS_ID, this.WATCHDOG_TIMER_OBIS, ATTRIBUTE_ID, null); + final SetParameter expectedSetParameter = + new SetParameter(attributeAddress, DataObject.newUInteger16Data(VALUE)); + + when(this.connectionManager.getDlmsMessageListener()).thenReturn(this.dlmsMessageListener); + when(this.connectionManager.getConnection()).thenReturn(this.dlmsConnection); + when(this.dlmsConnection.set(this.setParameterArgumentCaptor.capture())) + .thenReturn(AccessResultCode.SUCCESS); + + // CALL + this.executor.execute( + this.connectionManager, testDevice, requestData, mock(MessageMetadata.class)); + + // VERIFY + assertThat(this.setParameterArgumentCaptor.getValue()) + .usingRecursiveComparison() + .isEqualTo(expectedSetParameter); + } + + @Test + void testExecuteNoObject() { + + final DlmsDevice testDevice = new DlmsDevice(); + testDevice.setProtocol(Protocol.DSMR_2_2); + + final SetSpecificAttributeValueRequestDto requestData = + new SetSpecificAttributeValueRequestDto(WATCHDOG_OBJECT_TYPE, ATTRIBUTE_ID, VALUE); + + // CALL + assertThrows( + IllegalArgumentException.class, + () -> { + this.executor.execute( + this.connectionManager, testDevice, requestData, mock(MessageMetadata.class)); + }); + } +} diff --git a/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Dsmr422Profile.java b/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Dsmr422Profile.java index 66ffa8e8b9f..47e4d175768 100644 --- a/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Dsmr422Profile.java +++ b/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Dsmr422Profile.java @@ -15,6 +15,7 @@ import org.opensmartgridplatform.dlms.interfaceclass.attribute.ProfileGenericAttribute; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.CaptureObject; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.DefinableLoadProfile; +import org.opensmartgridplatform.simulator.protocol.dlms.cosem.LongUnsignedData; import org.opensmartgridplatform.simulator.protocol.dlms.util.DynamicValues; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -77,4 +78,10 @@ public DefinableLoadProfile definableLoadProfile( return new DefinableLoadProfile(dynamicValues, cal, null, DEFAULT_CAPTURE_OBJECTS); } + + @Bean + public LongUnsignedData watchdogTimer() { + final String obisCode = "0.1.94.31.2.255"; + return new LongUnsignedData(obisCode, 72); // Default timer is 72 hours + } } diff --git a/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Smr5Profile.java b/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Smr5Profile.java index 875b67f86b2..e199d518edd 100644 --- a/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Smr5Profile.java +++ b/osgp/protocol-adapter-dlms/osgp-protocol-simulator-dlms/simulator/dlms-device-simulator/src/main/java/org/opensmartgridplatform/simulator/protocol/dlms/server/profile/Smr5Profile.java @@ -27,6 +27,7 @@ import org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.AdjacentCellInfo; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.GsmDiagnostic.CellInfo; +import org.opensmartgridplatform.simulator.protocol.dlms.cosem.LongUnsignedData; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusDailyBillingValuesPeriod1SMR5; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusDriverActiveFirmwareIdentifier; import org.opensmartgridplatform.simulator.protocol.dlms.cosem.MBusDriverActiveFirmwareSignature; @@ -712,4 +713,10 @@ public GsmDiagnostic gsmGprsDiagnostic() { adjacentCellInfos, captureTime); } + + @Bean + public LongUnsignedData watchdogTimer() { + final String obisCode = "0.1.94.31.2.255"; + return new LongUnsignedData(obisCode, 72); // Default timer is 72 hours + } } diff --git a/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/NotificationTypeDto.java b/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/NotificationTypeDto.java index 1b81bf6e3a4..f7d2eb1803a 100644 --- a/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/NotificationTypeDto.java +++ b/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/NotificationTypeDto.java @@ -27,6 +27,7 @@ public enum NotificationTypeDto { SET_PUSH_SETUP_SMS, GET_ALL_ATTRIBUTE_VALUES, GET_SPECIFIC_ATTRIBUTE_VALUE, + SET_SPECIFIC_ATTRIBUTE_VALUE, SET_KEY_ON_G_METER, HANDLE_BUNDLED_ACTIONS, GET_ASSOCIATION_LN_OBJECTS, diff --git a/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/SetSpecificAttributeValueRequestDto.java b/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/SetSpecificAttributeValueRequestDto.java new file mode 100644 index 00000000000..aa09864e6d1 --- /dev/null +++ b/osgp/shared/osgp-dto/src/main/java/org/opensmartgridplatform/dto/valueobjects/smartmetering/SetSpecificAttributeValueRequestDto.java @@ -0,0 +1,26 @@ +// SPDX-FileCopyrightText: Copyright Contributors to the GXF project +// +// SPDX-License-Identifier: Apache-2.0 + +package org.opensmartgridplatform.dto.valueobjects.smartmetering; + +import java.io.Serial; +import lombok.Getter; + +@Getter +public class SetSpecificAttributeValueRequestDto implements ActionRequestDto { + + @Serial private static final long serialVersionUID = 6091630820323702494L; + + private final String objectType; + private final int attribute; + private final Integer intValue; + + public SetSpecificAttributeValueRequestDto( + final String objectType, final int attribute, final Integer intValue) { + super(); + this.objectType = objectType; + this.attribute = attribute; + this.intValue = intValue; + } +} diff --git a/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringAdhoc.wsdl b/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringAdhoc.wsdl index fc46ccb3460..260660d39b1 100644 --- a/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringAdhoc.wsdl +++ b/osgp/shared/osgp-ws-smartmetering/src/main/resources/SmartMeteringAdhoc.wsdl @@ -70,6 +70,25 @@ + + + + + + + + + + + + + + + @@ -176,6 +195,20 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -378,4 +443,4 @@ - \ No newline at end of file + diff --git a/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/adhoc-ws-smartmetering.xsd b/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/adhoc-ws-smartmetering.xsd index 997da0103f4..b7e86114ea5 100644 --- a/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/adhoc-ws-smartmetering.xsd +++ b/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/adhoc-ws-smartmetering.xsd @@ -148,6 +148,7 @@ + @@ -204,6 +205,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/bundle-ws-smartmetering.xsd b/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/bundle-ws-smartmetering.xsd index 80f34e9d039..cec39293040 100644 --- a/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/bundle-ws-smartmetering.xsd +++ b/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/bundle-ws-smartmetering.xsd @@ -249,6 +249,14 @@ + + + + + + + @@ -417,6 +425,7 @@ + @@ -566,6 +575,14 @@ + + + + + + + @@ -698,6 +715,7 @@ + diff --git a/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/notification-ws-smartmetering.xsd b/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/notification-ws-smartmetering.xsd index 90fb427a76a..618802a4378 100644 --- a/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/notification-ws-smartmetering.xsd +++ b/osgp/shared/osgp-ws-smartmetering/src/main/resources/schemas/notification-ws-smartmetering.xsd @@ -56,6 +56,7 @@ + diff --git a/osgp/shared/shared/src/main/java/org/opensmartgridplatform/shared/infra/jms/MessageType.java b/osgp/shared/shared/src/main/java/org/opensmartgridplatform/shared/infra/jms/MessageType.java index 25343c4561c..7511d7f2e43 100644 --- a/osgp/shared/shared/src/main/java/org/opensmartgridplatform/shared/infra/jms/MessageType.java +++ b/osgp/shared/shared/src/main/java/org/opensmartgridplatform/shared/infra/jms/MessageType.java @@ -94,6 +94,7 @@ public enum MessageType { SET_RANDOMISATION_SETTINGS, SET_REBOOT, SET_SPECIAL_DAYS, + SET_SPECIFIC_ATTRIBUTE_VALUE, SET_TARIFF_SCHEDULE, SET_THD_CONFIGURATION, SET_TRANSITION,