use of org.opensmartgridplatform.adapter.ws.smartmetering.endpoints.RequestMessageMetadata in project open-smart-grid-platform by OSGP.
the class RequestService method enqueueAndSendRequest.
public AsyncResponse enqueueAndSendRequest(final RequestMessageMetadata requestMessageMetadata, final Serializable requestData) throws FunctionalException {
log.debug("{} called with organisation {} and device {}", requestMessageMetadata.getMessageType(), requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification());
if (requestMessageMetadata.getDeviceFunction() != null) {
this.checkAllowed(requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification(), requestMessageMetadata.getDeviceFunction());
}
final String correlationUid = this.correlationIdProviderService.getCorrelationId(requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification());
final MessageMetadata messageMetadata = requestMessageMetadata.newMessageMetadata(correlationUid);
final SmartMeteringRequestMessage message = SmartMeteringRequestMessage.newBuilder().messageMetadata(messageMetadata).request(requestData).build();
this.smartMeteringRequestMessageSender.send(message);
return this.createAsyncResponse(correlationUid, messageMetadata.getDeviceIdentification());
}
use of org.opensmartgridplatform.adapter.ws.smartmetering.endpoints.RequestMessageMetadata in project open-smart-grid-platform by OSGP.
the class ManagementService method enqueueAndSendFindLogsRequest.
public AsyncResponse enqueueAndSendFindLogsRequest(final RequestMessageMetadata requestMessageMetadata, final int pageNumber) throws FunctionalException {
log.debug("{} called with organisation {} and device {}", requestMessageMetadata.getMessageType(), requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification());
this.requestService.checkAllowed(requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification(), requestMessageMetadata.getDeviceFunction());
final String correlationUid = this.correlationIdProviderService.getCorrelationId(requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification());
final MessageMetadata deviceMessageMetadata = requestMessageMetadata.newMessageMetadata(correlationUid);
this.findMessageLogsSyncRequestExecutor.execute(requestMessageMetadata.getOrganisationIdentification(), requestMessageMetadata.getDeviceIdentification(), correlationUid, pageNumber);
return this.requestService.createAsyncResponse(correlationUid, deviceMessageMetadata.getDeviceIdentification());
}
Aggregations