This commit is contained in:
zzz
2013-06-07 02:03:36 +00:00
parent ebc5e72908
commit 0fb4f6ab6a
7 changed files with 58 additions and 2 deletions

View File

@@ -16,6 +16,18 @@ import java.io.OutputStream;
/**
* Defines the class as a standard object with particular bit representation,
* exposing methods to read and write that representation.
*<p>
* Do not reuse objects.
* Many of modifying methods contain checks to prevent
* altering a DataStructure after it is initialized. This protects the netdb,
* messages that contain DataStructures,
* caches, and the object itself from simple causes of corruption, by
* throwing IllegalStateExceptions.
* These checks are not necessarily thread-safe, and are not guaranteed
* to catch all possible means of corruption.
* Beware of other avenues of corruption, such as directly modifying data
* stored in byte[] objects.
*</p>
*
* @author jrandom
*/
@@ -62,4 +74,4 @@ public interface DataStructure /* extends Serializable */ {
* @return SHA256 hash, or null if there were problems (data format or io errors)
*/
public Hash calculateHash();
}
}

View File

@@ -12,15 +12,28 @@ package net.i2p.data;
import net.i2p.crypto.DSAEngine;
/**
*<p>
* Base implementation of common methods for the two data structures
* that are stored in the netDb, i.e. LeaseSet and RouterInfo.
* Implemented in 0.8.2 and retrofitted over LeaseSet and RouterInfo.
*
* This consolidates some common code and makes it easier to
* implement the NetDB and I2NP without doing instanceof all over the place.
*
*</p><p>
* DatabaseEntries have a SHA256 hash, a routing key, a timestamp, and
* signatures.
*</p><p>
* Do not reuse objects.
* Many of the setters and other methods contain checks to prevent
* altering a DatabaseEntry after it is signed. This protects the netdb,
* messages that contain DatabaseEntries,
* and the object itself from simple causes of corruption, by
* throwing IllegalStateExceptions.
* These checks are not necessarily thread-safe, and are not guaranteed
* to catch all possible means of corruption.
* Beware of other avenues of corruption, such as directly modifying data
* stored in byte[] objects.
*</p>
*
* @author zzz
* @since 0.8.2

View File

@@ -3,5 +3,10 @@
<p>
Core I2P package, contains information about the I2P version and an entry point to access important elements.
</p>
<p>
With a few exceptions,
this package and all others in i2p.jar are maintained as a stable API for use
by apps, clients, and plugins.
</p>
</body>
</html>

View File

@@ -9,6 +9,16 @@
<title>BlockFile</title>
</head>
<body>
<p>
I2P Notes:
This is the database used by the BlockfileNamingService class.
It is heavily modified from the original 0.1.1 version.
Not for direct use by apps, clients, or plugins.
This package is not currently intended for general use, as
the API may be subject to change.
Contact I2P developers if you are considering use in another application.
Following is the original documentation copied from metanotion website.
</p>
<h1>Metanotion BlockFile Database</h1>
<p>A 100% Java 1.3, BSD Licensed, embeddable single file database engine in 32KB. This database was designed for PDA based and J2ME applications.</p>