use of com.alliander.osgp.shared.exceptionhandling.ConnectionFailureException in project Protocol-Adapter-OSLP by OSGP.
the class OslpDeviceService method handleException.
protected void handleException(final Throwable t, final DeviceRequest deviceRequest, final DeviceResponseHandler deviceResponseHandler) {
final DeviceResponse deviceResponse = new DeviceResponse(deviceRequest.getOrganisationIdentification(), deviceRequest.getDeviceIdentification(), deviceRequest.getCorrelationUid());
if (t instanceof IOException) {
// Replace t by an OSGP Exception
final ConnectionFailureException ex = new ConnectionFailureException(ComponentType.PROTOCOL_OSLP, "Connection failure");
deviceResponseHandler.handleException(ex, deviceResponse);
} else {
deviceResponseHandler.handleException(t, deviceResponse);
}
}
use of com.alliander.osgp.shared.exceptionhandling.ConnectionFailureException in project Protocol-Adapter-IEC61850 by OSGP.
the class Iec61850DeviceResponseHandler method handleConnectionFailure.
/*
* (non-Javadoc)
*
* @see
* com.alliander.osgp.adapter.protocol.iec61850.device.DeviceResponseHandler
* #handleConnectionFailure(java.lang.Throwable,
* com.alliander.osgp.adapter.protocol.iec61850.device.DeviceResponse)
*/
@Override
public void handleConnectionFailure(final Throwable t, final DeviceResponse deviceResponse) throws JMSException {
Objects.requireNonNull(t, "handleConnectionFailure() Throwable t may not be null");
final ConnectionFailureException connectionFailureException = new ConnectionFailureException(ComponentType.PROTOCOL_IEC61850, t.getMessage());
this.messageProcessor.checkForRedelivery(this.deviceMessageMetadata, connectionFailureException, this.domainInformation.getDomain(), this.domainInformation.getDomainVersion(), this.jmsxDeliveryCount);
}
Aggregations