|
From: <pe...@us...> - 2004-01-19 17:55:03
|
Update of /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders
In directory sc8-pr-cvs1:/tmp/cvs-serv32609/src/java/org/neuclear/id/builders
Modified Files:
Builder.java NamedObjectBuilder.java
Log Message:
Updated the NeuClear ID naming scheme to support various levels of semantics
Index: Builder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/Builder.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Builder.java 13 Jan 2004 15:11:35 -0000 1.2
--- Builder.java 19 Jan 2004 17:55:00 -0000 1.3
***************
*** 12,19 ****
import org.neuclear.commons.crypto.signers.NonExistingSignerException;
import org.neuclear.commons.crypto.passphraseagents.UserCancellationException;
! import org.dom4j.QName;
! import org.dom4j.Namespace;
! import org.dom4j.Element;
! import org.dom4j.DocumentHelper;
/**
--- 12,16 ----
import org.neuclear.commons.crypto.signers.NonExistingSignerException;
import org.neuclear.commons.crypto.passphraseagents.UserCancellationException;
! import org.dom4j.*;
/**
***************
*** 27,42 ****
public Builder(final QName qname) {
super(qname);
}
public Builder(final String name, final Namespace ns) {
super(name, ns);
}
public Builder(final Element elem) throws XMLSecurityException {
super(elem);
! }
public Builder(final String name, final String prefix, final String nsURI) {
super(name, prefix, nsURI);
}
--- 24,42 ----
public Builder(final QName qname) {
super(qname);
+ createDocument();
}
public Builder(final String name, final Namespace ns) {
super(name, ns);
+ createDocument();
}
public Builder(final Element elem) throws XMLSecurityException {
super(elem);
! createDocument(); }
public Builder(final String name, final String prefix, final String nsURI) {
super(name, prefix, nsURI);
+ createDocument();
}
***************
*** 45,49 ****
return VerifyingReader.getInstance().read(getElement());
}
!
/**
* Sign NamedObject using given PrivateKey. This also adds a timestamp to the root element prior to signing
--- 45,54 ----
return VerifyingReader.getInstance().read(getElement());
}
! private void createDocument() {
! final Element elem = getElement();
! if (elem.getDocument() == null) {
! final Document doc = DocumentHelper.createDocument(elem);
! }
! }
/**
* Sign NamedObject using given PrivateKey. This also adds a timestamp to the root element prior to signing
Index: NamedObjectBuilder.java
===================================================================
RCS file: /cvsroot/neuclear/neuclear-id/src/java/org/neuclear/id/builders/NamedObjectBuilder.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** NamedObjectBuilder.java 13 Jan 2004 23:38:26 -0000 1.24
--- NamedObjectBuilder.java 19 Jan 2004 17:55:00 -0000 1.25
***************
*** 2,5 ****
--- 2,8 ----
* $Id$
* $Log$
+ * Revision 1.25 2004/01/19 17:55:00 pelle
+ * Updated the NeuClear ID naming scheme to support various levels of semantics
+ *
* Revision 1.24 2004/01/13 23:38:26 pelle
* Refactoring parts of the core of XMLSignature. There shouldnt be any real API changes.
***************
*** 253,256 ****
--- 256,260 ----
*/
+ /*
protected NamedObjectBuilder(final String name, final String tagName, final Namespace ns) throws InvalidNamedObjectException {
super(tagName, ns);
***************
*** 258,265 ****
setName(name);
}
protected NamedObjectBuilder(final String name, final String tagName) throws InvalidNamedObjectException {
super(tagName, NSTools.NS_NEUID);
- createDocument();
setName(name);
}
--- 262,269 ----
setName(name);
}
+ */
protected NamedObjectBuilder(final String name, final String tagName) throws InvalidNamedObjectException {
super(tagName, NSTools.NS_NEUID);
setName(name);
}
***************
*** 267,271 ****
protected NamedObjectBuilder(final String name, final QName qname) throws InvalidNamedObjectException {
super(qname);
- createDocument();
setName(name);
}
--- 271,274 ----
***************
*** 344,353 ****
}
! private void createDocument() {
! final Element elem = getElement();
! if (elem.getDocument() == null) {
! final Document doc = DocumentHelper.createDocument(elem);
! }
! }
--- 347,351 ----
}
!
|