|
From: <pe...@us...> - 2003-12-04 21:50:39
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/source
In directory sc8-pr-cvs1:/tmp/cvs-serv19614/src/java/org/neuclear/source
Modified Files:
CachedSource.java HttpSource.java Source.java
Log Message:
Mainly documentation changes.
Index: CachedSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/source/CachedSource.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** CachedSource.java 21 Nov 2003 04:45:14 -0000 1.13
--- CachedSource.java 4 Dec 2003 21:50:36 -0000 1.14
***************
*** 3,6 ****
--- 3,9 ----
* $Id$
* $Log$
+ * Revision 1.14 2003/12/04 21:50:36 pelle
+ * Mainly documentation changes.
+ *
* Revision 1.13 2003/11/21 04:45:14 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 107,110 ****
--- 110,118 ----
* This is a simple Cached version of the Source.
* It can be used in front of any other Source, such as a HTTP based source to cache items locally.
+ * <p/>
+ * The items are stored in a cache folder in the users home directory called:
+ * <p/>
+ * <code>~/.neuclear/cache</code>
+ * <p>This can safely be removed at all times.
*/
public final class CachedSource extends Source {
Index: HttpSource.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/source/HttpSource.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** HttpSource.java 21 Nov 2003 04:45:14 -0000 1.9
--- HttpSource.java 4 Dec 2003 21:50:36 -0000 1.10
***************
*** 1,11 ****
package org.neuclear.source;
- import org.neuclear.commons.NeuClearException;
- import org.neuclear.id.NSTools;
- import org.neuclear.id.SignedNamedObject;
-
- import java.io.InputStream;
- import java.net.URL;
-
/**
* (C) 2003 Antilles Software Ventures SA
--- 1,4 ----
***************
*** 15,18 ****
--- 8,14 ----
* $Id$
* $Log$
+ * Revision 1.10 2003/12/04 21:50:36 pelle
+ * Mainly documentation changes.
+ *
* Revision 1.9 2003/11/21 04:45:14 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 74,77 ****
--- 70,100 ----
* It doesnt quite verify things correctly yet. I'm not yet sure why.
* CommandLineSigner is simplified to make it easier to use.
+ */
+
+ import org.neuclear.commons.NeuClearException;
+ import org.neuclear.id.NSTools;
+ import org.neuclear.id.SignedNamedObject;
+
+ import java.io.InputStream;
+ import java.net.URL;
+
+ /**
+ * Implementation of Source that uses HTTP to fetch an XMLStream from a repository on a web server.
+ * <p/>
+ * The following points apply to storing the XML on the web site:
+ * <dl>
+ * <dt>The Endpoint provided should be the root of the repository of the webserver.</dt>
+ * <dd>Such as <tt>http://repository.neuclear.org</tt> and not <tt>http://repository.neuclear.org/test/bob@</tt>
+ * <dt>The files are to be stored like this on the web server:</dt>
+ * <dd>
+ * <table border="2"><tr><th>NeuClear ID</th><th>Relative path to root of repository on web server</th></tr>
+ * <tr><td><tt>neu://</tt></td><td>./root.id</td></tr>
+ * <tr><td><tt>neu://test</tt></td><td>./test/root.id</td></tr>
+ * <tr><td><tt>neu://bob@test</tt></td><td>./test/bob@/root.id</td></tr>
+ * <tr><td><tt>neu://test/alice</tt></td><td>./test/alice/root.id</td></tr>
+ * <tr><td><tt>neu://bob@test/funds</tt></td><td>./test/bob@/funds/root.id</td></tr>
+ * </table>
+ * </dd>
+ * </dl>
*/
public final class HttpSource extends Source {
Index: Source.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/source/Source.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Source.java 21 Nov 2003 04:45:14 -0000 1.7
--- Source.java 4 Dec 2003 21:50:36 -0000 1.8
***************
*** 1,15 ****
package org.neuclear.source;
- import org.neuclear.commons.NeuClearException;
- import org.neuclear.id.NSTools;
- import org.neuclear.id.SignedNamedObject;
- import org.neuclear.id.verifier.VerifyingReader;
- import org.neuclear.commons.Utility;
- import org.neuclear.xml.XMLException;
-
- import java.io.InputStream;
- import java.util.HashMap;
- import java.util.Map;
-
/**
* (C) 2003 Antilles Software Ventures SA
--- 1,4 ----
***************
*** 19,22 ****
--- 8,14 ----
* $Id$
* $Log$
+ * Revision 1.8 2003/12/04 21:50:36 pelle
+ * Mainly documentation changes.
+ *
* Revision 1.7 2003/11/21 04:45:14 pelle
* EncryptedFileStore now works. It uses the PBECipher with DES3 afair.
***************
*** 77,80 ****
--- 69,90 ----
* CommandLineSigner is simplified to make it easier to use.
*/
+
+ import org.neuclear.commons.NeuClearException;
+ import org.neuclear.commons.Utility;
+ import org.neuclear.id.NSTools;
+ import org.neuclear.id.SignedNamedObject;
+ import org.neuclear.id.verifier.VerifyingReader;
+ import org.neuclear.xml.XMLException;
+
+ import java.io.InputStream;
+ import java.util.HashMap;
+ import java.util.Map;
+
+ /**
+ * A Source for fetching a SignedNamedObject from some specified source.
+ * Developers not writing core NeuClear services would propably prefer to use the much simpler NSResolver.
+ *
+ * @see org.neuclear.id.resolver.NSResolver
+ */
public abstract class Source {
protected Source() {
***************
*** 82,85 ****
--- 92,108 ----
}
+ /**
+ * This is the main entry point to the Source pattern. Pass it a endpoint such as a URL as well as the name of the
+ * object in mind. It operates a two level caching with verified objects in memory and raw signed object stored on
+ * disk. Currently the default implementation is @see HttpSource which fetches via http.
+ * <code>
+ * SignedNamedObject obj=Source.getInstance().fetch("http://repository.neuclear.org/","neu://test");
+ * </code>
+ *
+ * @param endpoint
+ * @param name
+ * @return
+ * @throws NeuClearException
+ */
public final SignedNamedObject fetch(final String endpoint, String name) throws NeuClearException {
try {
***************
*** 99,103 ****
/**
! * This gets the stream of the content from the source
*
* @param endpoint
--- 122,126 ----
/**
! * This gets the stream of the content from the source. Implementers should overide this and return a Stream to the Signed Unverified information.
*
* @param endpoint
|