use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DecoupleMbusDeviceRequestData in project open-smart-grid-platform by OSGP.
the class DecoupleMbusDeviceRequestMessageProcessor method handleMessage.
/*
* (non-Javadoc)
*
* @see org.opensmartgridplatform.adapter.domain.smartmetering.infra.jms.
* AbstractRequestMessageProcessor#handleMessage(org.opensmartgridplatform.shared.
* infra.jms.MessageMetadata, java.lang.Object)
*/
@Override
protected void handleMessage(final MessageMetadata deviceMessageMetadata, final Object dataObject) throws FunctionalException {
final DecoupleMbusDeviceRequestData requestData = (DecoupleMbusDeviceRequestData) dataObject;
this.installationService.decoupleMbusDevice(deviceMessageMetadata, requestData);
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DecoupleMbusDeviceRequestData in project open-smart-grid-platform by OSGP.
the class SmartMeteringInstallationEndpoint method decoupleMbusDevice.
/**
* @param organisationIdentification the organisation requesting the coupling of devices
* @param request the DecoupleMbusDeviceRequest containing the deviceIdentification,
* mbusDeviceIdentification and channel
* @param messagePriority the priority of the message
* @param scheduleTime the time the request is scheduled for
* @return a response containing a correlationUid and the deviceIdentification
* @throws OsgpException
*/
@PayloadRoot(localPart = "DecoupleMbusDeviceRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public DecoupleMbusDeviceAsyncResponse decoupleMbusDevice(@OrganisationIdentification final String organisationIdentification, @RequestPayload final DecoupleMbusDeviceRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final DecoupleMbusDeviceRequestData requestData = new DecoupleMbusDeviceRequestData(request.getMbusDeviceIdentification());
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.DECOUPLE_MBUS_DEVICE).withMessageType(MessageType.DECOUPLE_MBUS_DEVICE).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, requestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.installationMapper.map(asyncResponse, DecoupleMbusDeviceAsyncResponse.class);
}
Aggregations