Renamed a couple of classes.

This commit is contained in:
akwizgran
2012-01-20 23:28:17 +00:00
parent 3a77ba9aaf
commit 48ceaaea2a
10 changed files with 29 additions and 24 deletions

View File

@@ -55,7 +55,8 @@ class ConnectionReaderFactoryImpl implements ConnectionReaderFactory {
new IncomingAuthenticationLayerImpl(correction, mac, macKey);
// No reordering or retransmission
IncomingReliabilityLayer reliability =
new NullIncomingReliabilityLayer(authentication);
new IncomingReliabilityLayerImpl(authentication,
new NullFrameWindow());
// Create the reader - don't tolerate errors
return new ConnectionReaderImpl(reliability, false);
}
@@ -81,7 +82,7 @@ class ConnectionReaderFactoryImpl implements ConnectionReaderFactory {
Cipher tagCipher = crypto.getTagCipher();
Cipher segCipher = crypto.getSegmentCipher();
IncomingEncryptionLayer encryption =
new IncomingSegmentedEncryptionLayer(in, tagCipher, segCipher,
new SegmentedIncomingEncryptionLayer(in, tagCipher, segCipher,
tagKey, segKey, false, bufferedSegment);
// No error correction
IncomingErrorCorrectionLayer correction =
@@ -92,7 +93,8 @@ class ConnectionReaderFactoryImpl implements ConnectionReaderFactory {
new IncomingAuthenticationLayerImpl(correction, mac, macKey);
// No reordering or retransmission
IncomingReliabilityLayer reliability =
new NullIncomingReliabilityLayer(authentication);
new IncomingReliabilityLayerImpl(authentication,
new NullFrameWindow());
// Create the reader - don't tolerate errors
return new ConnectionReaderImpl(reliability, false);
}

View File

@@ -60,7 +60,7 @@ class ConnectionWriterFactoryImpl implements ConnectionWriterFactory {
Cipher tagCipher = crypto.getTagCipher();
Cipher segCipher = crypto.getSegmentCipher();
OutgoingEncryptionLayer encryption =
new OutgoingSegmentedEncryptionLayer(out, capacity, tagCipher,
new SegmentedOutgoingEncryptionLayer(out, capacity, tagCipher,
segCipher, tagKey, segKey, false);
// No error correction
OutgoingErrorCorrectionLayer correction =

View File

@@ -2,16 +2,17 @@ package net.sf.briar.transport;
import java.io.IOException;
class NullIncomingReliabilityLayer implements IncomingReliabilityLayer {
class IncomingReliabilityLayerImpl implements IncomingReliabilityLayer {
private final IncomingAuthenticationLayer in;
private final int maxFrameLength;
private final FrameWindow window;
private final int maxFrameLength;
NullIncomingReliabilityLayer(IncomingAuthenticationLayer in) {
IncomingReliabilityLayerImpl(IncomingAuthenticationLayer in,
FrameWindow window) {
this.in = in;
this.window = window;
maxFrameLength = in.getMaxFrameLength();
window = new NullFrameWindow();
}
public boolean readFrame(Frame f) throws IOException, InvalidDataException {

View File

@@ -15,7 +15,7 @@ import net.sf.briar.api.crypto.ErasableKey;
import net.sf.briar.api.plugins.SegmentSource;
import net.sf.briar.api.transport.Segment;
class IncomingSegmentedEncryptionLayer implements IncomingEncryptionLayer {
class SegmentedIncomingEncryptionLayer implements IncomingEncryptionLayer {
private final SegmentSource in;
private final Cipher tagCipher, segCipher;
@@ -29,7 +29,7 @@ class IncomingSegmentedEncryptionLayer implements IncomingEncryptionLayer {
private boolean firstSegment = true;
private long segmentNumber = 0L;
IncomingSegmentedEncryptionLayer(SegmentSource in, Cipher tagCipher,
SegmentedIncomingEncryptionLayer(SegmentSource in, Cipher tagCipher,
Cipher segCipher, ErasableKey tagKey, ErasableKey segKey,
boolean tagEverySegment, Segment bufferedSegment) {
this.in = in;

View File

@@ -15,7 +15,7 @@ import net.sf.briar.api.crypto.ErasableKey;
import net.sf.briar.api.plugins.SegmentSink;
import net.sf.briar.api.transport.Segment;
class OutgoingSegmentedEncryptionLayer implements OutgoingEncryptionLayer {
class SegmentedOutgoingEncryptionLayer implements OutgoingEncryptionLayer {
private final SegmentSink out;
private final Cipher tagCipher, segCipher;
@@ -27,7 +27,7 @@ class OutgoingSegmentedEncryptionLayer implements OutgoingEncryptionLayer {
private long capacity;
OutgoingSegmentedEncryptionLayer(SegmentSink out, long capacity,
SegmentedOutgoingEncryptionLayer(SegmentSink out, long capacity,
Cipher tagCipher, Cipher segCipher, ErasableKey tagKey,
ErasableKey segKey, boolean tagEverySegment) {
this.out = out;