Search in sources :

Example 21 with Address

use of org.opensmartgridplatform.domain.core.valueobjects.Address in project open-smart-grid-platform by OSGP.

the class WsInstallationDeviceToSsldConverter method convert.

@Override
public Ssld convert(final Device source, final Type<? extends Ssld> destinationType, final MappingContext mappingContext) {
    LOGGER.debug("Converting WS Installation Device into SSLD [{}]", source.getDeviceIdentification());
    final String deviceIdentification = source.getDeviceIdentification();
    final String alias = source.getAlias();
    final Address containerAddress = this.mapperFacade.map(source.getContainerAddress(), Address.class);
    final GpsCoordinates gpsCoordinates = new GpsCoordinates(source.getGpsLatitude(), source.getGpsLongitude());
    final Ssld ssld = new Ssld(deviceIdentification, alias, containerAddress, gpsCoordinates, null);
    ssld.setPublicKeyPresent(source.isPublicKeyPresent());
    return ssld;
}
Also used : Address(org.opensmartgridplatform.domain.core.valueobjects.Address) GpsCoordinates(org.opensmartgridplatform.domain.core.valueobjects.GpsCoordinates) Ssld(org.opensmartgridplatform.domain.core.entities.Ssld)

Aggregations

Address (org.opensmartgridplatform.domain.core.valueobjects.Address)21 GpsCoordinates (org.opensmartgridplatform.domain.core.valueobjects.GpsCoordinates)18 Test (org.junit.jupiter.api.Test)6 InetAddress (java.net.InetAddress)5 Device (org.opensmartgridplatform.domain.core.entities.Device)4 DeviceModel (org.opensmartgridplatform.domain.core.entities.DeviceModel)4 SmartMeter (org.opensmartgridplatform.domain.core.entities.SmartMeter)4 Ssld (org.opensmartgridplatform.domain.core.entities.Ssld)4 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)3 Given (io.cucumber.java.en.Given)2 UnknownHostException (java.net.UnknownHostException)2 LightMeasurementDevice (org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.LightMeasurementDevice)2 Ssld (org.opensmartgridplatform.adapter.ws.schema.publiclighting.adhocmanagement.Ssld)2 LightMeasurementDevice (org.opensmartgridplatform.domain.core.entities.LightMeasurementDevice)2 Transactional (org.springframework.transaction.annotation.Transactional)2 Instant (java.time.Instant)1 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)1 LightMeasurementDevice (org.opensmartgridplatform.adapter.ws.schema.core.deviceinstallation.LightMeasurementDevice)1