Search in sources :

Example 11 with Ssld

use of com.alliander.osgp.core.db.api.iec61850.entities.Ssld in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850SsldDeviceService method getConfiguration.

@Override
public void getConfiguration(final DeviceRequest deviceRequest, final DeviceResponseHandler deviceResponseHandler) throws JMSException {
    DeviceConnection deviceConnection = null;
    try {
        deviceConnection = this.connectToDevice(deviceRequest);
        // Getting the SSLD for the device output-settings.
        final Ssld ssld = this.ssldDataService.findDevice(deviceRequest.getDeviceIdentification());
        final ConfigurationDto configuration = new Iec61850GetConfigurationCommand().getConfigurationFromDevice(this.iec61850Client, deviceConnection, ssld, this.mapper);
        final GetConfigurationDeviceResponse response = new GetConfigurationDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), DeviceMessageStatus.OK, configuration);
        deviceResponseHandler.handleResponse(response);
    } catch (final ConnectionFailureException se) {
        this.handleConnectionFailureException(deviceRequest, deviceResponseHandler, se);
    } catch (final Exception e) {
        this.handleException(deviceRequest, deviceResponseHandler, e);
    }
    this.iec61850DeviceConnectionService.disconnect(deviceConnection, deviceRequest);
}
Also used : ConfigurationDto(com.alliander.osgp.dto.valueobjects.ConfigurationDto) GetConfigurationDeviceResponse(com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.GetConfigurationDeviceResponse) ConnectionFailureException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException) DeviceConnection(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection) Iec61850GetConfigurationCommand(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850GetConfigurationCommand) NodeWriteException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException) FunctionalException(com.alliander.osgp.shared.exceptionhandling.FunctionalException) JMSException(javax.jms.JMSException) ProtocolAdapterException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException) ConnectionFailureException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException) TechnicalException(com.alliander.osgp.shared.exceptionhandling.TechnicalException) Ssld(com.alliander.osgp.core.db.api.iec61850.entities.Ssld)

Aggregations

ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)8 Ssld (com.alliander.osgp.core.db.api.iec61850.entities.Ssld)8 NodeWriteException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeWriteException)7 FunctionalException (com.alliander.osgp.shared.exceptionhandling.FunctionalException)7 ConnectionFailureException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException)6 DeviceConnection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection)6 DeviceOutputSetting (com.alliander.osgp.core.db.api.iec61850.entities.DeviceOutputSetting)6 TechnicalException (com.alliander.osgp.shared.exceptionhandling.TechnicalException)6 JMSException (javax.jms.JMSException)6 LightValueDto (com.alliander.osgp.dto.valueobjects.LightValueDto)4 ArrayList (java.util.ArrayList)4 DeviceStatusDto (com.alliander.osgp.dto.valueobjects.DeviceStatusDto)3 DeviceMessageLog (com.alliander.osgp.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog)2 Function (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.Function)2 NodeContainer (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.NodeContainer)2 Iec61850GetStatusCommand (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850GetStatusCommand)2 Iec61850SetLightCommand (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850SetLightCommand)2 ConfigurationDto (com.alliander.osgp.dto.valueobjects.ConfigurationDto)2 LightTypeDto (com.alliander.osgp.dto.valueobjects.LightTypeDto)2 DeviceMessageStatus (com.alliander.osgp.adapter.protocol.iec61850.device.DeviceMessageStatus)1