use of org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.GetStatusAsyncResponse in project open-smart-grid-platform by OSGP.
the class DeviceInstallationEndpoint method getStatus.
@PayloadRoot(localPart = "GetStatusRequest", namespace = DEVICE_INSTALLATION_NAMESPACE)
@ResponsePayload
public GetStatusAsyncResponse getStatus(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetStatusRequest request, @MessagePriority final String messagePriority) throws OsgpException {
LOGGER.info("Get Status received from organisation: {} for device: {} with message priority: {}.", organisationIdentification, request.getDeviceIdentification(), messagePriority);
final GetStatusAsyncResponse response = new GetStatusAsyncResponse();
try {
final String correlationUid = this.deviceInstallationService.enqueueGetStatusRequest(organisationIdentification, request.getDeviceIdentification(), MessagePriorityEnum.getMessagePriority(messagePriority));
final AsyncResponse asyncResponse = new AsyncResponse();
asyncResponse.setCorrelationUid(correlationUid);
asyncResponse.setDeviceId(request.getDeviceIdentification());
response.setAsyncResponse(asyncResponse);
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.GetStatusAsyncResponse in project open-smart-grid-platform by OSGP.
the class GetStatusSteps method theDeviceInstallationGetStatusAsyncResponseContains.
@Then("the device installation get status async response contains")
public void theDeviceInstallationGetStatusAsyncResponseContains(final Map<String, String> expectedResponseData) throws Throwable {
final GetStatusAsyncResponse asyncResponse = (GetStatusAsyncResponse) ScenarioContext.current().get(PlatformKeys.RESPONSE);
assertThat(asyncResponse.getAsyncResponse().getCorrelationUid()).isNotNull();
assertThat(asyncResponse.getAsyncResponse().getDeviceId()).isEqualTo(getString(expectedResponseData, PlatformKeys.KEY_DEVICE_IDENTIFICATION));
saveCorrelationUidInScenarioContext(asyncResponse.getAsyncResponse().getCorrelationUid(), getString(expectedResponseData, PlatformKeys.KEY_ORGANIZATION_IDENTIFICATION, PlatformDefaults.DEFAULT_ORGANIZATION_IDENTIFICATION));
}
Aggregations