Search in sources :

Example 1 with ClearAlarmRegisterRequestDto

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;
}
Also used : ClearAlarmRegisterRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto)

Example 2 with ClearAlarmRegisterRequestDto

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);
}
Also used : BundleMessagesRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.BundleMessagesRequestDto) MessageMetadata(org.opensmartgridplatform.shared.infra.jms.MessageMetadata) ActionDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto) ClearAlarmRegisterRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto)

Example 3 with ClearAlarmRegisterRequestDto

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());
}
Also used : SmartMeter(org.opensmartgridplatform.domain.core.entities.SmartMeter) ClearAlarmRegisterRequestDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto)

Aggregations

ClearAlarmRegisterRequestDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ClearAlarmRegisterRequestDto)3 SmartMeter (org.opensmartgridplatform.domain.core.entities.SmartMeter)1 ActionDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionDto)1 BundleMessagesRequestDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.BundleMessagesRequestDto)1 MessageMetadata (org.opensmartgridplatform.shared.infra.jms.MessageMetadata)1