|
From: <pe...@us...> - 2003-09-24 23:56:57
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store
In directory sc8-pr-cvs1:/tmp/cvs-serv524/src/java/org/neuclear/store
Modified Files:
EncryptedFileStore.java FileStore.java Store.java
Log Message:
Refactoring nearly done. New model for creating signed objects.
With view for supporting the xmlpull api shortly for performance reasons.
Currently still uses dom4j but that has been refactored out that it
should now be very quick to implement a xmlpull implementation.
A side benefit of this is that the API has been further simplified. I still have some work
todo with regards to cleaning up some of the outlying parts of the code.
Index: EncryptedFileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/EncryptedFileStore.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** EncryptedFileStore.java 23 Sep 2003 19:16:29 -0000 1.3
--- EncryptedFileStore.java 24 Sep 2003 23:56:49 -0000 1.4
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/09/24 23:56:49 pelle
+ * Refactoring nearly done. New model for creating signed objects.
+ * With view for supporting the xmlpull api shortly for performance reasons.
+ * Currently still uses dom4j but that has been refactored out that it
+ * should now be very quick to implement a xmlpull implementation.
+ *
+ * A side benefit of this is that the API has been further simplified. I still have some work
+ * todo with regards to cleaning up some of the outlying parts of the code.
+ *
* Revision 1.3 2003/09/23 19:16:29 pelle
* Changed NameSpace to Identity.
***************
*** 124,128 ****
import org.dom4j.DocumentHelper;
import org.neuclear.id.NSTools;
! import org.neuclear.id.NamedObject;
import org.neuclear.id.NamedObjectFactory;
import org.neudist.crypto.CryptoTools;
--- 133,137 ----
import org.dom4j.DocumentHelper;
import org.neuclear.id.NSTools;
! import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.NamedObjectFactory;
import org.neudist.crypto.CryptoTools;
***************
*** 144,148 ****
}
! protected void rawStore(NamedObject obj) throws IOException, NeudistException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
--- 153,157 ----
}
! protected void rawStore(SignedNamedObject obj) throws IOException, NeudistException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
***************
*** 159,163 ****
}
! protected NamedObject fetch(String name) throws NeudistException {
String deURLizedName = NSTools.normalizeNameURI(name);
String inputFilename = base + getFileName(deURLizedName);
--- 168,172 ----
}
! protected SignedNamedObject fetch(String name) throws NeudistException {
String deURLizedName = NSTools.normalizeNameURI(name);
String inputFilename = base + getFileName(deURLizedName);
***************
*** 167,171 ****
return null;
! NamedObject ns = null;
try {
byte input[] = new byte[(int) fin.length()];
--- 176,180 ----
return null;
! SignedNamedObject ns = null;
try {
byte input[] = new byte[(int) fin.length()];
***************
*** 212,216 ****
}
! protected static String getFileName(NamedObject obj) throws NeudistException {
return getFileName(obj.getName());
}
--- 221,225 ----
}
! protected static String getFileName(SignedNamedObject obj) throws NeudistException {
return getFileName(obj.getName());
}
Index: FileStore.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/FileStore.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** FileStore.java 23 Sep 2003 19:16:29 -0000 1.3
--- FileStore.java 24 Sep 2003 23:56:49 -0000 1.4
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/09/24 23:56:49 pelle
+ * Refactoring nearly done. New model for creating signed objects.
+ * With view for supporting the xmlpull api shortly for performance reasons.
+ * Currently still uses dom4j but that has been refactored out that it
+ * should now be very quick to implement a xmlpull implementation.
+ *
+ * A side benefit of this is that the API has been further simplified. I still have some work
+ * todo with regards to cleaning up some of the outlying parts of the code.
+ *
* Revision 1.3 2003/09/23 19:16:29 pelle
* Changed NameSpace to Identity.
***************
*** 110,114 ****
import org.dom4j.Document;
import org.neuclear.id.NSTools;
! import org.neuclear.id.NamedObject;
import org.neuclear.id.NamedObjectFactory;
import org.neudist.utils.NeudistException;
--- 119,123 ----
import org.dom4j.Document;
import org.neuclear.id.NSTools;
! import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.NamedObjectFactory;
import org.neudist.utils.NeudistException;
***************
*** 131,135 ****
}
! protected void rawStore(NamedObject obj) throws IOException, NeudistException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
--- 140,144 ----
}
! protected void rawStore(SignedNamedObject obj) throws IOException, NeudistException {
String outputFilename = base + getFileName(obj);
System.out.println("Outputting to: " + outputFilename);
***************
*** 143,147 ****
// }
! protected NamedObject fetch(String name) throws NeudistException {
String inputFilename = base + getFileName(NSTools.normalizeNameURI(name));
System.out.println("Loading from: " + inputFilename);
--- 152,156 ----
// }
! protected SignedNamedObject fetch(String name) throws NeudistException {
String inputFilename = base + getFileName(NSTools.normalizeNameURI(name));
System.out.println("Loading from: " + inputFilename);
***************
*** 150,158 ****
return null;
! NamedObject ns = null;
try {
Document doc = XMLTools.loadDocument(new FileInputStream(fin));
ns = NamedObjectFactory.createNamedObject(doc);
! // System.out.println("NEUDIST: Fetched NamedObject tag:"+rootName.getName()+" URI:"+rootName.getNamespaceURI());
// } catch (ParserConfigurationException e) {
// Utility.rethrowException(e);
--- 159,167 ----
return null;
! SignedNamedObject ns = null;
try {
Document doc = XMLTools.loadDocument(new FileInputStream(fin));
ns = NamedObjectFactory.createNamedObject(doc);
! // System.out.println("NEUDIST: Fetched SignedNamedObject tag:"+rootName.getName()+" URI:"+rootName.getNamespaceURI());
// } catch (ParserConfigurationException e) {
// Utility.rethrowException(e);
***************
*** 175,179 ****
}
! protected static String getFileName(NamedObject obj) throws NeudistException {
return getFileName(obj.getName());
// if (! (obj instanceof Identity))
--- 184,188 ----
}
! protected static String getFileName(SignedNamedObject obj) throws NeudistException {
return getFileName(obj.getName());
// if (! (obj instanceof Identity))
Index: Store.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/store/Store.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Store.java 23 Sep 2003 19:16:29 -0000 1.3
--- Store.java 24 Sep 2003 23:56:49 -0000 1.4
***************
*** 2,5 ****
--- 2,14 ----
* $Id$
* $Log$
+ * Revision 1.4 2003/09/24 23:56:49 pelle
+ * Refactoring nearly done. New model for creating signed objects.
+ * With view for supporting the xmlpull api shortly for performance reasons.
+ * Currently still uses dom4j but that has been refactored out that it
+ * should now be very quick to implement a xmlpull implementation.
+ *
+ * A side benefit of this is that the API has been further simplified. I still have some work
+ * todo with regards to cleaning up some of the outlying parts of the code.
+ *
* Revision 1.3 2003/09/23 19:16:29 pelle
* Changed NameSpace to Identity.
***************
*** 38,42 ****
*
* Revision 1.5 2002/12/17 21:41:00 pelle
! * First part of refactoring of NamedObject and SignedObject Interface/Class parings.
*
* Revision 1.4 2002/12/17 20:34:42 pelle
--- 47,51 ----
*
* Revision 1.5 2002/12/17 21:41:00 pelle
! * First part of refactoring of SignedNamedObject and SignedObject Interface/Class parings.
*
* Revision 1.4 2002/12/17 20:34:42 pelle
***************
*** 45,51 ****
* on it before I'm happy.
* There is now a NSResolver class, which handles all the namespace resolution. I took most of the functionality
! * for this out of NamedObject.
! * Then there is the veriifer, which verifies a given NamedObject using the NSResolver.
! * This has simplified the NamedObject classes drastically, leaving them as mainly data objects, which is what they
* should be.
* I have also gone around and tightened up security on many different classes, making clases and/or methods final where appropriate.
--- 54,60 ----
* on it before I'm happy.
* There is now a NSResolver class, which handles all the namespace resolution. I took most of the functionality
! * for this out of SignedNamedObject.
! * Then there is the veriifer, which verifies a given SignedNamedObject using the NSResolver.
! * This has simplified the SignedNamedObject classes drastically, leaving them as mainly data objects, which is what they
* should be.
* I have also gone around and tightened up security on many different classes, making clases and/or methods final where appropriate.
***************
*** 119,123 ****
import org.neuclear.id.InvalidIdentityException;
! import org.neuclear.id.NamedObject;
import org.neuclear.id.verifier.NSVerifier;
import org.neuclear.receiver.Receiver;
--- 128,132 ----
import org.neuclear.id.InvalidIdentityException;
! import org.neuclear.id.SignedNamedObject;
import org.neuclear.id.verifier.NSVerifier;
import org.neuclear.receiver.Receiver;
***************
*** 133,137 ****
* This handles the Identity checking on the object.
*/
! public final void receive(NamedObject obj) throws InvalidIdentityException, NeudistException {
try {
// Dont allow overwrites
--- 142,146 ----
* This handles the Identity checking on the object.
*/
! public final void receive(SignedNamedObject obj) throws InvalidIdentityException, NeudistException {
try {
// Dont allow overwrites
***************
*** 161,165 ****
* Override this for each specific Store type
*/
! protected void rawStore(NamedObject obj) throws IOException, NeudistException {
;
}
--- 170,174 ----
* Override this for each specific Store type
*/
! protected void rawStore(SignedNamedObject obj) throws IOException, NeudistException {
;
}
|