if (arg instanceof ObserverNotification) {
// cast notification and type.
final ObserverNotification notification = (ObserverNotification) arg;
final NotificationType type = notification.getType();
logger.debug("Received notification: " + type.toString());
switch (type) {
case exportSuccessful:
exportSuccessful();
finished();
case convertSuccessful:
convertSuccessful();
break;
case convertFailed:
convertFailed((String) notification.getObj1());
break;
case netFileSuccessful:
netFileSuccessful();
break;
case netFileFailed:
netFileFailed((String) notification.getObj1());
break;
case rouFileSuccessful:
rouFileSuccessful();
break;
case rouFileFailed:
rouFileFailed((String) notification.getObj1());
break;
case cfgFileSuccessful:
cfgFileSuccessful();
break;
case cfgFileFailed:
cfgFileFailed((String) notification.getObj1());
break;
case tlsFileSuccessful:
tlsFileSuccessful();
break;
case tlsFileFailed:
tlsFileFailed((String) notification.getObj1());
break;
case addFileSuccessful:
addFileSuccessful();
break;
case addFileFailed:
addFileFailed((String) notification.getObj1());
break;
case sumoFilesSavedTo:
break;
default:
final Throwable stack = new RuntimeException();
logger.warn("Recieved unexpected notification type: " + type.toString(), stack);
}
} else {
// if argument was not handled until now, it is of unknown type.