protected final void writeTransactionResponse(boolean isTransfer, ResponseCode response, CommunicationsSession commsSession) throws IOException { writeTransactionResponse(isTransfer, response, commsSession, null); }
writeTransactionResponse(false, ResponseCode.TRANSACTION_FINISHED_BUT_DESTINATION_FULL, commsSession); } else { writeTransactionResponse(false, ResponseCode.TRANSACTION_FINISHED, commsSession);
writeTransactionResponse(true, ResponseCode.NO_MORE_DATA, commsSession); return 0; writeTransactionResponse(true, ResponseCode.MORE_DATA, commsSession); if (continueTransaction) { logger.debug("{} Sending ContinueTransaction indicator to {}", this, peer); writeTransactionResponse(true, ResponseCode.CONTINUE_TRANSACTION, commsSession); } else { logger.debug("{} Sending FinishTransaction indicator to {}", this, peer); writeTransactionResponse(true, ResponseCode.FINISH_TRANSACTION, commsSession); calculatedCRC = String.valueOf(checkedOutputStream.getChecksum().getValue());
String calculatedCRC = transaction.getCalculatedCRC(); if (!receivedCRC.equals(calculatedCRC)) { writeTransactionResponse(true, ResponseCode.BAD_CHECKSUM, commsSession); session.rollback(); throw new IOException(this + " Sent data to peer " + peer + " but calculated CRC32 Checksum as " writeTransactionResponse(true, ResponseCode.CONFIRM_TRANSACTION, commsSession, "");
writeTransactionResponse(false, ResponseCode.CONFIRM_TRANSACTION, commsSession, calculatedCRC);
protected final void writeTransactionResponse(boolean isTransfer, ResponseCode response, CommunicationsSession commsSession) throws IOException { writeTransactionResponse(isTransfer, response, commsSession, null); }
writeTransactionResponse(false, ResponseCode.TRANSACTION_FINISHED_BUT_DESTINATION_FULL, commsSession); } else { writeTransactionResponse(false, ResponseCode.TRANSACTION_FINISHED, commsSession);
writeTransactionResponse(true, ResponseCode.NO_MORE_DATA, commsSession); return 0; writeTransactionResponse(true, ResponseCode.MORE_DATA, commsSession); if (continueTransaction) { logger.debug("{} Sending ContinueTransaction indicator to {}", this, peer); writeTransactionResponse(true, ResponseCode.CONTINUE_TRANSACTION, commsSession); } else { logger.debug("{} Sending FinishTransaction indicator to {}", this, peer); writeTransactionResponse(true, ResponseCode.FINISH_TRANSACTION, commsSession); calculatedCRC = String.valueOf(checkedOutputStream.getChecksum().getValue());
String calculatedCRC = transaction.getCalculatedCRC(); if (!receivedCRC.equals(calculatedCRC)) { writeTransactionResponse(true, ResponseCode.BAD_CHECKSUM, commsSession); session.rollback(); throw new IOException(this + " Sent data to peer " + peer + " but calculated CRC32 Checksum as " writeTransactionResponse(true, ResponseCode.CONFIRM_TRANSACTION, commsSession, "");
writeTransactionResponse(false, ResponseCode.CONFIRM_TRANSACTION, commsSession, calculatedCRC);