Search in sources :

Example 1 with GetConfigurationObjectResponse

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse in project open-smart-grid-platform by OSGP.

the class ConfigurationService method handleGetConfigurationObjectResponse.

public void handleGetConfigurationObjectResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final GetConfigurationObjectResponseDto resultData) {
    log.info("handle GetConfigurationObject response for MessageType: {}", messageMetadata.getMessageType());
    final GetConfigurationObjectResponse response = this.configurationMapper.map(resultData, GetConfigurationObjectResponse.class);
    ResponseMessageResultType result = deviceResult;
    if (exception != null) {
        log.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception);
        result = ResponseMessageResultType.NOT_OK;
    }
    final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).withDataObject(response).build();
    this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
Also used : GetConfigurationObjectResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse) ResponseMessage(org.opensmartgridplatform.shared.infra.jms.ResponseMessage) ResponseMessageResultType(org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType)

Example 2 with GetConfigurationObjectResponse

use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse in project open-smart-grid-platform by OSGP.

the class GetConfigurationObjectResponseMappingTest method testMapGetConfigurationObjectResponseDto.

@Test
public void testMapGetConfigurationObjectResponseDto() {
    final GetConfigurationObjectResponseDto dto = this.makeGetConfigurationObjectResponseDto();
    final GetConfigurationObjectResponse result = this.mapper.map(dto, GetConfigurationObjectResponse.class);
    assertThat(result).withFailMessage("mapping GetConfigurationObjectResponseDto should not return null").isNotNull();
    assertThat(result).withFailMessage("mapping GetConfigurationObjectResponseDto should return correct type").isOfAnyClassIn(GetConfigurationObjectResponse.class);
}
Also used : GetConfigurationObjectResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.GetConfigurationObjectResponseDto) GetConfigurationObjectResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse) Test(org.junit.jupiter.api.Test)

Aggregations

GetConfigurationObjectResponse (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetConfigurationObjectResponse)2 Test (org.junit.jupiter.api.Test)1 GetConfigurationObjectResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.GetConfigurationObjectResponseDto)1 ResponseMessage (org.opensmartgridplatform.shared.infra.jms.ResponseMessage)1 ResponseMessageResultType (org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType)1