Search in sources :

Example 16 with Iec60870Device

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device in project open-smart-grid-platform by OSGP.

the class Iec60870DeviceSteps method aLightMeasurementDevice.

@Given("a light sensor")
public void aLightMeasurementDevice(final Map<String, String> deviceData) {
    final Iec60870Device device = Iec60870DeviceFactory.fromSettings(this.settingsWithDeviceType(deviceData, DeviceType.LIGHT_SENSOR));
    this.deviceIsKnownInTheRepository(device);
}
Also used : Iec60870Device(org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device) Given(io.cucumber.java.en.Given)

Example 17 with Iec60870Device

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device in project open-smart-grid-platform by OSGP.

the class Iec60870DeviceFactory method createLightMeasurementDevice.

public static Iec60870Device createLightMeasurementDevice(final String deviceIdentification, final String gatewayDeviceIdentification) {
    final Iec60870Device device = new Iec60870Device(deviceIdentification, DeviceType.LIGHT_SENSOR);
    device.setGatewayDeviceIdentification(gatewayDeviceIdentification);
    return device;
}
Also used : Iec60870Device(org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)

Example 18 with Iec60870Device

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device in project open-smart-grid-platform by OSGP.

the class Iec60870DeviceFactory method createLightMeasurementGatewayDevice.

public static Iec60870Device createLightMeasurementGatewayDevice(final String deviceIdentification) {
    final Iec60870Device device = new Iec60870Device(deviceIdentification, DeviceType.LIGHT_MEASUREMENT_RTU);
    device.setCommonAddress(Integer.parseInt(DEFAULT_COMMON_ADDRESS));
    device.setPort(Integer.parseInt(DEFAULT_PORT));
    return device;
}
Also used : Iec60870Device(org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)

Example 19 with Iec60870Device

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device in project open-smart-grid-platform by OSGP.

the class Iec60870DeviceFactory method fromSettings.

public static Iec60870Device fromSettings(final Map<String, String> settings) {
    final Iec60870Device device = new Iec60870Device(getDeviceIdentificationOrDefault(settings), getDeviceTypeOrDefault(settings));
    device.setCommonAddress(getCommonAddressOrDefault(settings));
    device.setPort(getPortOrDefault(settings));
    optionalGatewayDeviceIdentification(settings).ifPresent(device::setGatewayDeviceIdentification);
    optionalInformationObjectAddress(settings).ifPresent(device::setInformationObjectAddress);
    return device;
}
Also used : Iec60870Device(org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)

Example 20 with Iec60870Device

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device in project open-smart-grid-platform by OSGP.

the class Iec60870DeviceFactory method createDefaultWith.

public static Iec60870Device createDefaultWith(final String deviceIdentification) {
    final Iec60870Device device = new Iec60870Device(deviceIdentification);
    device.setCommonAddress(Integer.parseInt(DEFAULT_COMMON_ADDRESS));
    device.setPort(Integer.parseInt(DEFAULT_PORT));
    return device;
}
Also used : Iec60870Device(org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)

Aggregations

Iec60870Device (org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)21 Test (org.junit.jupiter.api.Test)6 RequestMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.RequestMetadata)4 ResponseMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ResponseMetadata)4 ConnectionEventListener (org.openmuc.j60870.ConnectionEventListener)3 ClientConnectionAlreadyInCacheException (org.opensmartgridplatform.adapter.protocol.iec60870.domain.exceptions.ClientConnectionAlreadyInCacheException)2 ConnectionParameters (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ConnectionParameters)2 DomainInfo (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DomainInfo)2 MeasurementReportDto (org.opensmartgridplatform.dto.da.measurements.MeasurementReportDto)2 MessageMetadata (org.opensmartgridplatform.shared.infra.jms.MessageMetadata)2 Given (io.cucumber.java.en.Given)1 When (io.cucumber.java.en.When)1 ClientConnectionEventListener (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.ClientConnectionEventListener)1 DeviceConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceConnection)1 DeviceType (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceType)1 LightSensorStatusDto (org.opensmartgridplatform.dto.valueobjects.LightSensorStatusDto)1 ConnectionFailureException (org.opensmartgridplatform.shared.exceptionhandling.ConnectionFailureException)1