Search in sources :

Example 6 with ServiceError

use of com.beanit.openiec61850.ServiceError in project open-smart-grid-platform by OSGP.

the class Iec61850Client method readServerModelFromDevice.

/**
 * Read the device model from the device.
 *
 * @param clientAssociation The {@link ClientAssociation} instance.
 * @return A {@link ServerModel} instance.
 * @throws ProtocolAdapterException
 */
public ServerModel readServerModelFromDevice(final ClientAssociation clientAssociation) throws ProtocolAdapterException {
    try {
        LOGGER.debug("Start reading server model from device");
        // RetrieveModel() will call all GetDirectory and GetDefinition ACSI
        // services needed to get the complete server model.
        final ServerModel serverModel = clientAssociation.retrieveModel();
        LOGGER.debug("Completed reading server model from device");
        return serverModel;
    } catch (final ServiceError e) {
        clientAssociation.close();
        throw new ProtocolAdapterException("Service Error requesting model.", e);
    } catch (final IOException e) {
        throw new ProtocolAdapterException("Fatal IOException requesting model.", e);
    }
}
Also used : ServiceError(com.beanit.openiec61850.ServiceError) ServerModel(com.beanit.openiec61850.ServerModel) ProtocolAdapterException(org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.ProtocolAdapterException) IOException(java.io.IOException)

Aggregations

IOException (java.io.IOException)5 ServiceError (com.beanit.openiec61850.ServiceError)2 ServiceError (org.openmuc.openiec61850.ServiceError)2 NodeReadException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeReadException)2 ProtocolAdapterException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)2 NodeReadException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.NodeReadException)1 ProtocolAdapterException (com.alliander.osgp.adapter.protocol.iec61850.exceptions.ProtocolAdapterException)1 BasicDataAttribute (com.beanit.openiec61850.BasicDataAttribute)1 SclParseException (com.beanit.openiec61850.SclParseException)1 ServerModel (com.beanit.openiec61850.ServerModel)1 ArrayList (java.util.ArrayList)1 ServerModel (org.openmuc.openiec61850.ServerModel)1 DeviceMessageLog (org.opensmartgridplatform.adapter.protocol.iec61850.domain.valueobjects.DeviceMessageLog)1 ConnectionFailureException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.ConnectionFailureException)1 NodeWriteException (org.opensmartgridplatform.adapter.protocol.iec61850.exceptions.NodeWriteException)1