Search in sources :

Example 1 with DecoupleMbusDeviceByChannelRequest

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

the class DecoupleMbusDeviceByChannelRequestFactory method fromGatewayAndChannel.

public static DecoupleMbusDeviceByChannelRequest fromGatewayAndChannel(final String gatewayDeviceIdentification, final String channel) {
    final DecoupleMbusDeviceByChannelRequest request = new DecoupleMbusDeviceByChannelRequest();
    request.setDeviceIdentification(gatewayDeviceIdentification);
    final DecoupleMbusDeviceByChannelRequestData requestData = new DecoupleMbusDeviceByChannelRequestData();
    requestData.setChannel(Short.parseShort(channel));
    request.setDecoupleMbusDeviceByChannelRequestData(requestData);
    return request;
}
Also used : DecoupleMbusDeviceByChannelRequestData(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequestData) DecoupleMbusDeviceByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequest)

Example 2 with DecoupleMbusDeviceByChannelRequest

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

the class DecoupleMbusDeviceByChannelSteps method theDecoupleGMeterFromEMeterRequestIsReceivedForAnUnknownDevice.

@When("^the Decouple M-Bus Device By Channel \"([^\"]*)\" from E-meter \"([^\"]*)\" request is received for an unknown gateway$")
public void theDecoupleGMeterFromEMeterRequestIsReceivedForAnUnknownDevice(final String channel, final String eMeter) throws WebServiceSecurityException {
    final DecoupleMbusDeviceByChannelRequest request = DecoupleMbusDeviceByChannelRequestFactory.fromGatewayAndChannel(eMeter, channel);
    try {
        this.smartMeteringInstallationClient.decoupleMbusDeviceByChannel(request);
        fail("A SoapFaultClientException should be thrown");
    } catch (final SoapFaultClientException e) {
        ScenarioContext.current().put(PlatformKeys.RESPONSE, e);
    }
}
Also used : SoapFaultClientException(org.springframework.ws.soap.client.SoapFaultClientException) DecoupleMbusDeviceByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequest) When(io.cucumber.java.en.When)

Example 3 with DecoupleMbusDeviceByChannelRequest

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

the class DecoupleMbusDeviceByChannelSteps method theDeCoupleMbusDeviceByChannelFromEmeterRequestIsReceived.

@When("^the Decouple M-Bus Device By Channel \"([^\"]*)\" from E-meter \"([^\"]*)\" request is received$")
public void theDeCoupleMbusDeviceByChannelFromEmeterRequestIsReceived(final String channel, final String eMeter) throws WebServiceSecurityException {
    final DecoupleMbusDeviceByChannelRequest request = DecoupleMbusDeviceByChannelRequestFactory.fromGatewayAndChannel(eMeter, channel);
    final DecoupleMbusDeviceByChannelAsyncResponse asyncResponse = this.smartMeteringInstallationClient.decoupleMbusDeviceByChannel(request);
    this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
}
Also used : DecoupleMbusDeviceByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse) DecoupleMbusDeviceByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequest) When(io.cucumber.java.en.When)

Example 4 with DecoupleMbusDeviceByChannelRequest

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

the class DecoupleMbusDeviceByChannelRequestFactory method fromSettings.

public static DecoupleMbusDeviceByChannelRequest fromSettings(final Map<String, String> settings) {
    final DecoupleMbusDeviceByChannelRequest request = new DecoupleMbusDeviceByChannelRequest();
    final DecoupleMbusDeviceByChannelRequestData requestData = new DecoupleMbusDeviceByChannelRequestData();
    requestData.setChannel(Short.valueOf(settings.get(PlatformKeys.KEY_CHANNEL)));
    request.setDecoupleMbusDeviceByChannelRequestData(requestData);
    request.setDeviceIdentification(settings.get(PlatformKeys.KEY_DEVICE_IDENTIFICATION));
    return request;
}
Also used : DecoupleMbusDeviceByChannelRequestData(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequestData) DecoupleMbusDeviceByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequest)

Aggregations

DecoupleMbusDeviceByChannelRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequest)4 When (io.cucumber.java.en.When)2 DecoupleMbusDeviceByChannelRequestData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelRequestData)2 DecoupleMbusDeviceByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse)1 SoapFaultClientException (org.springframework.ws.soap.client.SoapFaultClientException)1