use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setMbusUserKeyByChannel.
@PayloadRoot(localPart = "SetMbusUserKeyByChannelRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetMbusUserKeyByChannelAsyncResponse setMbusUserKeyByChannel(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetMbusUserKeyByChannelRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final SetMbusUserKeyByChannelRequestData setMbusUserKeyByChannelRequestData = this.configurationMapper.map(request.getSetMbusUserKeyByChannelRequestData(), SetMbusUserKeyByChannelRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_MBUS_USER_KEY_BY_CHANNEL).withMessageType(MessageType.SET_MBUS_USER_KEY_BY_CHANNEL).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, setMbusUserKeyByChannelRequestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetMbusUserKeyByChannelAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setClockConfiguration.
@PayloadRoot(localPart = "SetClockConfigurationRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetClockConfigurationAsyncResponse setClockConfiguration(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetClockConfigurationRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetClockConfigurationRequestData clockConfiguration = this.configurationMapper.map(request.getSetClockConfigurationData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetClockConfigurationRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_CLOCK_CONFIGURATION).withMessageType(MessageType.SET_CLOCK_CONFIGURATION).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, clockConfiguration);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetClockConfigurationAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method setAdministrativeStatus.
@PayloadRoot(localPart = "SetAdministrativeStatusRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public SetAdministrativeStatusAsyncResponse setAdministrativeStatus(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetAdministrativeStatusRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType dataRequest = this.configurationMapper.map(request.getEnabled(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.AdministrativeStatusType.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_ADMINISTRATIVE_STATUS).withMessageType(MessageType.SET_ADMINISTRATIVE_STATUS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, dataRequest);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.configurationMapper.map(asyncResponse, SetAdministrativeStatusAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringManagementEndpoint method enableDebuggingRequest.
@PayloadRoot(localPart = "EnableDebuggingRequest", namespace = NAMESPACE)
@ResponsePayload
public EnableDebuggingAsyncResponse enableDebuggingRequest(@OrganisationIdentification final String organisationIdentification, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @RequestPayload final EnableDebuggingRequest request, @BypassRetry final String bypassRetry) throws OsgpException {
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.ENABLE_DEBUGGING).withMessageType(MessageType.ENABLE_DEBUGGING).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, null);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.managementMapper.map(asyncResponse, EnableDebuggingAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringManagementEndpoint method findMessageLogsRequest.
/**
* Retrieve log messages. Looks like it will be executed asynchronously but actually it is
* executed synchronously. This was implemented like this to duplicate the behavior of the
* implementation in ws-admin, but supporting async notifications. Once there is a wider
* implementation of asynchronous requests and notifications, the ws-admin implementation will
* replace this one and this method can be removed.
*
* @param messagePriority unused because this request fakes asynchronous behavior.
* @param scheduleTime unused because this request fakes asynchronous behavior.
* @return AsyncResponse
* @throws OsgpException
*/
@PayloadRoot(localPart = "FindMessageLogsRequest", namespace = NAMESPACE)
@ResponsePayload
public FindMessageLogsAsyncResponse findMessageLogsRequest(@OrganisationIdentification final String organisationIdentification, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @RequestPayload final FindMessageLogsRequest request, @BypassRetry final String bypassRetry) throws OsgpException {
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.GET_MESSAGES).withMessageType(MessageType.GET_MESSAGES).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.managementService.enqueueAndSendFindLogsRequest(requestMessageMetadata, request.getPage());
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.managementMapper.map(asyncResponse, FindMessageLogsAsyncResponse.class);
}
Aggregations