use of org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto in project open-smart-grid-platform by OSGP.
the class ClearAlarmRegisterRequestMessageProcessor method handleMessage.
@Override
protected Serializable handleMessage(final DlmsConnectionManager conn, final DlmsDevice device, final Serializable requestObject, final MessageMetadata messageMetadata) throws OsgpException {
this.assertRequestObjectType(ClearAlarmRegisterRequestDto.class, requestObject);
final ClearAlarmRegisterRequestDto clearAlarmRegisterRequestDto = (ClearAlarmRegisterRequestDto) requestObject;
this.monitoringService.setClearAlarmRegister(conn, device, clearAlarmRegisterRequestDto, messageMetadata);
return null;
}
use of org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto in project open-smart-grid-platform by OSGP.
the class BundleMessageProcessorTest method prepareBundleServiceMockWithRequestAndResponse.
private void prepareBundleServiceMockWithRequestAndResponse(final ActionResponseDto response) throws JMSException {
final ActionDto action = new ActionDto(new ClearAlarmRegisterRequestDto());
action.setResponse(response);
final BundleMessagesRequestDto request = new BundleMessagesRequestDto(Arrays.asList(action));
when(this.message.getObject()).thenReturn(request);
when(this.bundleService.callExecutors(same(this.dlmsConnectionManager), same(this.dlmsDevice), same(request), any(MessageMetadata.class))).thenReturn(request);
}
use of org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto in project open-smart-grid-platform by OSGP.
the class MonitoringService method requestClearAlarmRegister.
public void requestClearAlarmRegister(final MessageMetadata messageMetadata, final ClearAlarmRegisterRequest clearAlarmRegisterRequestValueObject) throws FunctionalException {
LOGGER.info("Request clear alarm register for organisationIdentification: {} for deviceIdentification: {}", messageMetadata.getOrganisationIdentification(), messageMetadata.getDeviceIdentification());
final SmartMeter smartMeter = this.domainHelperService.findSmartMeter(messageMetadata.getDeviceIdentification());
final ClearAlarmRegisterRequestDto requestDto = this.monitoringMapper.map(clearAlarmRegisterRequestValueObject, ClearAlarmRegisterRequestDto.class);
this.osgpCoreRequestMessageSender.send(requestDto, messageMetadata.builder().withIpAddress(smartMeter.getIpAddress()).withNetworkSegmentIds(smartMeter.getBtsId(), smartMeter.getCellId()).build());
}
Aggregations