/** * Reopen a connection to the client. * @param clientConnection * @param clientKnownDeltas * @throws OperationException * @throws TransformException */ public void reOpen(ServerConnectionMock clientConnection, List<HashedVersion> clientKnownDeltas) throws ChannelException, TransformException, OperationException { ReOpenInfo toClient = ccCore.reopen(clientKnownDeltas); // We have none of the client's signature. Then return the most recent. if (toClient == null) { HashedVersion startSignature = history.getCurrentSignature(); clientConnection.triggerOnOpen(startSignature, startSignature); } else { List<TransformedWaveletDelta> deltas = toClient.getDeltas(); HashedVersion startSignature = toClient.getStartSignature(); HashedVersion endSignature = deltas.size() > 0 ? deltas.get(deltas.size() - 1).getResultingVersion() : startSignature; clientConnection.triggerOnOpen(startSignature, endSignature); clientConnection.triggerServerDeltas(deltas); } }
/** * Reopen a connection to the client. * @param clientConnection * @param clientKnownDeltas * @throws OperationException * @throws TransformException */ public void reOpen(ServerConnectionMock clientConnection, List<HashedVersion> clientKnownDeltas) throws ChannelException, TransformException, OperationException { ReOpenInfo toClient = ccCore.reopen(clientKnownDeltas); // We have none of the client's signature. Then return the most recent. if (toClient == null) { HashedVersion startSignature = history.getCurrentSignature(); clientConnection.triggerOnOpen(startSignature, startSignature); } else { List<TransformedWaveletDelta> deltas = toClient.getDeltas(); HashedVersion startSignature = toClient.getStartSignature(); HashedVersion endSignature = deltas.size() > 0 ? deltas.get(deltas.size() - 1).getResultingVersion() : startSignature; clientConnection.triggerOnOpen(startSignature, endSignature); clientConnection.triggerServerDeltas(deltas); } }