Search in sources :

Example 1 with CoupleMbusDeviceByChannelAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse in project open-smart-grid-platform by OSGP.

the class SmartMeteringInstallationEndpoint method coupleMbusDeviceByChannel.

/**
 * @param organisationIdentification the organization requesting the coupling of devices
 * @param request the CoupleMbusDeviceByChannelRequest containing the gatewayDeviceIdentification
 *     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 = "CoupleMbusDeviceByChannelRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public CoupleMbusDeviceByChannelAsyncResponse coupleMbusDeviceByChannel(@OrganisationIdentification final String organisationIdentification, @RequestPayload final CoupleMbusDeviceByChannelRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
    final CoupleMbusDeviceByChannelRequestData requestData = new CoupleMbusDeviceByChannelRequestData(request.getCoupleMbusDeviceByChannelRequestData().getChannel());
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.COUPLE_MBUS_DEVICE_BY_CHANNEL).withMessageType(MessageType.COUPLE_MBUS_DEVICE_BY_CHANNEL).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, CoupleMbusDeviceByChannelAsyncResponse.class);
}
Also used : CoupleMbusDeviceByChannelRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CoupleMbusDeviceByChannelRequestData) CoupleMbusDeviceByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse) AsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse) AddDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse) DecoupleMbusDeviceByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse) DecoupleMbusDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse) CoupleMbusDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceAsyncResponse) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 2 with CoupleMbusDeviceByChannelAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse in project open-smart-grid-platform by OSGP.

the class CoupleDeviceSteps method theCoupleMBusDeviceByChannelRequestIsReceived.

@When("^the Couple M-Bus Device By Channel request is received$")
public void theCoupleMBusDeviceByChannelRequestIsReceived(final Map<String, String> settings) throws Throwable {
    final CoupleMbusDeviceByChannelRequest request = CoupleMbusDeviceByChannelRequestFactory.fromSettings(settings);
    final CoupleMbusDeviceByChannelAsyncResponse asyncResponse = this.smartMeteringInstallationClient.coupleMbusDeviceByChannel(request);
    this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
}
Also used : CoupleMbusDeviceByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelRequest) CoupleMbusDeviceByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse) When(io.cucumber.java.en.When)

Aggregations

CoupleMbusDeviceByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse)2 When (io.cucumber.java.en.When)1 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 AddDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse)1 CoupleMbusDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceAsyncResponse)1 CoupleMbusDeviceByChannelRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelRequest)1 DecoupleMbusDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse)1 DecoupleMbusDeviceByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse)1 CoupleMbusDeviceByChannelRequestData (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.CoupleMbusDeviceByChannelRequestData)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1