"executeCancellation should only be called after localCancel or remoteCancel!");
String errorMsg;
String cancelMessage;
if (cancellationCause instanceof LocalCancellationException) {
LocalCancellationException e = (LocalCancellationException) cancellationCause;
errorMsg = e.getMessage();
switch (e.getCancelOption()) {
case NOTIFY_PEER:
transmitter.sendCancelInvitationMessage(peer, errorMsg);
break;
case DO_NOT_NOTIFY_PEER:
break;
default:
log.warn("Inv" + Utils.prefix(peer)
+ ": This case is not expected here.");
}
if (errorMsg != null) {
cancelMessage = "Invitation was cancelled locally"
+ " because of an error: " + errorMsg;
log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
} else {
cancelMessage = "Invitation was cancelled by local user.";
log.debug("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
}
} else if (cancellationCause instanceof RemoteCancellationException) {
RemoteCancellationException e = (RemoteCancellationException) cancellationCause;
errorMsg = e.getMessage();
if (errorMsg != null) {
cancelMessage = "Invitation was cancelled by the remote user "
+ " because of an error on his/her side: " + errorMsg;
log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
} else {