use of org.opensmartgridplatform.adapter.ws.microgrids.infra.jms.MicrogridsRequestMessage in project open-smart-grid-platform by OSGP.
the class MicrogridsService method enqueueSetDataRequest.
public String enqueueSetDataRequest(final String organisationIdentification, final String deviceIdentification, final SetDataRequest setDataRequest) throws OsgpException {
LOGGER.debug("enqueueSetDataRequest called with organisation {} and device {}", organisationIdentification, deviceIdentification);
final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification);
final String correlationUid = this.correlationIdProviderService.getCorrelationId(organisationIdentification, deviceIdentification);
final RtuDevice device = this.domainHelperService.findDevice(deviceIdentification);
this.domainHelperService.isAllowed(organisation, device, DeviceFunction.SET_DATA);
final MicrogridsRequestMessage message = new MicrogridsRequestMessage(MessageType.SET_DATA, correlationUid, organisationIdentification, deviceIdentification, setDataRequest);
try {
this.requestMessageSender.send(message);
} catch (final ArgumentNullOrEmptyException e) {
throw new TechnicalException(ComponentType.WS_MICROGRIDS, e);
}
return correlationUid;
}
use of org.opensmartgridplatform.adapter.ws.microgrids.infra.jms.MicrogridsRequestMessage in project open-smart-grid-platform by OSGP.
the class MicrogridsService method enqueueGetDataRequest.
public String enqueueGetDataRequest(@Identification final String organisationIdentification, @Identification final String deviceIdentification, @NotNull final GetDataRequest dataRequest) throws OsgpException {
LOGGER.debug("enqueueGetDataRequest called with organisation {} and device {}", organisationIdentification, deviceIdentification);
final Organisation organisation = this.domainHelperService.findOrganisation(organisationIdentification);
final String correlationUid = this.correlationIdProviderService.getCorrelationId(organisationIdentification, deviceIdentification);
final RtuDevice device = this.domainHelperService.findDevice(deviceIdentification);
this.domainHelperService.isAllowed(organisation, device, DeviceFunction.GET_DATA);
final MicrogridsRequestMessage message = new MicrogridsRequestMessage(MessageType.GET_DATA, correlationUid, organisationIdentification, deviceIdentification, dataRequest);
try {
this.requestMessageSender.send(message);
} catch (final ArgumentNullOrEmptyException e) {
throw new TechnicalException(ComponentType.WS_MICROGRIDS, e);
}
return correlationUid;
}
Aggregations