Search in sources :

Example 6 with ServerModel

use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.

the class RtuSimulator method addRtuDevices.

private void addRtuDevices(final ServerModel serverModel) {
    final String rtuPrefix = "RTU";
    int i = 1;
    String logicalDeviceName = rtuPrefix + i;
    ModelNode rtuNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (rtuNode != null) {
        this.logicalDevices.add(new Rtu(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = rtuPrefix + i;
        rtuNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : Rtu(com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Rtu) ModelNode(org.openmuc.openiec61850.ModelNode)

Example 7 with ServerModel

use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.

the class RtuSimulator method addEngineDevices.

private void addEngineDevices(final ServerModel serverModel) {
    final String enginePrefix = "ENGINE";
    int i = 1;
    String logicalDeviceName = enginePrefix + i;
    ModelNode engineNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (engineNode != null) {
        this.logicalDevices.add(new Engine(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = enginePrefix + i;
        engineNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : ModelNode(org.openmuc.openiec61850.ModelNode) Engine(com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Engine)

Example 8 with ServerModel

use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.

the class RtuSimulator method addGasFurnaceDevices.

private void addGasFurnaceDevices(final ServerModel serverModel) {
    final String gasFurnacePrefix = "GAS_FURNACE";
    int i = 1;
    String logicalDeviceName = gasFurnacePrefix + i;
    ModelNode gasFurnaceNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (gasFurnaceNode != null) {
        this.logicalDevices.add(new GasFurnace(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = gasFurnacePrefix + i;
        gasFurnaceNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : GasFurnace(com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.GasFurnace) ModelNode(org.openmuc.openiec61850.ModelNode)

Example 9 with ServerModel

use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.

the class RtuSimulator method addHeatBufferDevices.

private void addHeatBufferDevices(final ServerModel serverModel) {
    final String heatBufferPrefix = "HEAT_BUFFER";
    int i = 1;
    String logicalDeviceName = heatBufferPrefix + i;
    ModelNode heatBufferNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    while (heatBufferNode != null) {
        this.logicalDevices.add(new HeatBuffer(this.getDeviceName(), logicalDeviceName, serverModel));
        i += 1;
        logicalDeviceName = heatBufferPrefix + i;
        heatBufferNode = serverModel.getChild(this.getDeviceName() + logicalDeviceName);
    }
}
Also used : ModelNode(org.openmuc.openiec61850.ModelNode) HeatBuffer(com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.HeatBuffer)

Example 10 with ServerModel

use of org.openmuc.openiec61850.ServerModel in project Protocol-Adapter-IEC61850 by OSGP.

the class Iec61850DaRtuDeviceService method getData.

@Override
public void getData(final DaDeviceRequest deviceRequest, final DeviceResponseHandler deviceResponseHandler, final DaRtuDeviceRequestMessageProcessor messageProcessor) throws JMSException {
    try {
        final String serverName = this.getServerName(deviceRequest);
        final ServerModel serverModel = this.connectAndRetrieveServerModel(deviceRequest, serverName);
        final ClientAssociation clientAssociation = this.iec61850DeviceConnectionService.getClientAssociation(deviceRequest.getDeviceIdentification());
        final Serializable dataResponse = this.handleGetData(new DeviceConnection(new Iec61850Connection(new Iec61850ClientAssociation(clientAssociation, null), serverModel), deviceRequest.getDeviceIdentification(), deviceRequest.getOrganisationIdentification(), serverName), deviceRequest, messageProcessor);
        final DaDeviceResponse deviceResponse = new DaDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), DeviceMessageStatus.OK, dataResponse);
        deviceResponseHandler.handleResponse(deviceResponse);
    } catch (final ConnectionFailureException se) {
        LOGGER.error("Could not connect to device after all retries", se);
        final EmptyDeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), DeviceMessageStatus.FAILURE);
        deviceResponseHandler.handleConnectionFailure(se, deviceResponse);
    } catch (final Exception e) {
        LOGGER.error("Unexpected exception during Get Data", e);
        final EmptyDeviceResponse deviceResponse = new EmptyDeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid(), DeviceMessageStatus.FAILURE);
        deviceResponseHandler.handleException(e, deviceResponse);
    }
}
Also used : DaDeviceResponse(com.alliander.osgp.adapter.protocol.iec61850.device.da.rtu.DaDeviceResponse) Serializable(java.io.Serializable) ServerModel(org.openmuc.openiec61850.ServerModel) Iec61850Connection(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850Connection) Iec61850ClientAssociation(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850ClientAssociation) ConnectionFailureException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException) DeviceConnection(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection) Iec61850ClientAssociation(com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850ClientAssociation) ClientAssociation(org.openmuc.openiec61850.ClientAssociation) ConnectionFailureException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException) JMSException(javax.jms.JMSException) ProtocolAdapterException(com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException) EmptyDeviceResponse(com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.EmptyDeviceResponse)

Aggregations

ModelNode (org.openmuc.openiec61850.ModelNode)21 ServerModel (org.openmuc.openiec61850.ServerModel)17 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)7 ConnectionFailureException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ConnectionFailureException)4 Iec61850ClientAssociation (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850ClientAssociation)4 Iec61850Connection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.Iec61850Connection)4 DeviceConnection (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.helper.DeviceConnection)4 ClientAssociation (org.openmuc.openiec61850.ClientAssociation)4 EmptyDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.EmptyDeviceResponse)3 JMSException (javax.jms.JMSException)3 DaDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.da.rtu.DaDeviceResponse)1 GetDataDeviceResponse (com.alliander.osgp.adapter.protocol.iec61850.device.ssld.responses.GetDataDeviceResponse)1 Iec61850Device (com.alliander.osgp.adapter.protocol.iec61850.domain.entities.Iec61850Device)1 Iec61850ClientBaseEventListener (com.alliander.osgp.adapter.protocol.iec61850.infra.networking.reporting.Iec61850ClientBaseEventListener)1 GetDataResponseDto (com.alliander.osgp.dto.valueobjects.microgrids.GetDataResponseDto)1 Battery (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Battery)1 Boiler (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Boiler)1 Chp (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Chp)1 Engine (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.Engine)1 GasFurnace (com.alliander.osgp.simulator.protocol.iec61850.server.logicaldevices.GasFurnace)1