use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850TransitionCommand in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850SsldDeviceService method setTransition.
@Override
public void setTransition(final SetTransitionDeviceRequest deviceRequest, final DeviceResponseHandler deviceResponseHandler) throws JMSException {
DeviceConnection devCon = null;
try {
final DeviceConnection deviceConnection = this.connectToDevice(deviceRequest);
devCon = deviceConnection;
new Iec61850TransitionCommand().transitionDevice(this.iec61850Client, deviceConnection, deviceRequest.getTransitionTypeContainer());
this.createSuccessfulDefaultResponse(deviceRequest, deviceResponseHandler);
this.enableReporting(deviceConnection, deviceRequest);
} catch (final ConnectionFailureException se) {
this.handleConnectionFailureException(deviceRequest, deviceResponseHandler, se);
this.iec61850DeviceConnectionService.disconnect(devCon, deviceRequest);
} catch (final Exception e) {
this.handleException(deviceRequest, deviceResponseHandler, e);
this.iec61850DeviceConnectionService.disconnect(devCon, deviceRequest);
}
}
use of org.opensmartgridplatform.adapter.protocol.iec61850.infra.networking.services.commands.Iec61850TransitionCommand in project open-smart-grid-platform by OSGP.
the class Iec61850SsldDeviceService method setTransition.
@Override
public void setTransition(final SetTransitionDeviceRequest deviceRequest, final DeviceResponseHandler deviceResponseHandler) throws JMSException {
DeviceConnection devCon = null;
try {
final DeviceConnection deviceConnection = this.connectToDevice(deviceRequest);
devCon = deviceConnection;
new Iec61850TransitionCommand(this.deviceMessageLoggingService).transitionDevice(this.iec61850Client, deviceConnection, deviceRequest.getTransitionTypeContainer());
this.createSuccessfulDefaultResponse(deviceRequest, deviceResponseHandler);
this.enableReporting(deviceConnection, deviceRequest);
} catch (final ConnectionFailureException se) {
this.handleConnectionFailureException(deviceRequest, deviceResponseHandler, se);
this.iec61850DeviceConnectionService.disconnect(devCon, deviceRequest);
} catch (final Exception e) {
this.handleException(deviceRequest, deviceResponseHandler, e);
this.iec61850DeviceConnectionService.disconnect(devCon, deviceRequest);
}
}
Aggregations