From a24275d9fc6d9c5f44a63da163508031e4d2f634 Mon Sep 17 00:00:00 2001 From: akwizgran <michael@briarproject.org> Date: Sat, 15 Dec 2012 02:55:57 +0000 Subject: [PATCH] Javadocs for reliability package. --- .../api/reliability/ReliabilityLayer.java | 21 +++++++++++++++++++ .../reliability/ReliabilityLayerFactory.java | 1 + 2 files changed, 22 insertions(+) diff --git a/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayer.java b/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayer.java index ae1938039f..b997084aec 100644 --- a/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayer.java +++ b/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayer.java @@ -3,13 +3,34 @@ package net.sf.briar.api.reliability; import java.io.InputStream; import java.io.OutputStream; +/** + * A protocol layer that attempts to ensure reliable, ordered delivery of data + * across an unreliable lower layer. Interactions with the lower layer use the + * buffer-oriented {@link ReadHandler} and {@link WriteHandler} interfaces; the + * reliability layer presents stream-oriented {@link java.io.InputStream} and + * {@link java.io.OutputStream} interfaces to higher layers. + */ public interface ReliabilityLayer extends ReadHandler { + /** Starts the reliability layer. */ void start(); + /** + * Stops the reliability layer. After this method returns, no more data + * will be sent to lower layers, and any data received from lower layers + * will be ignored. + */ void stop(); + /** + * Returns an input stream for higher layers to read from the reliability + * layer. + */ InputStream getInputStream(); + /** + * Returns an output stream for higher layers to write to the reliability + * layer. + */ OutputStream getOutputStream(); } diff --git a/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayerFactory.java b/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayerFactory.java index 96b4a51b40..848e3e6b08 100644 --- a/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayerFactory.java +++ b/briar-api/src/net/sf/briar/api/reliability/ReliabilityLayerFactory.java @@ -2,5 +2,6 @@ package net.sf.briar.api.reliability; public interface ReliabilityLayerFactory { + /** Returns a reliability layer that writes to the given lower layer. */ ReliabilityLayer createReliabilityLayer(WriteHandler writeHandler); } -- GitLab